diff --git a/3d-viewer/3d_model_viewer/eda_3d_model_viewer.cpp b/3d-viewer/3d_model_viewer/eda_3d_model_viewer.cpp index f52241042f..d0f8c6a36f 100644 --- a/3d-viewer/3d_model_viewer/eda_3d_model_viewer.cpp +++ b/3d-viewer/3d_model_viewer/eda_3d_model_viewer.cpp @@ -27,6 +27,7 @@ * 3d models that come in the original data from the files without any transformations. */ +#include // Must be included first #include #include "3d_rendering/opengl/3d_model.h" #include "eda_3d_model_viewer.h" @@ -38,6 +39,7 @@ #include #include #include +#include /** * Scale conversion from 3d model units to pcb units @@ -182,6 +184,20 @@ void EDA_3D_MODEL_VIEWER::Clear3DModel() void EDA_3D_MODEL_VIEWER::ogl_initialize() { + const GLenum err = glewInit(); + + if( GLEW_OK != err ) + { + const wxString msgError = (const char*) glewGetErrorString( err ); + + wxLogMessage( msgError ); + } + else + { + wxLogTrace( m_logTrace, wxT( "EDA_3D_MODEL_VIEWER::ogl_initialize Using GLEW version %s" ), + FROM_UTF8( (char*) glewGetString( GLEW_VERSION ) ) ); + } + glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST ); glHint( GL_LINE_SMOOTH_HINT, GL_NICEST ); glHint( GL_POLYGON_SMOOTH_HINT, GL_NICEST );