projects
/
winnie
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added fonts - works with sdl version
[winnie]
/
src
/
sdl
/
gfx.cc
diff --git
a/src/sdl/gfx.cc
b/src/sdl/gfx.cc
index
5be33e6
..
aec9663
100644
(file)
--- 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 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) {
bool init_gfx()
{
if(SDL_Init(SDL_INIT_VIDEO) == -1) {
@@
-22,11
+24,20
@@
bool init_gfx()
}
SDL_ShowCursor(0);
}
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()
{
return true;
}
void destroy_gfx()
{
+ pixmap->pixels = 0;
+ delete pixmap;
SDL_Quit();
}
SDL_Quit();
}
@@
-35,6
+46,11
@@
unsigned char *get_framebuffer()
return (unsigned char*)fbsurf->pixels;
}
return (unsigned char*)fbsurf->pixels;
}
+Pixmap *get_framebuffer_pixmap()
+{
+ return pixmap;
+}
+
Rect get_screen_size()
{
return screen_rect;
Rect get_screen_size()
{
return screen_rect;