Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <SDL/SDL.h>
- #undef main
- int main(){
- SDL_Event event;
- SDL_Surface * surface;
- SDL_INIT(SDL_INIT_EVERYTHING);
- atexit(SDL_QUIT);
- surface = SDL_SetVideoMode(1366, 768, 32, SDL_HWSURFACE|SDL_DOUBLEBUF);
- for(;;){
- if(SDL_PollEvent(&event)){
- //Clicks and other stuff
- switch(event.type){
- case SDL_QUIT:
- return 0;
- case SDL_KEYDOWN:
- switch(event.key.keysym.sym){
- case SDLK_ESCAPE:
- return 0;
- continue;
- }
- SDL_FillRect(surface, NULL, 0x0);
- SDL_LockSurface(surface);
- //Rendering and other stuff
- SDL_UnlockSurface(surface);
- SDL_Flip(surface);
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment