Solving the coimpiling issue with Render-utils test

This commit is contained in:
Sam Gateau 2015-07-29 11:49:22 -07:00
parent 76acbde595
commit 17650dde74

View file

@ -19,6 +19,10 @@
#include <QFile> #include <QFile>
#include <QImage> #include <QImage>
#include <QLoggingCategory> #include <QLoggingCategory>
#include <gpu/Context.h>
#include <gpu/GLBackend.h>
#include <QOpenGLBuffer> #include <QOpenGLBuffer>
#include <QOpenGLContext> #include <QOpenGLContext>
#include <QOpenGLDebugLogger> #include <QOpenGLDebugLogger>
@ -29,7 +33,7 @@
#include <QTime> #include <QTime>
#include <QTimer> #include <QTimer>
#include <QWindow> #include <QWindow>
#include <gpu/Context.h>
#include <PathUtils.h> #include <PathUtils.h>
@ -90,6 +94,7 @@ class QTestWindow : public QWindow {
QSize _size; QSize _size;
//TextRenderer* _textRenderer[4]; //TextRenderer* _textRenderer[4];
RateCounter fps; RateCounter fps;
gpu::ContextPointer _gpuContext;
protected: protected:
void renderText(); void renderText();
@ -119,6 +124,9 @@ public:
show(); show();
makeCurrent(); makeCurrent();
_gpuContext.reset(new gpu::Context(new gpu::GLBackend()));
{ {
QOpenGLDebugLogger* logger = new QOpenGLDebugLogger(this); QOpenGLDebugLogger* logger = new QOpenGLDebugLogger(this);
@ -131,23 +139,6 @@ public:
} }
qDebug() << (const char*)glGetString(GL_VERSION); qDebug() << (const char*)glGetString(GL_VERSION);
#ifdef WIN32
glewExperimental = true;
GLenum err = glewInit();
if (GLEW_OK != err) {
/* Problem: glewInit failed, something is seriously wrong. */
const GLubyte * errStr = glewGetErrorString(err);
qDebug("Error: %s\n", errStr);
}
qDebug("Status: Using GLEW %s\n", glewGetString(GLEW_VERSION));
if (wglewGetExtension("WGL_EXT_swap_control")) {
int swapInterval = wglGetSwapIntervalEXT();
qDebug("V-Sync is %s\n", (swapInterval > 0 ? "ON" : "OFF"));
}
glGetError();
#endif
//_textRenderer[0] = TextRenderer::getInstance(SANS_FONT_FAMILY, 12, false); //_textRenderer[0] = TextRenderer::getInstance(SANS_FONT_FAMILY, 12, false);
//_textRenderer[1] = TextRenderer::getInstance(SERIF_FONT_FAMILY, 12, false, //_textRenderer[1] = TextRenderer::getInstance(SERIF_FONT_FAMILY, 12, false,
// TextRenderer::SHADOW_EFFECT); // TextRenderer::SHADOW_EFFECT);