Commit bae41ac3 authored by Martin Schultz's avatar Martin Schultz

* Added openGL headers generated by glLoadGen

* use glLoadGen headers and initialize function instead of glew
* removed glew from ACG cmakelists
parent 67dc883b
...@@ -447,12 +447,13 @@ int main(int argc, char **argv) ...@@ -447,12 +447,13 @@ int main(int argc, char **argv)
} }
} }
// After setting all Options from command line, build the real gui //TODO: find out why just init functions if not apple...
w->init();
#ifndef __APPLE__ #ifndef __APPLE__
initGlew(); initOpenGLFunctions();
#endif #endif
// After setting all Options from command line, build the real gui
w->init();
for ( int i = 0 ; i < args.FileCount(); ++i ) for ( int i = 0 ; i < args.FileCount(); ++i )
w->commandLineOpen(args.File(i), openPolyMeshes); w->commandLineOpen(args.File(i), openPolyMeshes);
......
...@@ -48,19 +48,23 @@ ...@@ -48,19 +48,23 @@
\*===========================================================================*/ \*===========================================================================*/
#include "glew_wrappers.hh" #include "glew_wrappers.hh"
#include <ACG/GL/gl_compat_4_4.hh>
#include <GL/glew.h>
#include <stdio.h> #include <stdio.h>
#include <string>
DLLEXPORT void initGlew() { DLLEXPORT void initOpenGLFunctions() {
GLenum err = glewInit();
if (GLEW_OK != err) int error = ogl_LoadFunctions();
if(error != ogl_LOAD_SUCCEEDED)
{ {
/* Problem: glewInit failed, something is seriously wrong. */ /* Problem: loading the opengl functions failed, something is seriously wrong. */
fprintf(stderr, "Error: %s\n", glewGetErrorString(err)); fprintf(stderr, "Error when initializing opengl functions: %d\n",error);
} }
} }
DLLEXPORT const char * getGlewVersion() { DLLEXPORT const char * getOpenGLVersion() {
return (const char *)glewGetString(GLEW_VERSION); std::string version;
version = ogl_GetMajorVersion()+"."+ogl_GetMinorVersion();
return version.c_str() ;
} }
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
#include <OpenFlipper/common/GlobalDefines.hh> #include <OpenFlipper/common/GlobalDefines.hh>
DLLEXPORT void initGlew(); DLLEXPORT void initOpenGLFunctions();
DLLEXPORT const char * getGlewVersion(); DLLEXPORT const char * getOpenGLVersion();
#endif /* GLEW_WRAPPERS_HH_ */ #endif /* GLEW_WRAPPERS_HH_ */
...@@ -595,7 +595,8 @@ void CoreWidget::showAboutWidget( ) { ...@@ -595,7 +595,8 @@ void CoreWidget::showAboutWidget( ) {
aboutWidget_->OpenFlipperAbout->append(tr("GLEW Specific Info:")); aboutWidget_->OpenFlipperAbout->append(tr("GLEW Specific Info:"));
aboutWidget_->OpenFlipperAbout->setCurrentFont(standardFont); aboutWidget_->OpenFlipperAbout->setCurrentFont(standardFont);
QString glewVersion = QString(getGlewVersion()); //TODO: rename this we are not using glew anymore
QString glewVersion = QString(getOpenGLVersion());
aboutWidget_->OpenFlipperAbout->append(tr("GLEW Version:\t") + glewVersion); aboutWidget_->OpenFlipperAbout->append(tr("GLEW Version:\t") + glewVersion);
#endif #endif
......
...@@ -110,9 +110,9 @@ void QtGLGraphicsScene::drawBackground(QPainter *_painter, const QRectF &_rect) ...@@ -110,9 +110,9 @@ void QtGLGraphicsScene::drawBackground(QPainter *_painter, const QRectF &_rect)
static bool initialized = false; static bool initialized = false;
if (!initialized) if (!initialized)
{ {
// we use GLEW to manage extensions // we use glLoadGen to manage extensions :/
// initialize it first // initialize it first
glewInit(); ogl_LoadFunctions();
for (unsigned int i = 0; i < views_->size (); i++) for (unsigned int i = 0; i < views_->size (); i++)
{ {
views_->at(i)->initializeGL (); views_->at(i)->initializeGL ();
......
...@@ -114,10 +114,10 @@ void SimpleGLGraphicsScene::drawBackground(QPainter *_painter, const QRectF &_re ...@@ -114,10 +114,10 @@ void SimpleGLGraphicsScene::drawBackground(QPainter *_painter, const QRectF &_re
if (!initialized_) if (!initialized_)
{ {
// we use GLEW to manage extensions // we use glLoadGen to manage extensions
// initialize it first // initialize it first
#ifndef __APPLE__ #ifndef __APPLE__
glewInit(); ogl_LoadFunctions();
#endif #endif
view_->initializeGL(); view_->initializeGL();
cursorPainter_->initializeGL (); cursorPainter_->initializeGL ();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment