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. Polymorphic QOpenGLFunction version
Forum Update on Monday, May 27th 2025

Polymorphic QOpenGLFunction version

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 676 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.
  • A Offline
    A Offline
    ArchW
    wrote on 16 Nov 2014, 00:00 last edited by
    #1

    Hi,

    Up until now I've used a typedef in order to reference whatever QOpenGLFunctions_X_X I've been using like so:

    @//gl_include.h file to be included for any parts in need of opengl functions
    #include <QtGui/QOpenGLFunctions>
    #include <QOpenGLFunctions_4_3_Core>

    namespace MyNameSpace
    {
    typedef QOpenGLFunctions_4_3_Core GLFuncs;
    }@

    Because of the typedef it has been easy to switch versions as needed. If downgrading, any unsupported functions has been defined out. Lately, I've been refactoring my rendering code, and this typedef was okay in the beginning, but it does not really fit anymore and I'd like to improve it.

    One of the reasons I started using the typedef was because QOpenGLContext->versionFunctions() could not be used unless it was cast into the correct version.

    Any idea how to handle it in a better way? I'd like to setup the context with whatever version format once, and get a polymorphic version exposing the OpenGL functions without having to cast it beforehand.

    1 Reply Last reply
    0

    1/1

    16 Nov 2014, 00:00

    • Login

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