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)
}
}
// After setting all Options from command line, build the real gui
w->init();
//TODO: find out why just init functions if not apple...
#ifndef __APPLE__
initGlew();
initOpenGLFunctions();
#endif
// After setting all Options from command line, build the real gui
w->init();
for ( int i = 0 ; i < args.FileCount(); ++i )
w->commandLineOpen(args.File(i), openPolyMeshes);
......
......@@ -48,19 +48,23 @@
\*===========================================================================*/
#include "glew_wrappers.hh"
#include <ACG/GL/gl_compat_4_4.hh>
#include <GL/glew.h>
#include <stdio.h>
#include <string>
DLLEXPORT void initGlew() {
GLenum err = glewInit();
if (GLEW_OK != err)
DLLEXPORT void initOpenGLFunctions() {
int error = ogl_LoadFunctions();
if(error != ogl_LOAD_SUCCEEDED)
{
/* Problem: glewInit failed, something is seriously wrong. */
fprintf(stderr, "Error: %s\n", glewGetErrorString(err));
/* Problem: loading the opengl functions failed, something is seriously wrong. */
fprintf(stderr, "Error when initializing opengl functions: %d\n",error);
}
}
DLLEXPORT const char * getGlewVersion() {
return (const char *)glewGetString(GLEW_VERSION);
DLLEXPORT const char * getOpenGLVersion() {
std::string version;
version = ogl_GetMajorVersion()+"."+ogl_GetMinorVersion();
return version.c_str() ;
}
......@@ -52,7 +52,7 @@
#include <OpenFlipper/common/GlobalDefines.hh>
DLLEXPORT void initGlew();
DLLEXPORT const char * getGlewVersion();
DLLEXPORT void initOpenGLFunctions();
DLLEXPORT const char * getOpenGLVersion();
#endif /* GLEW_WRAPPERS_HH_ */
......@@ -595,7 +595,8 @@ void CoreWidget::showAboutWidget( ) {
aboutWidget_->OpenFlipperAbout->append(tr("GLEW Specific Info:"));
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);
#endif
......
......@@ -110,9 +110,9 @@ void QtGLGraphicsScene::drawBackground(QPainter *_painter, const QRectF &_rect)
static bool initialized = false;
if (!initialized)
{
// we use GLEW to manage extensions
// we use glLoadGen to manage extensions :/
// initialize it first
glewInit();
ogl_LoadFunctions();
for (unsigned int i = 0; i < views_->size (); i++)
{
views_->at(i)->initializeGL ();
......
......@@ -114,10 +114,10 @@ void SimpleGLGraphicsScene::drawBackground(QPainter *_painter, const QRectF &_re
if (!initialized_)
{
// we use GLEW to manage extensions
// we use glLoadGen to manage extensions
// initialize it first
#ifndef __APPLE__
glewInit();
ogl_LoadFunctions();
#endif
view_->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