diff options
Diffstat (limited to 'src/glut/directfb')
-rw-r--r-- | src/glut/directfb/Makefile | 4 | ||||
-rw-r--r-- | src/glut/directfb/callback.c | 2 | ||||
-rw-r--r-- | src/glut/directfb/internal.h | 3 | ||||
-rw-r--r-- | src/glut/directfb/window.c | 22 |
4 files changed, 25 insertions, 6 deletions
diff --git a/src/glut/directfb/Makefile b/src/glut/directfb/Makefile index e881b8aacdd..bf93d63e305 100644 --- a/src/glut/directfb/Makefile +++ b/src/glut/directfb/Makefile @@ -61,7 +61,7 @@ default: depend $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME) # Make the library $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS) - $(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' \ + $(MKLIB) -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ -major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \ $(GLUT_LIB_DEPS) -install $(TOP)/$(LIB_DIR) \ $(MKLIB_OPTIONS) $(OBJECTS) @@ -81,7 +81,7 @@ tags: # Remove .o and backup files clean: depend - -rm -f depend + -rm -f depend depend.bak -rm -f *.o *~ *.o *~ *.so libglut.so.3.7 include depend diff --git a/src/glut/directfb/callback.c b/src/glut/directfb/callback.c index 4f23441167a..7c9768aac0a 100644 --- a/src/glut/directfb/callback.c +++ b/src/glut/directfb/callback.c @@ -278,7 +278,7 @@ __glutGetTimeout( int *ret_msec ) gettimeofday( &now, NULL ); *ret_msec = (time->tv_sec - now.tv_sec) * 1000 + - (time->tv_usec - now.tv_usec + 500) / 1000; + (time->tv_usec - now.tv_usec + 999) / 1000; return GL_TRUE; } diff --git a/src/glut/directfb/internal.h b/src/glut/directfb/internal.h index 47311c9342b..55c4b5ce280 100644 --- a/src/glut/directfb/internal.h +++ b/src/glut/directfb/internal.h @@ -62,6 +62,9 @@ typedef struct __GlutWindow_s { IDirectFBSurface *surface; IDirectFBGL *gl; + /* display mode */ + GLenum mode; + /* cursor position in fullscreen mode */ int cx; int cy; diff --git a/src/glut/directfb/window.c b/src/glut/directfb/window.c index c8174d795e7..62cf8bb33e0 100644 --- a/src/glut/directfb/window.c +++ b/src/glut/directfb/window.c @@ -66,6 +66,9 @@ __glutCreateWindow( GLboolean fullscreen ) case 8: config.pixelformat = DSPF_RGB332; break; + case 12: + config.pixelformat = DSPF_ARGB4444; + break; case 15: config.pixelformat = DSPF_ARGB1555; break; @@ -109,7 +112,7 @@ __glutCreateWindow( GLboolean fullscreen ) if (joystick) joystick->AttachEventBuffer( joystick, events ); - new->visible = GL_TRUE; + new->visible = GL_TRUE; } else { DFBWindowDescription dsc; @@ -160,11 +163,12 @@ __glutCreateWindow( GLboolean fullscreen ) DWET_BUTTONDOWN | DWET_BUTTONUP | DWET_ENTER | DWET_LEAVE | DWET_MOTION | DWET_SIZE ); - new->req.flags |= WINDOW_REQUEST_SHOW; } + new->mode = g_display_mode; + new->reshape = GL_TRUE; new->visibility = GL_TRUE; new->redisplay = GL_TRUE; @@ -220,7 +224,8 @@ __glutHandleWindows( void ) __GlutWindow *cur = g_stack; while (cur) { - __GlutWindow *next = cur->next; + __GlutWindow *next = cur->next; + GLboolean displayed = GL_FALSE; if (cur->window && cur->req.flags) { if (cur == g_current) @@ -291,18 +296,29 @@ __glutHandleWindows( void ) cur->surface->GetSize( cur->surface, &w, &h ); __glutSetWindow( cur ); reshape_func( w, h ); + displayed = GL_TRUE; } if (cur->visibility && visibility_func) { g_idle = GL_FALSE; __glutSetWindow( cur ); visibility_func( cur->visible ? GLUT_VISIBLE : GLUT_NOT_VISIBLE ); + displayed = GL_TRUE; } if (cur->redisplay && display_func) { g_idle = GL_FALSE; __glutSetWindow( cur ); display_func(); + displayed = GL_TRUE; + } + + if (displayed && cur->window && cur->visible) { + if (!(cur->mode & GLUT_DOUBLE)) { + cur->gl->Unlock( cur->gl ); + cur->surface->Flip( cur->surface, NULL, 0 ); + cur->gl->Lock( cur->gl ); + } } cur->reshape = GL_FALSE; |