Skip to content

Commit c8718d0

Browse files
committed
fix qt-example
1 parent f0f660f commit c8718d0

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

source/examples/qt-example/WindowQt.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,6 @@ WindowQt::WindowQt(const QSurfaceFormat & format)
5050
qDebug() << "Could not create OpenGL context.";
5151
QApplication::quit();
5252
}
53-
else
54-
{
55-
qDebug().nospace() << "Created OpenGL context "
56-
<< m_context->format().version().first << "." << m_context->format().version().second;
57-
}
5853
}
5954

6055
WindowQt::~WindowQt()

source/examples/qt-example/main.cpp

+13-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <glm/gtx/transform.hpp>
2323

2424
#include <glbinding/gl/gl.h>
25+
#include <glbinding/ContextInfo.h>
2526

2627
#include <globjects/globjects.h>
2728
#include <globjects/Uniform.h>
@@ -73,17 +74,27 @@ class Window : public WindowQt, AbstractCoordinateProvider
7374
virtual void initializeGL() override
7475
{
7576
init();
76-
7777
DebugMessage::enable();
7878

79+
std::cout << std::endl
80+
<< "OpenGL Version: " << glbinding::ContextInfo::version() << std::endl
81+
<< "OpenGL Vendor: " << glbinding::ContextInfo::vendor() << std::endl
82+
<< "OpenGL Renderer: " << glbinding::ContextInfo::renderer() << std::endl << std::endl;
83+
84+
#ifdef MAC_OS
85+
Shader::clearGlobalReplacements();
86+
Shader::globalReplace("#version 140", "#version 150");
87+
88+
debug() << "Using global OS X shader replacement '#version 140' -> '#version 150'" << std::endl;
89+
#endif
90+
7991
glClearColor(1.f, 1.f, 1.f, 0.f);
8092

8193
m_sphere = new Program();
8294
m_sphere->attach(
8395
Shader::fromFile(GL_VERTEX_SHADER, "data/gbuffers/sphere.vert")
8496
, Shader::fromFile(GL_FRAGMENT_SHADER, "data/gbuffers/sphere.frag"));
8597

86-
8798
m_icosahedron = new Icosahedron(2);
8899

89100
m_camera.setZNear(1.f);

0 commit comments

Comments
 (0)