[Home] [Credit Search] [Category Browser] [Staff Roll Call] | The LINUX.COM Article Archive |
Originally Published: Monday, 25 June 2001 | Author: Josh Boudreau |
Published to: develop_articles_tutorials/Development Tutorials | Page: 4/4 - [Printable] |
Programming Linux Games: An Introduction to SDL Development
Welcome to Game Week on Linux.com! All this week we'll be featuring and playing games. The game week feature article by Linux.com writer Josh "bitwize" Boudreau is a succinct introduction to programming with the SDL (Simple DirectMedia Layer) library, essential to understanding Linux game development. So all you game programmers or would be game programmers: read up!
|
<< Page 4 of 4 | |
Event Handling
One of the best features of SDL is its ability to handle user input and events. SDL handles events by sending and receiving event messages through a queue. When your application receives a new event it is placed at the end of the queue. One of the data types we will see is the
To read new events from the queue we will be using the
In the above example, the code enters a Time Synchronization
The timer subsystem of SDL can be used to synchronize your game at a constant speed or frame rate. SDL provides a timer in millisecond resolution.
The synchronization is done in a way similar to a countdown timer, where the Conclusion
This article only scratched the surface of a few features of SDL and if you are serious about developing applications with SDL you should read the API documentation at www.libsdl.org which describes all the functions. To get information on a specific function you can also read the man pages by typing SDL Web Site: www.libsdl.org
| |
<< Page 4 of 4 |