Qt OpenGL 3D GraphicsIntroductionOpenGL is a standard API for rendering 3D graphics. OpenGL only deals with 3D rendering and provides little or no support for GUI programming issues. The user interface for an OpenGL application must be created with another toolkit, such as Motif on the X platform, Microsoft Foundation Classes (MFC) under Windows - or Qt on both platforms. The Qt OpenGL module makes it easy to use OpenGL in Qt applications. It provides an OpenGL widget class that can be used just like any other Qt widget, only that it opens an OpenGL display buffer where you can use the OpenGL API to render the contents. The Qt OpenGL module is implemented as a platform-independent Qt/C++ wrapper around the platform-dependent GLX and WGL C APIs. The provided functionality is very similar to Mark Kilgard's GLUT library, but with much more non-OpenGL-specific GUI functionality: the whole Qt API.
InstallationWhen you install Qt for X11, the configure script will autodetect if OpenGL headers and libraries are installed on your system, and if so, it will include the Qt OpenGL module in the Qt library. (If your OpenGL headers or libraries are placed in a non-standard directory, you may need to change the SYSCONF_CXXFLAGS_OPENGL and/or SYSCONF_LFLAGS_OPENGL in the config file for your system). When you install Qt for Windows, the Qt OpenGL module is always included. The Qt OpenGL module is not licensed for use with the Qt Professional Edition. Consider upgrading to the Qt Enterprise Edition if you require OpenGL support. Note about using Mesa on X11: Mesa versions earlier than 3.1 would use the name "MesaGL" and "MesaGLU" for the libraries, instead of "GL" and "GLU". If you want to use a pre-3.1 version of Mesa, you must change the Makefiles to use these library names instead. The easiest way to do this edit the SYSCONF_LIBS_OPENGL line in the config file you are using, changing "-lGL -lGLU" to "-lMesaGL -lMesaGLU"; then run "configure" again.
The QGL ClassesThe OpenGL support classes in Qt are:
Many applications need only the high-level QGLWidget class. The other QGL classes provide advanced features. |
Publicité
Best OfActualités les plus luesSemaine
Mois
Année
![]()
![]() Le Qt Developer Network au hasard![]() Applications mobiles modernes avec Qt et QMLLe Qt Developer Network est un réseau de développeurs Qt anglophone, où ils peuvent partager leur expérience sur le framework. Lire l'article.
CommunautéRessources
Liens utilesContact
Qt dans le magazine |
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt 2.3 | |
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! |
Copyright © 2000-2012 - www.developpez.com