X-Git-Url: http://git.mutantstargoat.com?a=blobdiff_plain;f=src%2Fsdl%2Fgfx.cc;h=aec9663a853f8eb1cf8c2762fe692236762926b0;hb=52044efd7717f4b02bd463c9a26f83c9a41953ea;hp=b7576888ee6ec7798dad12b346faea47c67175bc;hpb=6dc42c0e7292d6d94de640ddd7de3ee5c808e9c2;p=winnie diff --git a/src/sdl/gfx.cc b/src/sdl/gfx.cc index b757688..aec9663 100644 --- a/src/sdl/gfx.cc +++ b/src/sdl/gfx.cc @@ -9,6 +9,8 @@ static SDL_Surface *fbsurf; static Rect screen_rect = {0, 0, 1024, 768}; static int color_depth = 32; // bits per pixel +static Pixmap *pixmap; + bool init_gfx() { if(SDL_Init(SDL_INIT_VIDEO) == -1) { @@ -22,11 +24,20 @@ bool init_gfx() } SDL_ShowCursor(0); + pixmap = new Pixmap; + + pixmap->width = screen_rect.width; + pixmap->height = screen_rect.height; + + pixmap->pixels = (unsigned char*)fbsurf->pixels; + return true; } void destroy_gfx() { + pixmap->pixels = 0; + delete pixmap; SDL_Quit(); } @@ -35,6 +46,11 @@ unsigned char *get_framebuffer() return (unsigned char*)fbsurf->pixels; } +Pixmap *get_framebuffer_pixmap() +{ + return pixmap; +} + Rect get_screen_size() { return screen_rect; @@ -167,4 +183,8 @@ void gfx_update() SDL_UpdateRect(fbsurf, 0, 0, 0, 0); } +void wait_vsync() +{ +} + #endif // WINNIE_SDL