Skip to content

Instantly share code, notes, and snippets.

@eterps
Created Sep 9, 2018
Embed
What would you like to do?
obnc input focus issue
#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) {
}
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"
MODULE Gfx;
PROCEDURE Do*;
END Do;
END Gfx.
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