043 - OpenGL on Windows For the First Time using QOpenGLWidget Qt Toolkit

Published: 04 September 2020
on channel: IQ95 The Homo Siliconiens
1,917
32

MyGLWidget::MyGLWidget(QWidget *parent) : QOpenGLWidget(parent)
{
QSurfaceFormat format;
format.setDepthBufferSize(24);
format.setStencilBufferSize(8);
format.setVersion(3, 2);
format.setProfile(QSurfaceFormat::CoreProfile);
QSurfaceFormat::setDefaultFormat(format);
}

void MyGLWidget::initializeGL()
{
// this is compulsory
initializeOpenGLFunctions();
}

void MyGLWidget::paintGL()
{
glClearColor(1.0f, 1.0f, 0.0f, 0.0f);
glClear(GL_COLOR_BUFFER_BIT);

glBegin(GL_QUADS);

glColor3f(1.0f, 0.0f, 1.0f);

glVertex2f(-0.5f, -0.5f);
glVertex2f(0.5f, -0.5f);
glVertex2f(0.5f, 0.5f);
glVertex2f(-0.5f, 0.5f);

glEnd();
glFlush();
}

QOpenGLWidget Class
https://doc.qt.io/qt-5/qopenglwidget....

Computer Graphics Programming in OpenGL with C++
https://www.amazon.com/Computer-Graph...

OpenGL Programming Guide: The Official Guide to Learning OpenGL, Version 4.5 with SPIR-V (9th Edition)
https://www.amazon.com/OpenGL-Program...

Prerequisites:

041 - Plot Graph 6 - How to Use JavaScript In C++ Programming (Demo)
   • 041 - Plot Graph 6 - How to Use JavaS...  

042 - Plot Graph 7 - Polar Coordinates, Mathematics, Physics, and Computer Science
   • 042 - Plot Graph 7 - Polar Coordinate...  

Download Source Code:

Episode 043
http://sourcecode.talkplayfun.com/ele...


Watch video 043 - OpenGL on Windows For the First Time using QOpenGLWidget Qt Toolkit online without registration, duration hours minute second in high quality. This video was added by user IQ95 The Homo Siliconiens 04 September 2020, don't forget to share it with your friends and acquaintances, it has been viewed on our site 1,917 once and liked it 32 people.