Usable OpenGL ES
This commit is contained in:
@@ -4,26 +4,39 @@
|
||||
#include <QTranslator>
|
||||
#include <stdlib.h>
|
||||
|
||||
/*float h2f(unsigned short h)
|
||||
{
|
||||
unsigned int
|
||||
return f;
|
||||
}*/
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#ifdef __linux__
|
||||
setenv("LC_NUMERIC", "C", 1);
|
||||
#endif
|
||||
|
||||
bool useGLES = false;
|
||||
for(int i = 0; i < argc; i++)
|
||||
if(std::strcmp("-gles", argv[i]) == 0)
|
||||
{
|
||||
useGLES = true;
|
||||
}
|
||||
|
||||
QSurfaceFormat format;
|
||||
#ifdef NOU_GLES_CONTEXT
|
||||
format.setMajorVersion(3);
|
||||
format.setMinorVersion(0);
|
||||
format.setRenderableType(QSurfaceFormat::OpenGLES);
|
||||
printf("OpenGL ES\n");
|
||||
qDebug() << "Requesting OpenGL ES";
|
||||
#else
|
||||
format.setMajorVersion(3);
|
||||
format.setMinorVersion(3);
|
||||
//format.setOption(QSurfaceFormat::DebugContext);
|
||||
format.setProfile(QSurfaceFormat::OpenGLContextProfile::CoreProfile);
|
||||
printf("OpenGL\n");
|
||||
#endif
|
||||
if(useGLES)
|
||||
{
|
||||
format.setMajorVersion(3);
|
||||
format.setMinorVersion(0);
|
||||
format.setRenderableType(QSurfaceFormat::OpenGLES);
|
||||
}
|
||||
else
|
||||
{
|
||||
format.setMajorVersion(3);
|
||||
format.setMinorVersion(3);
|
||||
//format.setOption(QSurfaceFormat::DebugContext);
|
||||
format.setProfile(QSurfaceFormat::OpenGLContextProfile::CoreProfile);
|
||||
}
|
||||
QSurfaceFormat::setDefaultFormat(format);
|
||||
|
||||
QApplication a(argc, argv);
|
||||
|
||||
Reference in New Issue
Block a user