Mercurial > projects > mde
comparison mde/sdl.d @ 41:b3a6ca4516b4
The renderer now controls which parts of the window border allow resizing.
committer: Diggory Hardy <diggory.hardy@gmail.com>
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Tue, 13 May 2008 12:02:36 +0100 |
parents | 57d000574d75 |
children | 0fd51d2c6c8a |
comparison
equal
deleted
inserted
replaced
40:b28d7adc786b | 41:b3a6ca4516b4 |
---|---|
51 debug logger.trace ("SDL initialised"); | 51 debug logger.trace ("SDL initialised"); |
52 | 52 |
53 // Must be called after SDL has been initialised, so cannot be a separate Init function. | 53 // Must be called after SDL has been initialised, so cannot be a separate Init function. |
54 openJoysticks (); // after SDL init | 54 openJoysticks (); // after SDL init |
55 cleanup.addFunc (&cleanupSDL, "cleanupSDL"); | 55 cleanup.addFunc (&cleanupSDL, "cleanupSDL"); |
56 | 56 |
57 setupWindow(); | 57 setupWindow(); |
58 } | 58 } |
59 | 59 |
60 void setupWindow() { // indirect init func (depends on initSdlAndGl) | 60 void setupWindow() { // indirect init func (depends on initSdlAndGl) |
61 // Window creation flags and size | 61 // Window creation flags and size |
81 SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8); | 81 SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8); |
82 SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); | 82 SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); |
83 SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER,1); | 83 SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER,1); |
84 | 84 |
85 // Open a window | 85 // Open a window |
86 debug logger.trace ("Opening a window (this can crash if the libraries are messed up)"); | |
86 if (SDL_SetVideoMode (w, h, 32, flags) is null) { | 87 if (SDL_SetVideoMode (w, h, 32, flags) is null) { |
87 logger.fatal ("Unable to set video mode:"); | 88 logger.fatal ("Unable to set video mode:"); |
88 char* msg = SDL_GetError (); | 89 char* msg = SDL_GetError (); |
89 logger.fatal (msg ? fromStringz(msg) : "no reason available"); | 90 logger.fatal (msg ? fromStringz(msg) : "no reason available"); |
90 | 91 |