multisampling aa!
This commit is contained in:
parent
e3cb8532fc
commit
0aaee9de33
@ -26,6 +26,11 @@ OpenGLWidget *OpenGLWidget::instance = nullptr;
|
||||
OpenGLWidget::OpenGLWidget(QWidget *parent)
|
||||
:QOpenGLWidget(parent) {
|
||||
OpenGLWidget::instance = this;
|
||||
QSurfaceFormat format;
|
||||
format.setProfile(QSurfaceFormat::CoreProfile);
|
||||
format.setDepthBufferSize(24);
|
||||
format.setSamples(4);
|
||||
setFormat(format);
|
||||
}
|
||||
|
||||
|
||||
@ -115,10 +120,6 @@ void OpenGLWidget::loadGround() {
|
||||
|
||||
|
||||
void OpenGLWidget::initializeGL() {
|
||||
QSurfaceFormat format;
|
||||
format.setProfile(QSurfaceFormat::CoreProfile);
|
||||
format.setDepthBufferSize(24);
|
||||
setFormat(format);
|
||||
initializeOpenGLFunctions();
|
||||
GLint major, minor;
|
||||
glGetIntegerv(GL_MAJOR_VERSION, &major);
|
||||
@ -162,7 +163,6 @@ void OpenGLWidget::initializeGL() {
|
||||
loadGround();
|
||||
|
||||
glClearColor(1, 1, 1, 0);
|
||||
|
||||
glCullFace(GL_BACK);
|
||||
|
||||
emit initialized();
|
||||
@ -176,8 +176,8 @@ void OpenGLWidget::resizeGL(int w, int h) {
|
||||
|
||||
|
||||
void OpenGLWidget::paintGL() {
|
||||
glEnable(GL_CULL_FACE); // shouldn't have to do that each frame, weird
|
||||
glEnable(GL_DEPTH_TEST); //
|
||||
glEnable(GL_CULL_FACE); // i shouldn't have to do this every frame, should i?
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
QMatrix4x4 trans;
|
||||
trans.translate(0, 0, -cam_dist);
|
||||
|
Loading…
Reference in New Issue
Block a user