From 4918f83cdfcc7b0f8ab4219da764068b062303e5 Mon Sep 17 00:00:00 2001 From: Laurent Carlier Date: Sun, 27 Dec 2009 23:13:08 +0000 Subject: [PATCH] [GB.QT4.OPENGL] * NEW: Remove dependency with glew library, as the component use now the GL_INTERFACE api. git-svn-id: svn://localhost/gambas/trunk@2524 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- gb.qt4/gb.gl.h | 1 + gb.qt4/src/opengl/CGLarea.cpp | 16 ++++------------ gb.qt4/src/opengl/CGLarea.h | 3 --- gb.qt4/src/opengl/gb.qt4.opengl.component | 2 +- gb.qt4/src/opengl/main.cpp | 4 ++-- gb.qt4/src/opengl/main.h | 2 ++ 6 files changed, 10 insertions(+), 18 deletions(-) create mode 120000 gb.qt4/gb.gl.h diff --git a/gb.qt4/gb.gl.h b/gb.qt4/gb.gl.h new file mode 120000 index 000000000..ff28a7265 --- /dev/null +++ b/gb.qt4/gb.gl.h @@ -0,0 +1 @@ +../gb.opengl/src/gb.gl.h \ No newline at end of file diff --git a/gb.qt4/src/opengl/CGLarea.cpp b/gb.qt4/src/opengl/CGLarea.cpp index 36d8450d8..3b54c60bf 100644 --- a/gb.qt4/src/opengl/CGLarea.cpp +++ b/gb.qt4/src/opengl/CGLarea.cpp @@ -22,14 +22,11 @@ #define __CGLAREA_CPP -#include "main.h" -#include "gambas.h" #include "CGLarea.h" -#include //#include "gl.h" -#include +//#include static int glWidgetCount = 0; @@ -70,14 +67,7 @@ BEGIN_METHOD(CGLAREA_new, GB_OBJECT parent) QT.InitWidget(area, _object); area->show(); - - GLenum err = glewInit(); - if (GLEW_OK != err) - { - /* Problem: glewInit failed, something is seriously wrong. */ - qDebug("Error: Failed to init GLEW \n%s\n", glewGetErrorString(err)); - return; - } + GL.Init(); END_METHOD @@ -106,6 +96,8 @@ END_METHOD BEGIN_METHOD_VOID(CGLAREA_select) WIDGET->makeCurrent(); + // really needed ? + GL.Init(); END_METHOD diff --git a/gb.qt4/src/opengl/CGLarea.h b/gb.qt4/src/opengl/CGLarea.h index 2847e756c..1a7239702 100644 --- a/gb.qt4/src/opengl/CGLarea.h +++ b/gb.qt4/src/opengl/CGLarea.h @@ -23,11 +23,8 @@ #ifndef __CGLAREA_H #define __CGLAREA_H -#include "gambas.h" #include "main.h" -#include "../gb.qt.h" -#include #include typedef diff --git a/gb.qt4/src/opengl/gb.qt4.opengl.component b/gb.qt4/src/opengl/gb.qt4.opengl.component index 1036d517c..316f127c8 100644 --- a/gb.qt4/src/opengl/gb.qt4.opengl.component +++ b/gb.qt4/src/opengl/gb.qt4.opengl.component @@ -1,7 +1,7 @@ [Component] Key=gb.qt4.opengl Author=Laurent Carlier -Require=gb.qt4 +Require=gb.qt4,gb.opengl Type=Form Implement=OpenGLViewer State=2 diff --git a/gb.qt4/src/opengl/main.cpp b/gb.qt4/src/opengl/main.cpp index 8cb313b5d..05cdc5795 100644 --- a/gb.qt4/src/opengl/main.cpp +++ b/gb.qt4/src/opengl/main.cpp @@ -22,9 +22,7 @@ #define __MAIN_CPP -#include "gambas.h" #include "main.h" -#include "../gb.qt.h" #include "CGLarea.h" @@ -32,6 +30,7 @@ extern "C" { GB_INTERFACE GB EXPORT; QT_INTERFACE QT; +GL_INTERFACE GL; GB_DESC *GB_CLASSES[] EXPORT = { @@ -42,6 +41,7 @@ GB_DESC *GB_CLASSES[] EXPORT = int EXPORT GB_INIT(void) { GB.GetInterface("gb.qt4", QT_INTERFACE_VERSION, &QT); + GB.GetInterface("gb.opengl", GL_INTERFACE_VERSION, &GL); return FALSE; } diff --git a/gb.qt4/src/opengl/main.h b/gb.qt4/src/opengl/main.h index b89e260b9..cfa493238 100644 --- a/gb.qt4/src/opengl/main.h +++ b/gb.qt4/src/opengl/main.h @@ -25,10 +25,12 @@ #include "gambas.h" #include "../gb.qt.h" +#include "gb.gl.h" #ifndef __MAIN_CPP extern GB_INTERFACE GB; extern QT_INTERFACE QT; +extern GL_INTERFACE GL; #endif #endif