Created
November 18, 2015 09:58
-
-
Save wakita/5b1588e362343145ece7 to your computer and use it in GitHub Desktop.
qtgl-glfuncs-simplified
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void GLWidget::initializeGL() { | |
QSurfaceFormat fmt = QOpenGLContext::currentContext()->format(); | |
qWarning("OpenGL %d.%d %s", fmt.version().first, fmt.version().second, profile_str[fmt.profile()].c_str()); | |
initializeOpenGLFunctions(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "mainwindow.hxx" | |
#include <QApplication> | |
#include <QSurfaceFormat> | |
#include <QOpenGLContext> | |
#include <iostream> | |
#include <map> | |
extern Ui::MainWindow mainWindow; | |
int main(int argc, char *argv[]) | |
{ | |
QApplication a(argc, argv); | |
QSurfaceFormat fmt; | |
fmt.setMajorVersion(4); fmt.setMinorVersion(5); | |
fmt.setProfile(QSurfaceFormat::CoreProfile); | |
fmt.setSamples(4); | |
fmt.setDepthBufferSize(24); | |
QSurfaceFormat::setDefaultFormat(fmt); | |
MainWindow *w = new MainWindow; | |
w->show(); | |
return a.exec(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment