Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Render() {
- glClearColor( 0, 0, 0, 0 );
- }
- int main(int argc, char *argv[])
- {
- int rc = SDL_Init(SDL_INIT_VIDEO);
- assert(rc == 0);
- /*SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);*/
- /*SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 4);*/
- int width = 800;
- int height = 600;
- SDL_Surface *surface = SDL_SetVideoMode(width, height, 32, SDL_OPENGL | SDL_RESIZABLE | SDL_DOUBLEBUF);
- assert(surface != 0);
- SDL_WM_SetCaption("awesome", 0);
- int done = 0;
- while (!done) {
- SDL_Event event;
- while (SDL_PollEvent(&event)) {
- switch (event.type) {
- case SDL_KEYDOWN:
- if (event.key.keysym.sym == SDLK_ESCAPE) done = 1;
- break;
- case SDL_QUIT:
- done = 1;
- break;
- }
- }
- Render();
- }
- SDL_Quit();
- return 0;
- }
Add Comment
Please, Sign In to add comment