31 |
#include "../axis/axis.h" |
#include "../axis/axis.h" |
32 |
|
|
33 |
|
|
34 |
RenderMan::RenderMan(int x, int y, bool fullscreen) { |
RenderMan::RenderMan(int x, int y, bool fullscreen, Uint8 colorDepth) { |
35 |
|
|
36 |
// include ourselves in the pointerhub for everyone else to use |
// include ourselves in the pointerhub for everyone else to use |
37 |
PointerHub::SetRenderMan(this); |
PointerHub::SetRenderMan(this); |
39 |
// set screen dims for future reference |
// set screen dims for future reference |
40 |
XRES = x; |
XRES = x; |
41 |
YRES = y; |
YRES = y; |
42 |
|
color_depth = colorDepth; |
43 |
tile_size = 32; // default to 32 |
tile_size = 32; // default to 32 |
44 |
|
|
45 |
// every ParaGUI application need an application-object |
// every ParaGUI application need an application-object |
66 |
// 0 - use screen bitdepth |
// 0 - use screen bitdepth |
67 |
// SDL_SWSURFACE - PG_ option to generate surface in system memory |
// SDL_SWSURFACE - PG_ option to generate surface in system memory |
68 |
if (fullscreen == 0) { |
if (fullscreen == 0) { |
69 |
app->InitScreen(XRES, YRES, 16, SDL_SWSURFACE); |
app->InitScreen(XRES, YRES, color_depth, SDL_SWSURFACE); |
70 |
} |
} |
71 |
else { |
else { |
72 |
app->InitScreen(XRES, YRES, 16, SDL_SWSURFACE | SDL_FULLSCREEN); |
app->InitScreen(XRES, YRES, color_depth, SDL_SWSURFACE | SDL_FULLSCREEN); |
73 |
} |
} |
74 |
|
|
75 |
|
//If we wanted to detect color depth automatically, have to do so here: |
76 |
|
if(color_depth == 0) { |
77 |
|
color_depth = app->GetScreen()->format->BitsPerPixel; |
78 |
|
} |
79 |
|
|
80 |
// the master widget - every other widget is a child of this |
// the master widget - every other widget is a child of this |
81 |
master_widget = new PG_Widget(NULL, PG_Rect(0,0,XRES,YRES)); |
master_widget = new PG_Widget(NULL, PG_Rect(0,0,XRES,YRES)); |
82 |
master_widget->Show(); |
master_widget->Show(); |