[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
This commit is contained in:
parent
8cfd420ed4
commit
4918f83cdf
1
gb.qt4/gb.gl.h
Symbolic link
1
gb.qt4/gb.gl.h
Symbolic link
@ -0,0 +1 @@
|
||||
../gb.opengl/src/gb.gl.h
|
@ -22,14 +22,11 @@
|
||||
|
||||
#define __CGLAREA_CPP
|
||||
|
||||
#include "main.h"
|
||||
#include "gambas.h"
|
||||
#include "CGLarea.h"
|
||||
|
||||
#include <qgl.h>
|
||||
//#include "gl.h"
|
||||
|
||||
#include <iostream>
|
||||
//#include <iostream>
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
@ -23,11 +23,8 @@
|
||||
#ifndef __CGLAREA_H
|
||||
#define __CGLAREA_H
|
||||
|
||||
#include "gambas.h"
|
||||
#include "main.h"
|
||||
#include "../gb.qt.h"
|
||||
|
||||
#include <GL/glew.h>
|
||||
#include <qgl.h>
|
||||
|
||||
typedef
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user