Explorar el Código

Don't enter glutCheckLoop() from gl_get_event() if there is already an

event available. This increases the framerate when using OpenGL.
tags/v0.99.beta17
Sam Hocevar sam hace 15 años
padre
commit
4bbf44af21
Se han modificado 1 ficheros con 11 adiciones y 0 borrados
  1. +11
    -0
      caca/driver/gl.c

+ 11
- 0
caca/driver/gl.c Ver fichero

@@ -48,6 +48,7 @@ static caca_display_t *gl_d; /* FIXME: we ought to get rid of this */
/*
* Local functions
*/
static int gl_get_event_inner(caca_display_t *, caca_privevent_t *);
static void gl_handle_keyboard(unsigned char, int, int);
static void gl_handle_special_key(int, int, int);
static void gl_handle_reshape(int, int);
@@ -333,12 +334,22 @@ static void gl_handle_resize(caca_display_t *dp)

static int gl_get_event(caca_display_t *dp, caca_privevent_t *ev)
{
int ret = gl_get_event_inner(dp, ev);

if (ret)
return ret;

#ifdef HAVE_GLUTCHECKLOOP
glutCheckLoop();
#else
glutMainLoopEvent();
#endif

return gl_get_event_inner(dp, ev);
}

static int gl_get_event_inner(caca_display_t *dp, caca_privevent_t *ev)
{
#ifdef HAVE_GLUTCLOSEFUNC
if(dp->drv.p->close)
{


Cargando…
Cancelar
Guardar