From aaeaf5e5bcbdb4d06873a22d7b8b2db146fb2dcb Mon Sep 17 00:00:00 2001 From: Laurent Carlier Date: Thu, 24 Dec 2009 09:23:24 +0000 Subject: [PATCH] [GB.SDL] * NEW: Add dependency to libglew, needed for gb.opengl component. libglew : http://glew.sourceforge.net/ git-svn-id: svn://localhost/gambas/trunk@2507 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- gb.sdl/configure.ac | 4 ++-- gb.sdl/src/SDL_h.h | 2 +- gb.sdl/src/SDLwindow.cpp | 8 ++++++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gb.sdl/configure.ac b/gb.sdl/configure.ac index c33c43661..b261547fc 100644 --- a/gb.sdl/configure.ac +++ b/gb.sdl/configure.ac @@ -33,8 +33,8 @@ GB_COMPONENT( [SDL], [src], [GB_FIND(SDL_opengl.h SDL.h SDL_image.h SDL_ttf.h, `sdl-config --prefix`, include/SDL)], - [GB_FIND(libSDL_image.$SHLIBEXT libSDL_ttf.$SHLIBEXT , /usr /usr/X11R6 /usr/local `sdl-config --prefix`, lib)], - [$X_LIBS -lSDL_image -lSDL_ttf -lGLU], + [GB_FIND(libSDL_image.$SHLIBEXT libSDL_ttf.$SHLIBEXT libGLEW.$SHLIBEXT, /usr /usr/X11R6 /usr/local `sdl-config --prefix`, lib)], + [$X_LIBS -lSDL_image -lSDL_ttf -lGLU -lGLEW], [$SDL_CFLAGS]) AC_OUTPUT( \ diff --git a/gb.sdl/src/SDL_h.h b/gb.sdl/src/SDL_h.h index 055c6b93f..28b7bd371 100644 --- a/gb.sdl/src/SDL_h.h +++ b/gb.sdl/src/SDL_h.h @@ -23,9 +23,9 @@ #ifndef __SDL_H_H #define __SDL_H_H +#include #include "SDL.h" #include "SDL_syswm.h" -#include "SDL_opengl.h" #include #include "SDLapp.h" diff --git a/gb.sdl/src/SDLwindow.cpp b/gb.sdl/src/SDLwindow.cpp index eb5e0c54a..42e732fca 100644 --- a/gb.sdl/src/SDLwindow.cpp +++ b/gb.sdl/src/SDLwindow.cpp @@ -64,6 +64,14 @@ void SDLwindow::Show() return; } + GLenum err = glewInit(); + if (GLEW_OK != err) + { + /* Problem: glewInit failed, something is seriously wrong. */ + fprintf(stderr, "Error: Failed to init GLEW \n%s\n", glewGetErrorString(err)); + return; + } + hCtx = glXGetCurrentContext(); hDrw = glXGetCurrentDrawable(); hDpy = glXGetCurrentDisplay();