20 lines
784 B
C++
20 lines
784 B
C++
|
#include "loglwindow.h"
|
||
|
|
||
|
LoGLWindow::LoGLWindow(QScreen *screen)
|
||
|
: QWindow(screen)
|
||
|
{
|
||
|
setSurfaceType(OpenGLSurface);
|
||
|
create();
|
||
|
// Create an OpenGL context
|
||
|
m_context = new QOpenGLContext;
|
||
|
m_context->create();
|
||
|
// Setup scene and render it
|
||
|
m_context->makeCurrent(this);
|
||
|
initializeOpenGLFunctions();
|
||
|
}
|
||
|
|
||
|
QString LoGLWindow::vendor() { return QString(reinterpret_cast<const char *>(glGetString(GL_VENDOR))); }
|
||
|
QString LoGLWindow::renderer() { return QString(reinterpret_cast<const char *>(glGetString(GL_RENDERER))); }
|
||
|
QString LoGLWindow::version() { return QString(reinterpret_cast<const char *>(glGetString(GL_VERSION))); }
|
||
|
QString LoGLWindow::extensions() { return QString(reinterpret_cast<const char *>(glGetString(GL_EXTENSIONS))); }
|