luasdl2 icon indicating copy to clipboard operation
luasdl2 copied to clipboard

[REQUEST] more examples

Open lewislepton opened this issue 10 years ago • 63 comments

the examples given are great, but only really go to a certain point.

SDL in itself is pretty big, and think that addressing things like, drawing shapes, working with and importing other lua files, and interaction are a good thing to have. really it could go on, but i think the main crux would be the have a few more examples for people to dive into further and to keep interested. if you get me?

plus since there is not really any other info online for this, then would be more useful to others who are using this repo

cheers

lewislepton avatar Apr 26 '15 14:04 lewislepton

A simple benchmark would be welcomed!

ghost avatar Apr 26 '15 16:04 ghost

ive started to make some now. just tearing apart the ones given plus looking at other places. have done a pull request for using keyboard to move something round on screen. just some small things, but hopefully useful as well

lewislepton avatar Apr 26 '15 16:04 lewislepton

I'd like to be able to get the fps and based on that make some simple benchmarks like displaying 5000 images and see how's the fps.

ghost avatar Apr 26 '15 16:04 ghost

what i would suggest just now until more come - is to go through some SDL2 stuff. some things are the same in context. it is just the change to lua thats one of the bigger things

lewislepton avatar Apr 26 '15 16:04 lewislepton

here is a link to a SDL2 tutorial series i came across. has helped as well. im dyslexic so reading can be just hard to do and understand, but videos are cool because you get to see what happening also another im adding since its a deeper SDL2 tutorial

coding made easy https://www.youtube.com/playlist?list=PLHJE4y54mpC5_eEz9gCqIkNpU-n_2eyNt

making games with ben. personal favourite since it build on making SDL engine. but good learning ;) https://www.youtube.com/channel/UCL5m1_llmeiAdZMo_ZanIvg

lewislepton avatar Apr 29 '15 11:04 lewislepton

another to add to this list of possible looks at. whilst love2d and lua-SDL2 are apart, its more thu lua side you need to look at. but good to know also ;) though, i cant stand the guy talking, just waffles on about things which are not pretinent to the tutorial at hand. plus shouts. odd.

https://www.youtube.com/user/sockmunkeedevelopmen

lewislepton avatar Apr 30 '15 11:04 lewislepton

@lewislepton You have a long path till you can get to actually make games with lua-sdl.First of all you wont be able to make something bigger than a space invaders clone because of the performance.You need to make a simple sprite class or smt like this in C++ and from there render all your objects and use lua just for logic.I'll probably start doing this in the next days.

ghost avatar Apr 30 '15 20:04 ghost

But since I dislike C++ this will probably take a while ...

ghost avatar Apr 30 '15 20:04 ghost

i do some openframeworks/c++ tutorials, which i dont mind. though dont like c++ myself. have linked a lua addon with it, but its limited.

in my own game making wihh lua-sdl2 i dont want to do really big projects. really minimal 2d based just now. hopefully if more examples and also more info on lua-sdl2 come to light to help with more on it and for more bigger game things. then by time projects could become bigger. but again, its all time really. its just unlearning things i know now to make way for these things.

but really if we wele to use c++ with sdl2 we would be in the same position

lewislepton avatar Apr 30 '15 21:04 lewislepton

@Murii: by all means profile, but if you need sprite performance, keep in mind that you would probably want to let SDL manage the window but do the actual rendering with OpenGL.

As I understand it, SDL's built-in renderer is not strongly optimized and lacks batching support, since they assume people with performance needs will use OpenGL anyways.

Tangent128 avatar Apr 30 '15 22:04 Tangent128

@Tangent128 a mix with openGL is most welcomed in my camp ;) plus in any of the tutorials or anything like that ive come across, openGl is quickly introduced how would we get this with working with lua-SDL2? more a future thing i guess. but if we would be able mix it up with openGL and lua-SDL2, then id love to know more ;)

lewislepton avatar Apr 30 '15 23:04 lewislepton

@Tangent128 but as you said, openGL would manage the graphical side, rendering etc. SDL is really is for the other stuff, like window mangament, joysticks, input etc

lewislepton avatar Apr 30 '15 23:04 lewislepton

actually did just come across this. which has recently been updated http://luagl.sourceforge.net/

though again, mac users seem to be left in the dark. but would think this would work since it can build on linux. mac and linux do have some, some build similarites

lewislepton avatar Apr 30 '15 23:04 lewislepton

did just contact one of the guys who puts the downloads up and takes care of it. just to ask in how to build on mac. since it seems active just for windows/linux users.

but if this works. then i wouldnt see how having these 2 would be a problem. wait and see

lewislepton avatar May 01 '15 00:05 lewislepton

actually just working with the guy who built luaGL to do a mac build. since it has the same thing of not locating lua off the bat from the usr/local/etcetcetc

so hopefully have that up and running soon. which should in turn be good with working in lua-SDL2 for handling

