Mercurial > projects > mde
diff mde/setup/Screen.d @ 97:30470bc19ca4
Floating widgets now work nicely: customizable borders added, resizing, moving.
gl.basic abstraction module removed (seemed pointless).
Some changes to SimpleRenderer (largely to accomodate floating widgets).
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Mon, 10 Nov 2008 16:44:44 +0000 |
parents | 2a364c7d82c9 |
children | 49e7cfed4b34 |
line wrap: on
line diff
--- a/mde/setup/Screen.d Thu Nov 06 13:16:39 2008 +0000 +++ b/mde/setup/Screen.d Mon Nov 10 16:44:44 2008 +0000 @@ -28,7 +28,7 @@ import tango.time.Time; // TimeSpan (type only; unused) import derelict.sdl.sdl; -import derelict.opengl.gl; // for loading a later gl version +import derelict.opengl.gl; import derelict.util.exception; /** Currently just used as a namespace. Potential for multiple screen support later? */ @@ -56,9 +56,8 @@ /** Init function to initialize SDL. */ StageState init () { // init func // Initialise SDL - debug logger.trace ("Calling SDL_Init"); - //FIXME: init SDL_INIT_TIMER? - if (SDL_Init (SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_TIMER /+| SDL_INIT_EVENTTHREAD+/)) { + debug logger.trace ("Calling SDL_Init (SDL_INIT_VIDEO | SDL_INIT_JOYSTICK)"); + if (SDL_Init (SDL_INIT_VIDEO | SDL_INIT_JOYSTICK /+| SDL_INIT_EVENTTHREAD+/)) { logger.fatal ("SDL initialisation failed:"); char* msg = SDL_GetError (); logger.fatal (msg ? fromStringz(msg) : "no reason available"); @@ -69,7 +68,7 @@ } /** SDL shutdown */ StageState cleanup () { - debug logger.trace ("Calling SDL_Quit"); + debug logger.trace ("Calling SDL_Quit ()"); SDL_Quit(); return StageState.INACTIVE; } @@ -134,7 +133,6 @@ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glEnable(GL_TEXTURE_2D); glShadeModel(GL_SMOOTH); glClearColor (0.0f, 0.0f, 0.0f, 0.0f); @@ -148,7 +146,6 @@ //NOTE: wrap mode may have an effect, but shouldn't be noticed... // Window-manager settings - debug logger.trace ("Calling SDL_WM_SetCaption"); SDL_WM_SetCaption (toStringz ("mde"), null); // SDL_WM_GrabInput (use later) //END Create window and initialize OpenGL @@ -217,7 +214,7 @@ } //debug logger.trace ("Setting video mode {}x{}, 32-bit, flags: {}", w,h,flags); - debug logger.trace ("Calling SDL_SetVideoMode"); + debug logger.trace ("Calling SDL_SetVideoMode ({}, {}, 32, 0x{:x})", w,h, flags); if (SDL_SetVideoMode (w, h, 32, flags) is null) { logger.fatal ("Unable to set video mode:"); char* msg = SDL_GetError ();