Commit b9a31bfb authored by Martin Schultz's avatar Martin Schultz
Browse files

* Added openGL headers generated by glLoadGen

* use glLoadGen headers and initialize function instead of glew
* removed glew from ACG cmakelists
parent b605a147
Pipeline #267 passed with stage
......@@ -27,17 +27,12 @@ endif ()
acg_openmp ()
# check for OpenGL, GLEW and GLUT as our required dependencies
# check for OpenGL and GLUT as our required dependencies
find_package (OpenGL)
if (NOT OPENGL_FOUND)
message (FATAL_ERROR "OpengGL not found!")
endif ()
find_package (GLEW)
if (NOT GLEW_FOUND)
message (FATAL_ERROR "GLEW not found!")
endif ()
find_package (GLUT)
if (NOT GLUT_FOUND)
message (FATAL_ERROR "GLUT not found!")
......@@ -53,7 +48,6 @@ set(INCLUDE_DIRS ${OPENMESH_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}/ShaderUtils
${CMAKE_CURRENT_BINARY_DIR}
${OPENGL_INCLUDE_DIR}
${GLEW_INCLUDE_DIR}
${GLUT_INCLUDE_DIR} )
set(ADDITIONAL_LINK_LIBRARIES "" )
......@@ -90,7 +84,6 @@ include_directories (
)
link_directories (
${GLEW_LIBRARY_DIR}
${GLUT_LIBRARY_DIR}
)
......@@ -159,7 +152,6 @@ acg_print_configure_header (ACG "ACG")
target_link_libraries ( ACG ${OPENMESH_LIBRARIES}
${QT_LIBRARIES}
${OPENGL_LIBRARIES}
${GLEW_LIBRARY}
${GLUT_LIBRARIES}
${ADDITIONAL_LINK_LIBRARIES} )
......
......@@ -73,7 +73,7 @@
#else // Unix
#include <GL/glew.h>
#include "gl_compat_4_4.hh"
#endif
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -1128,7 +1128,8 @@ void QtBaseViewer::initializeGL()
// we use GLEW to manage extensions
// initialize it first
#ifndef __APPLE__
glewInit();
//glewInit();
ogl_LoadFunctions();
#endif
......@@ -1242,7 +1243,8 @@ void QtBaseViewer::paintGL()
// we use GLEW to manage extensions
// initialize it first
#ifndef __APPLE__
glewInit();
//glewInit();
ogl_LoadFunctions();
#endif
// lock update
......
......@@ -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 ();
......
......@@ -54,6 +54,10 @@
#include <OpenFlipper/common/GlobalOptions.hh>
#include <OpenFlipper/BasePlugin/PluginFunctions.hh>
#ifndef GL_TEXTURE_RECTANGLE_EXT
#define GL_TEXTURE_RECTANGLE_EXT 0x84F5
#endif
void DepthPeelingPlugin::reloadResources(int _viewerId) {
// called in constructor and resizeEvent()
......
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