OpenGL examples fix for Linux.

This commit is contained in:
David Williams 2010-12-27 10:34:51 +00:00
parent 4bdba629fb
commit fd2070bd90
3 changed files with 5 additions and 8 deletions

View File

@ -36,15 +36,13 @@ void OpenGLWidget::setSurfaceMeshToRender(const PolyVox::SurfaceMesh<PositionMat
void OpenGLWidget::initializeGL()
{
#ifdef WIN32
//If we are on Windows we will need GLEW to access recent OpenGL functionality
//We need GLEW to access recent OpenGL functionality
GLenum err = glewInit();
if (GLEW_OK != err)
{
/* Problem: glewInit failed, something is seriously wrong. */
std::cout << "Error: " << glewGetErrorString(err) << std::endl;
std::cout << "GLEW Error: " << glewGetErrorString(err) << std::endl;
}
#endif
//Set up the clear colour
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);

View File

@ -162,15 +162,13 @@ void OpenGLWidget::initializeGL()
m_bUseOpenGLVertexBufferObjects = true;
if(m_bUseOpenGLVertexBufferObjects)
{
#ifdef WIN32
//If we are on Windows we will need GLEW to access recent OpenGL functionality
//We need GLEW to access recent OpenGL functionality
GLenum err = glewInit();
if (GLEW_OK != err)
{
/* Problem: glewInit failed, something is seriously wrong. */
cout << "Error: " << glewGetErrorString(err) << endl;
cout << "GLEW Error: " << glewGetErrorString(err) << endl;
}
#endif
}
glShadeModel(GL_SMOOTH); // Enable Smooth Shading

View File

@ -2,6 +2,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(PolyVox)
add_subdirectory(bindings)
add_subdirectory(PolyVoxCore)
add_subdirectory(PolyVoxUtil)