Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. UWP and openGL version problem
Forum Updated to NodeBB v4.3 + New Features

UWP and openGL version problem

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 719 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Francky033
    wrote on last edited by Francky033
    #1

    I'm trying to port my Qt 5.12 Desktop Opengl application to a UWP application compatible with Windows Store.

    At startup, I get errors concerning the compilation of shaders. I didn't write these shaders. These are certainly the shaders of the qml box that opens when my application starts.

    The compilation tells me that there is a problem with the OPEN ES version. The program seems to start in ES 2 and the opengl version should be at least 3.

    QOpenGLShader::compile(Vertex): ERROR: 0:1: 'core' : unexpected token
    ERROR: 0:4: 'in' : storage qualifier supported in GLSL ES 3.00 and above only
    ERROR: 0:5: 'in' : storage qualifier supported in GLSL ES 3.00 and above only
    ERROR: 0:7: 'out' : storage qualifier supported in GLSL ES 3.00 and above only
    ERROR: 0:9: 'in' : storage qualifier supported in GLSL ES 3.00 and above only
    
    *** Problematic Vertex shader source code ***
    #version 150 core
    #line 1
    
    uniform mat4 qt_Matrix;
    
    in vec4 qt_VertexPosition;
    in vec2 qt_VertexTexCoord;
    
    out vec2 qt_TexCoord;
    
    in float _qt_order;
    uniform float _qt_zRange;
    void main()
    {
        qt_TexCoord = qt_VertexTexCoord;
        gl_Position = qt_Matrix * qt_VertexPosition;
        gl_Position.z = (gl_Position.z * _qt_zRange + _qt_order) * gl_Position.w;
    }
    ***
    QOpenGLShader::compile(Fragment): ERROR: 0:1: 'core' : unexpected token
    ERROR: 0:2: 'in' : storage qualifier supported in GLSL ES 3.00 and above only
    ERROR: 0:2: '' : No precision specified for (float)
    ERROR: 0:4: 'out' : storage qualifier supported in GLSL ES 3.00 and above only
    ERROR: 0:4: '' : No precision specified for (float)
    ERROR: 0:10: 'texture' : no matching overloaded function found
    ERROR: 0:10: '=' : dimension mismatch
    ERROR: 0:10: 'assign' : cannot convert from 'const mediump float' to 'out 4-component vector of float'
    

    My main.cpp file looks like this:

    int main(int argc, char* argv[])
    {
    	
    	qreal dimx, dimy;
    
    	static int Result;
    
    	QQuickStyle::setStyle("Material");
    
    	QGuiApplication::setAttribute(Qt::AA_UseDesktopOpenGL);
    
    	QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
    
    	QApplication app(argc, argv);
    
    	QScreen *screen = QGuiApplication::primaryScreen();
    
    	
    		screen->setOrientationUpdateMask(Qt::LandscapeOrientation);
    		dimx = screen->availableGeometry().width();
    		dimy = screen->availableGeometry().height();
    		PixelRatio = screen->devicePixelRatio();
    		physicalSize = screen->physicalSize().width();
    	
    
    	QSurfaceFormat format;
    	format.setDepthBufferSize(24);
    
    	QSurfaceFormat::SwapBehavior swap = QSurfaceFormat::DefaultSwapBehavior;
    
    	if (buffer == "SingleBuffer") swap = QSurfaceFormat::SingleBuffer;
    	if (buffer == "DoubleBuffer") swap = QSurfaceFormat::DoubleBuffer;
    	if (buffer == "TripleBuffer") swap = QSurfaceFormat::TripleBuffer;
    
    	format.setSwapBehavior(swap);
    
    #if defined(Q_OS_ANDROID)
    	format.setRenderableType(QSurfaceFormat::OpenGLES);
    #else
    	format.setRenderableType(QSurfaceFormat::OpenGL);	
    #endif
    
    	format.setBlueBufferSize(8);
    	format.setRedBufferSize(8);
    	format.setGreenBufferSize(8);
    	format.setSamples(multisampling.toInt());
    
    	format.setProfile(QSurfaceFormat::CoreProfile);
    	format.setOption(QSurfaceFormat::DebugContext);
    
    
    	QSurfaceFormat::setDefaultFormat(format);
    
    	QIcon icon(":res/icon.jpg");
    	app.setWindowIcon(icon);
    
    #ifndef QT_NO_OPENGL
    
    	QApplication *widget;
    	widget = new QApplication ();
    
    	widget->setAttribute(Qt::WA_AcceptTouchEvents);
    
    	widget->setAttribute(Qt::WA_DeleteOnClose);
    	
    	widget->grabGesture(Qt::PinchGesture);
    
    	if (FullScreen)
    	{
    		widget->showFullScreen();
    	}
    	else
    	{
    		widget->showMaximized();
    	}
    
    #else
    	QLabel note("OpenGL Support required");
    	note.show();
    #endif
    
    #if defined(Q_OS_ANDROID)
    
    	widget->resizeGL(dimx, dimy);
    
    #endif
    
    	Result = app.exec();
    
    	return Result;
    }
    

    Why does the program start in openGl ES when I ask it to use OpenGL?

    What's wrong with you?

    Thanx !

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved