main.cpp Example File
activeqt/opengl/main.cpp
#include "globjwin.h"
#include "glbox.h"
#include <QApplication>
#include <QtOpenGL>
#include <QAxFactory>
QAXFACTORY_BEGIN(
"{2c3c183a-eeda-41a4-896e-3d9c12c3577d}",
"{83e16271-6480-45d5-aaf1-3f40b7661ae4}")
QAXCLASS(GLBox)
QAXFACTORY_END()
int main(int argc, char *argv[])
{
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication::setColorSpec(QApplication::CustomColor);
QApplication a(argc,argv);
if (QOpenGLContext::openGLModuleType() != QOpenGLContext::LibGL) {
qWarning("This system does not support OpenGL. Exiting.");
return -1;
}
if (!QAxFactory::isServer()) {
GLObjectWindow w;
w.resize(400, 350);
w.show();
return a.exec();
}
return a.exec();
}