comparison mde/gl/draw.d @ 45:0fd51d2c6c8a

Several changes to resising windows and layout widgets. This commit still has some bugs. Moved the implementable widgets from mde.gui.widget.Widget to miscWidgets, leaving base widgets in Widget. Rewrote some of GridLayoutWidget's implementation. Made many operations general to work for either columns or rows. Some optimisations were intended but ended up being removed due to problems. Allowed layout's to resize from either direction (only with window resizes). committer: Diggory Hardy <diggory.hardy@gmail.com>
author Diggory Hardy <diggory.hardy@gmail.com>
date Thu, 22 May 2008 11:34:09 +0100
parents 316b0230a849
children a98ffb64f066
comparison
equal deleted inserted replaced
44:07bd1a09e161 45:0fd51d2c6c8a
22 22
23 import derelict.sdl.sdl; 23 import derelict.sdl.sdl;
24 import derelict.opengl.gl; 24 import derelict.opengl.gl;
25 25
26 import tango.time.Time; // TimeSpan (type only; unused) 26 import tango.time.Time; // TimeSpan (type only; unused)
27 import tango.util.log.Log : Log, Logger;
28
29 private Logger logger;
30 static this () {
31 logger = Log.getLogger ("mde.gl.draw");
32 }
27 33
28 //BEGIN Drawing loop 34 //BEGIN Drawing loop
29 // Temporary draw function 35 // Temporary draw function
30 void draw (TimeSpan) { 36 void draw (TimeSpan) {
31 glClear(GL_COLOR_BUFFER_BIT); 37 glClear(GL_COLOR_BUFFER_BIT);
32 38
33 gui.draw (); 39 gui.draw ();
34 40
35 glFlush(); 41 GLenum err = glGetError();
42 if (err != GL_NO_ERROR) {
43 char[128] tmp;
44 logger.error (logger.format (tmp, "GL error: {}", err));
45 }
46
47 glFinish(); // Use Finish rather than Flush to make sure gl is ready to swap buffers
36 SDL_GL_SwapBuffers(); 48 SDL_GL_SwapBuffers();
37 } 49 }
38 //END Drawing loop 50 //END Drawing loop