Browse Source

* Added (untested) glut3 glutCheckLoop(), ans a regular display function

tags/v0.99.beta14
Jean-Yves Lamoureux jylam 19 years ago
parent
commit
a473607ef3
2 changed files with 22 additions and 0 deletions
  1. +17
    -0
      caca/driver_gl.c
  2. +5
    -0
      configure.ac

+ 17
- 0
caca/driver_gl.c View File

@@ -25,6 +25,10 @@
#include <GL/glut.h>
#include <GL/freeglut_ext.h>

#ifdef USE_GLUTCHECKLOOP
#define glutMainLoopEvent glutCheckLoop
#endif

#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -73,6 +77,7 @@ static void gl_handle_special_key(int, int, int);
static void gl_handle_reshape(int, int);
static void gl_handle_mouse(int, int, int, int);
static void gl_handle_mouse_motion(int, int);
static void _display(void);

struct driver_private
{
@@ -146,6 +151,8 @@ static int gl_init_graphics(caca_t *kk)
glutKeyboardFunc(gl_handle_keyboard);
glutSpecialFunc(gl_handle_special_key);
glutReshapeFunc(gl_handle_reshape);
glutDisplayFunc(_display);


glutMouseFunc(gl_handle_mouse);
glutMotionFunc(gl_handle_mouse_motion);
@@ -223,6 +230,7 @@ static unsigned int gl_get_window_height(caca_t *kk)
return kk->drv.p->height;
}


static void gl_display(caca_t *kk)
{
unsigned int x, y, line;
@@ -452,6 +460,15 @@ static void gl_handle_mouse_motion(int x, int y)
kk->drv.p->mouse_changed = 1;
}



static void _display(void)
{
caca_t *kk = gl_kk;
gl_display(kk);
}


/*
* Driver initialisation
*/


+ 5
- 0
configure.ac View File

@@ -152,6 +152,11 @@ if test "${enable_gl}" != "no"; then
[ac_cv_my_have_gl="yes"
AC_DEFINE(USE_GL, 1, Define to 1 to activate the OpenGL backend driver)
CACA_LIBS="${CACA_LIBS} -lGL -lglut"
CACA_DRIVERS="${CACA_DRIVERS} gl"])]
[AC_CHECK_LIB(glut, glutCheckLoop,
[ac_cv_my_have_gl="yes"
AC_DEFINE(USE_GLUTCHECKLOOP, 1, Define to 1 to activate the glut3 glutCheckLoop call)
CACA_LIBS="${CACA_LIBS} -lGL -lglut"
CACA_DRIVERS="${CACA_DRIVERS} gl"])])])
if test "${ac_cv_my_have_gl}" = "no" -a "${enable_gl}" = "yes"; then
AC_MSG_ERROR([cannot find OpenGL+FreeGLUT development files])


Loading…
Cancel
Save