panik
Member
[Edit: solved: Ubuntu + Nvidia Fail]
I've been experimenting with the LazyFoo tutorials. They're great, but I find the drawing of moving images somewhat "choppy".
I tried on Linux and Windows.
It's best seen on "Lesson21 - Scrolling" (http://lazyfoo.net/SDL_tutorials/lesson21/index.php)
First I thought it was the SDL rendering. Changing the drawing methods to OpenGL didn't help, it's still "choppy".
I used this code for drawing: http://gpwiki.org/index.php/SDL:Tutorials:Using_SDL_with_OpenGL
Also I changed to OpenGL to be able to rotate surfaces more easily (that works great by the way).
Using "Frame independent movement" (Lesson32 on LazyFoo) also doesn't help against choppiness.
I get over 850 FPS on my Ubuntu machine. However: it's choppy. As if every couple of hundred milliseconds a "hickup" occurs.
In the gameloop, there's also a "SDL_Delay(1)". A delay of 1 millisecond to release burden on the processor somewhat.
Please find my project here:
Choppy SDL project
A Makefile is included. After "make", start "./game" from the commandline. It probably runs on Linux only though (I use Ubuntu).
Use the arrow-keys to move the arrow, escape to quit.
I mostly did Java before, and this is my first project ever written in C++/SDL. It's in its *very* early stages.
I would love feedback on all aspects of the code, but mostly would like to hear your thoughts on the "choppinness".
Thanks in advance!
Edit:
Also found this topic:
http://www.gp32x.de/board/index.php?/topic/49951-sdl-smooth-scrolling-tips/
And tried the demos at:
http://olofson.net/examples.html
But I think they're not that smooth as well.
I've been experimenting with the LazyFoo tutorials. They're great, but I find the drawing of moving images somewhat "choppy".
I tried on Linux and Windows.
It's best seen on "Lesson21 - Scrolling" (http://lazyfoo.net/SDL_tutorials/lesson21/index.php)
First I thought it was the SDL rendering. Changing the drawing methods to OpenGL didn't help, it's still "choppy".
I used this code for drawing: http://gpwiki.org/index.php/SDL:Tutorials:Using_SDL_with_OpenGL
Also I changed to OpenGL to be able to rotate surfaces more easily (that works great by the way).
Using "Frame independent movement" (Lesson32 on LazyFoo) also doesn't help against choppiness.
I get over 850 FPS on my Ubuntu machine. However: it's choppy. As if every couple of hundred milliseconds a "hickup" occurs.
In the gameloop, there's also a "SDL_Delay(1)". A delay of 1 millisecond to release burden on the processor somewhat.
Please find my project here:
Choppy SDL project
A Makefile is included. After "make", start "./game" from the commandline. It probably runs on Linux only though (I use Ubuntu).
Use the arrow-keys to move the arrow, escape to quit.
I mostly did Java before, and this is my first project ever written in C++/SDL. It's in its *very* early stages.
I would love feedback on all aspects of the code, but mostly would like to hear your thoughts on the "choppinness".
Thanks in advance!
Edit:
Also found this topic:
http://www.gp32x.de/board/index.php?/topic/49951-sdl-smooth-scrolling-tips/
And tried the demos at:
http://olofson.net/examples.html
But I think they're not that smooth as well.
Last edited by a moderator: