Answer the question
In order to leave comments, you need to log in
How to enable OpenGL in Qt Creator?
Created a Qt Widgets application, created a drawing class called MainScene, in this class overridden three methods of the QGLWidget base class: initializeGL(), resizeGL(int w, int h) and paintGL().
This is how the code in mainscene.h looks like:
#ifndef MAINSCENE_H
#define MAINSCENE_H
#include <QGLWidget>
class MainScene : public QGLWidget
{
protected:
void initializeGL();
void resizeGL(int w, int h);
void paintGL();
public:
MainScene(QWidget* parent = 0);
};
#endif // MAINSCENE_H
#include "mainscene.h"
MainScene::MainScene(QWidget *parent)
{
}
void MainScene::initializeGL() {
glClearColor(1.0, 1.0, 1.0, 1.0); // Тут ошибка!
}
void MainScene::resizeGL(int w, int h) {
}
void MainScene::paintGL() {
}
Answer the question
In order to leave comments, you need to log in
rucodes.com/opengl-microsoft-visual-studio-c.html
Check in the project settings if there are already libs for openGl
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question