there is however a LuaRock, but it is different - in that it has not been updated in about a year. and LuaGL had just been updated about 5 or 6 days ago

here is the original luaGL location http://luagl.sourceforge.net/

here is the LuaRock location, which does link the above link. i have contacted the luaRock guy to ask if it will be updated to the newer build. have not heard anything back yet https://luarocks.org/modules/luarocks/luagl

never worked with LuaRocks before, but really tempted now, but dont want to use something which is older than the source, even if it is easier to install

lewislepton avatar May 01 '15 13:05 lewislepton

got luaGL to build, but getting it into to work is more than just dropping it in the folder with /usr/local/lua/etcetc

but its getting near, will keep posted. but if this works with SDL, which it should. then this will answer that performance question. leave SDL for the file managment, inputs etc and use OpenGL for the graphics and other heavy stuff

lewislepton avatar May 01 '15 16:05 lewislepton

There must be a better solution! try using glew or smt?

ghost avatar May 01 '15 16:05 ghost

what way though. because everything that i have seen that uses SDL also uses opnGL

when i get luaGL working that will answer a lot for me. plus can just get on with maing things. true ill more than likely have to do some other coding to get things working properly, but thats what you get if youre using something like sdl and opengl

if its quick coding and getting stuff done in lua, why notook into love2d or even moonscript?

lewislepton avatar May 01 '15 16:05 lewislepton

Let us know if you manage to make luaGL to work!

ghost avatar May 01 '15 17:05 ghost

@Murii will do. but as the guy has said to me, it should build fine in linux and also windows. just mac seems to be the problem for some reason. but think its the same as to what it was when building Lua-SDL2

but its getting close. just needs to find the .dylib to start running, but thats the only trouble

lewislepton avatar May 01 '15 17:05 lewislepton

but once we get these solved a new update will go up that should fix everything for all platforms

lewislepton avatar May 01 '15 17:05 lewislepton

BOOM. working now. have not gone into the nitty gritty and made something. BUT, it works through using sublime to build. the guy will more than likely be doing a new download and build soon. but this problem was with mac, so think linux users and windows are fine from what i know

here is a screenshot just to show it building. will do a simple thing to show it working soon screen shot 2015-05-01 at 19 11 21

lewislepton avatar May 01 '15 18:05 lewislepton

forgot to metion, it also uses luaglu as well as luagl

lewislepton avatar May 01 '15 18:05 lewislepton

nice,nice! I'm looking forward to see a simple example!

ghost avatar May 01 '15 18:05 ghost

just now finished making a dirty auto complete for it, just to help. so will now try making something

lewislepton avatar May 01 '15 18:05 lewislepton

OK

ghost avatar May 01 '15 18:05 ghost

ill have something soon. i really have just started with luaGL, but it so different, since it does not deal with some things. so really am getting it to talk to SDL nicely.

will have something just not quickly ;)

lewislepton avatar May 01 '15 22:05 lewislepton

just having a little trouble due to the examples are using different video out, not SDL. so just figuring that out now. but will continue in the morning since its late http://luagl.sourceforge.net/examples/

lewislepton avatar May 01 '15 23:05 lewislepton

have not been able to get something running with luaGL, just so different really. it has not ran into any problems with errors. just getting something off the groud is more hard. the examples for luaGl are using something else for window management, but even changing things to lua-SDL2 have been some what crap and do error.

i need to really stick with lua-SDL2 more right now. but really i feel that luaGL is working, though i cant get something right now. ill keep pressing on and trying when i feel up to it. but for now, just want to try and learn SDL more because that initially what i was after.

sitll having some trouble in getting some of that to run, even if i am changing the syntax to what it should be, still trouble. but have to press on. ive even gone to using love2d a little bit because i love the layout and coding style. sadly lua-SDL2 is not that straight forward but hey. would be best to actually make functions to call up with lua-SDL2 and make your own kind of language to suit needs i think

lewislepton avatar May 02 '15 23:05 lewislepton

Yeah...lua and sdl is not enought.You still need to put lots of time and effort to start actually make something.

On Du, mai 3, 2015 at 2:27 , leòdhas lepton [email protected] wrote:

have not been able to get something running with luaGL, just so different really. it has not ran into any problems with errors. just getting something off the groud is more hard. the examples for luaGl are using something else for window management, but even changing things to lua-SDL2 have been some what crap and do error.

i need to really stick with lua-SDL2 more right now. but really i feel that luaGL is working, though i cant get something right now. ill keep pressing on and trying when i feel up to it. but for now, just want to try and learn SDL more because that initially what i was after.

sitll having some trouble in getting some of that to run, even if i am changing the syntax to what it should be, still trouble. but have to press on. ive even gone to using love2d a little bit because i love the layout and coding style. sadly lua-SDL2 is not that straight forward but hey. would be best to actually make functions to call up with lua-SDL2 and make your own kind of language to suit needs i think

— Reply to this email directly or view it on GitHub.

ghost avatar May 02 '15 23:05 ghost