dslreports logo
 
    All Forums Hot Topics Gallery
spc
uniqs
642

stateq2
control the code
Premium Member
join:2003-03-27
Jackson, MS

stateq2

Premium Member

[SDL programming] setting framerate?

Sinbo01.tar.gz
20,017 bytes
i've recently been trying to code w/ SDL, and just started working on my first game. i can't figure out how to get a low framerate. it's a simple break out clone (no where near done), and the ball bounces at warp speed. it runs at 138 fps, but i think i need to get it down to 30.....not sure though. if anyone has experience w/ SDL development, i would appreciate it if you would please have a look at the code, and compile. the README file has all the directions. thanks alot

alien9999999
Your Head Looks Nice
Premium Member
join:2002-05-21
B-3000

alien9999999

Premium Member

that's quite easy:
you make a multithreaded application; and then do a nanosleep in the visual thread; depending on the time it took and the fps you want to get...

I've never programmed with SDL before, in fact, I refuse to use SDL, and we develop using X and GL only...

if you are interested in developping a 3D engine; take a look at »oriongame.sourceforge.net/ . at this moment we are in the process of making it multithreaded, so the CVS is not functional at this point; but the release works...

stateq2
control the code
Premium Member
join:2003-03-27
Jackson, MS

stateq2

Premium Member

multithreaded....that's a start. thanks....i'm also using thread to host the file while asking in other forums too funny you brought up 3d engine, because that was my ultimate goal....i was just making this game to get aquaited w/ sdl, then i was going to use that, as well as gl to start a small 3d engine. thanks for the info, because looking at an engine in early development will give me a good idea about what i'm tryin to accomplish

alien9999999
Your Head Looks Nice
Premium Member
join:2002-05-21
B-3000

alien9999999

Premium Member

you got that right, early development! besides if you really want to program & learn: we are looking for help... and there's really only 2 of us who are developing...

our 3D is on the move, but the 2D support is very minimal still, we need to improve on that.

btw: we feel that SDL really is not required, the mouse works adequatly, the keyboard works not quite better then release 0.0.1; all visualization is handled by X and GL and audio will probably be done with an ALSA plugin, so there's no need for SDL at all. it's a dependency too much, too much overhead, and totally unnecessary.

btw: I'll be using _pthread_ .

stateq2
control the code
Premium Member
join:2003-03-27
Jackson, MS

stateq2

Premium Member

great, i'll look into the engine tomorrow. i'll be happy to contribute any way i can btw, when you introduce a project to sourceforge, do they automatically host your project website for free?

alien9999999
Your Head Looks Nice
Premium Member
join:2002-05-21
B-3000

alien9999999

Premium Member

if you are accepted, yes

stateq2
control the code
Premium Member
join:2003-03-27
Jackson, MS

stateq2

Premium Member

nice