How do I do a game loop in c99?

Posted by linitbuff on Game Development See other posts from Game Development or by linitbuff
Published on 2012-03-18T10:27:18Z Indexed on 2012/03/18 18:24 UTC
Read the original article Hit count: 135

Filed under:
|
|

I'm having trouble with how to structure a game using c99. I've seen a few tutorials on making a game loop, but they are all done with c++ and classes. My main problem seems to be moving data around between the functions without creating a mess, and what stuff to put in what header files etc. Do I just do something similar to the c++ loops, and create a class-like header with a structure containing all items needed by more than one of the functions, along with the prototypes of said functions, and include the header in each function's header file? Then, in the main function, instantiate the structure and pass a pointer to it to every function in the loop?

Is this ok, or is there a better way to do it, and are there any good 'c' specific tutorials available?

Cheers

© Game Development or respective owner

Related posts about c

    Related posts about gameloop