Created
September 9, 2018 17:35
-
-
Save eterps/a403d5c8226bbef18c143a6f21a96356 to your computer and use it in GitHub Desktop.
obnc input focus issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <obnc/OBNC.h> | |
#include ".obnc/Gfx.h" | |
#include <stdbool.h> | |
#include "SDL.h" | |
SDL_Surface *screen; | |
SDL_Event event; | |
void Gfx_Do_(void) { | |
SDL_Init(SDL_INIT_VIDEO); | |
screen = SDL_SetVideoMode(640, 480, 16, SDL_SWSURFACE); | |
SDL_WM_SetCaption("Simple Window", "Simple Window"); | |
bool done=false; | |
while(!done) { | |
while(SDL_PollEvent(&event)) { | |
if (event.type == SDL_QUIT) { | |
done=true; | |
} | |
} | |
SDL_FillRect(screen, &screen->clip_rect, SDL_MapRGB(screen->format, 0, 0, 0)); | |
SDL_Flip(screen); | |
} | |
SDL_Quit(); | |
} | |
void Gfx_Init(void) { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CC=gcc | |
CFLAGS="-I/usr/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE" | |
LDLIBS="-L/usr/local/lib -lSDLmain -lSDL -Wl,-framework,Cocoa" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MODULE Gfx; | |
PROCEDURE Do*; | |
END Do; | |
END Gfx. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MODULE gfxtest; | |
IMPORT Gfx; | |
BEGIN | |
Gfx.Do | |
END gfxtest. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment