Page 2 of 2

Re: Smooth Movement?

Posted: Thu Apr 19, 2012 8:13 pm
by RandomDever
@lalacomun I would absolutely LOVE to be using OpenGL BUT I couldn't figure that out when I tried it before.
And that was back when I had time to mess around with it.
And by the way bumping up the frame rate help ALOT so thank you SO much.
Now I can finally resume development. :mrgreen:
Again thank you.

Re: Smooth Movement?

Posted: Thu Apr 19, 2012 8:49 pm
by lalacomun
Really glad i could help You :) anything else You need just ask,ill be glad to answer ;)

Re: Smooth Movement?

Posted: Fri Apr 20, 2012 5:54 pm
by Light-Dark
k1net1k wrote:You need to narrow down your engine to the point where you can eliminate things causing it.
Start by removing textures, remove all characters, remove lighting, remove AI, slow down the game loop, use more debugging, etc. Keep going until you find the thing causing it, then drill down into that
Trufax, that is what i do for debugging mem leaks and crashes.

Re: Smooth Movement?

Posted: Fri Apr 20, 2012 8:54 pm
by avansc
Light-Dark wrote:
k1net1k wrote:You need to narrow down your engine to the point where you can eliminate things causing it.
Start by removing textures, remove all characters, remove lighting, remove AI, slow down the game loop, use more debugging, etc. Keep going until you find the thing causing it, then drill down into that
Trufax, that is what i do for debugging mem leaks and crashes.
That is one option, and may work for small programs, and may even be the best option for beginners.

However, there are a few problems with this approach.

1. This does not scale.
2. This does not tell you what the root cause is.

I suggest you use the IDE's debugger, and step through the program, look at why is crashing. This will teach you better habits, it will also make you a better programer. (it will also prepare you for a job as a programmer, if you choose to end up there, since debugging ends up being the vast majority of the work in a products lifecycle)

PS: I would even suggest to use windbg/gdb or whatever, and learn to use that. It has by far the biggest learning curve, but will teach you the most.

Re: Smooth Movement?

Posted: Wed Apr 25, 2012 11:04 am
by RandomDever
Well besides running my game at 100 fps, is there an easy way to implement OpenGL into my 'engine' so I don't have to do that for future projects?

Re: Smooth Movement?

Posted: Wed Apr 25, 2012 3:25 pm
by lalacomun
RandomDever wrote:Well besides running my game at 100 fps, is there an easy way to implement OpenGL into my 'engine' so I don't have to do that for future projects?
i think you could load an OpenGL Texture from your SDL Surfaces, here:

http://content.gpwiki.org/index.php/SDL ... ith_OpenGL

But remember you will not be able to draw an openGL Texture with SDL_BlitSurface function :(
hope it helped ;)

Re: Smooth Movement?

Posted: Thu Apr 26, 2012 9:04 am
by RandomDever
Well that's a start but is there like an all-inclusive beginner's guide for people retooling from SDL to OpenGL because I have attempted this before and OpenGL does not like text rendering.

Re: Smooth Movement?

Posted: Thu Apr 26, 2012 4:50 pm
by dandymcgee
RandomDever wrote:Well that's a start but is there like an all-inclusive beginner's guide for people retooling from SDL to OpenGL because I have attempted this before and OpenGL does not like text rendering.
I think you can use SDL_ttf to generate a texture then render it with OpenGL, but usually you just use a bitmap font. I remember text in OpenGL being a pain as well.

Re: Smooth Movement?

Posted: Thu Apr 26, 2012 6:10 pm
by lalacomun
here you go:

http://www.sdltutorials.com/sdl-opengl-tutorial-basics

i havent read it all but it seems complete ;)

Re: Smooth Movement?

Posted: Thu Apr 26, 2012 6:29 pm
by lalacomun
well as regarding to text rendering it may be a pain in the ass :oops: but here some tuts on text
rendering with OpenGL:

http://www.opentk.com/doc/graphics/how- ... ing-opengl
http://en.wikibooks.org/wiki/OpenGL_Pro ... ndering_01

hope it helped ;)

Re: Smooth Movement?

Posted: Fri Apr 27, 2012 8:15 am
by RandomDever
Indeed it did. Thank you.
BTW do you have any good articles on level design theory?

Edit: Specifically 2d platform level design theory.