Welcome, Guest. Please login or register.

Login with username, password and session length
Pages: [1]
  Print  
Author Topic: SDL is goooood  (Read 932 times)
yuumei
Oh-oh
*

Rep: +2/-0
Offline Offline

Gender: Male
Posts: 242


"mooooo~"

yuumei@hotmail.co.uk
View Profile WWW
« on: 07/Apr/2007 21:02:17 »

Check out SDL. Its a small library that sits on top of  your windows app. It looks exactly the same as a normal windows app, with the message loop:
Code:
while ( !done )
{
    // message processing loop
    SDL_Event event;
    while ( SDL_PollEvent(&event) )
    {
// check for messages
switch ( event.type )
{
case SDL_QUIT: {
// exit if the window is closed
done = true;
}
break;
case SDL_KEYUP: {
input.SetKey( event.key.keysym.sym, false );
}
break;
}
}
}
The only difference is that doing it this way, without all the messy windows initialization code will make it portable to any operating system. It works with linux and a load of other ones. The dll is only about 200kb, so you wont have to sacrifice speed or size for using it.
I have been using opengl with it too, because it has support for that built in.
Overall a very useful resource.
Logged

Pages: [1]
  Print  
 
Jump to: