Remove usage of QOpenGLFunctions and use GLEW instead.

Qt's OpenGL interface was causing problems on Windows since it doesn't mix
well with ANGLE.

Relates to issue #50.
This commit is contained in:
Matt Williams
2014-03-23 12:16:02 +00:00
parent ac16dfd325
commit 464d713c2a
3 changed files with 43 additions and 49 deletions

View File

@ -32,13 +32,17 @@ SET(INC_FILES
OpenGLWidget.h
)
add_definitions(-DGLEW_STATIC)
#"Sources" and "Headers" are the group names in Visual Studio.
#They may have other uses too...
SOURCE_GROUP("Sources" FILES ${SRC_FILES})
SOURCE_GROUP("Headers" FILES ${INC_FILES})
FIND_PACKAGE(OpenGL REQUIRED)
#Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location)
INCLUDE_DIRECTORIES(${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include)
INCLUDE_DIRECTORIES(${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${GLEW_SOURCE_DIR})
LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR})
#Build
@ -46,7 +50,7 @@ ADD_EXECUTABLE(BasicExample ${SRC_FILES})
IF(MSVC)
SET_TARGET_PROPERTIES(BasicExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127")
ENDIF(MSVC)
TARGET_LINK_LIBRARIES(BasicExample Qt5::OpenGL PolyVoxCore)
TARGET_LINK_LIBRARIES(BasicExample glew Qt5::OpenGL ${OPENGL_gl_LIBRARY} PolyVoxCore)
SET_PROPERTY(TARGET BasicExample PROPERTY FOLDER "Examples")
#Install - Only install the example in Windows