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:
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.