From 1e18df9c73e5431083ac2983c8899823d5ce259d Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 3 Mar 2014 14:47:27 +0100 Subject: Extend QOpenGLFunctions with GL1 functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This introduces the ability to indirectly invoke all common GL1-GLES2 functions via QOpenGLFunctions. The GL1 functions are not yet resolved, since this would not work anyway when linking to an OpenGL implementation directly. However this may change later but that will be a completely internal change without affecting any public APIs. Also migrate some of the opengl examples to use QOpenGLFunctions for everything. Once dynamic GL loading becomes available on some platforms, these examples should continue to function without any changes since they do not anymore invoke any OpenGL functions directly. Task-number: QTBUG-36483 Change-Id: Ie630029651e5a4863a480aac5306edd67ee36813 Reviewed-by: Friedemann Kleint Reviewed-by: Jørgen Lind --- examples/opengl/contextinfo/widget.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'examples/opengl/contextinfo/widget.cpp') diff --git a/examples/opengl/contextinfo/widget.cpp b/examples/opengl/contextinfo/widget.cpp index 6d4b97ca8f..ff78639e24 100644 --- a/examples/opengl/contextinfo/widget.cpp +++ b/examples/opengl/contextinfo/widget.cpp @@ -312,13 +312,14 @@ void Widget::renderWindowReady() QString vendor, renderer, version, glslVersion; const GLubyte *p; - if ((p = glGetString(GL_VENDOR))) + QOpenGLFunctions *f = context->functions(); + if ((p = f->glGetString(GL_VENDOR))) vendor = QString::fromLatin1(reinterpret_cast(p)); - if ((p = glGetString(GL_RENDERER))) + if ((p = f->glGetString(GL_RENDERER))) renderer = QString::fromLatin1(reinterpret_cast(p)); - if ((p = glGetString(GL_VERSION))) + if ((p = f->glGetString(GL_VERSION))) version = QString::fromLatin1(reinterpret_cast(p)); - if ((p = glGetString(GL_SHADING_LANGUAGE_VERSION))) + if ((p = f->glGetString(GL_SHADING_LANGUAGE_VERSION))) glslVersion = QString::fromLatin1(reinterpret_cast(p)); m_output->append(tr("\nVendor: %1").arg(vendor)); -- cgit v1.2.3