IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

OpenGL Discussion :

utilisation de glew dans une appli multithread


Sujet :

OpenGL

  1. #1
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Octobre 2005
    Messages
    41
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2005
    Messages : 41
    Points : 25
    Points
    25
    Par défaut utilisation de glew dans une appli multithread
    bonjour, je voudrais dans une application multithread sous linux utiliser plusieur instance de glew , sur le site il note :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    Starting with release 1.2.0, thread-safe support for multiple rendering contexts, possibly with different capabilities, is available. Since this is not required by most users, it is not added to the binary releases to maintain compatibility between different versions. To include multi-context support, you have to do the following:
     
       1. Compile and use GLEW with the GLEW_MX preprocessor token defined.
       2. For each rendering context, create a GLEWContext object that will be available as long as the rendering context exists.
       3. Define a macro or function called glewGetContext() that returns a pointer to the GLEWContext object associated with the rendering context from which OpenGL/WGL/GLX calls are issued. This dispatch mechanism is primitive, but generic.
       4. Make sure that you call glewInit() after creating the GLEWContext object in each rendering context. Note, that the GLEWContext pointer returned by glewGetContext() has to reside in global or thread-local memory. 
     
    Note that according to the MSDN WGL documentation, you have to initialize the entry points for every rendering context that use pixel formats with different capabilities For example, the pixel formats provided by the generic software OpenGL implementation by Microsoft vs. the hardware accelerated pixel formats have different capabilities. GLEW by default ignores this requirement, and does not define per-context entry points (you can however do this using the steps described above). Assuming a global namespace for the entry points works in most situations, because typically all hardware accelerated pixel formats provide the same entry points and capabilities. This means that unless you use the multi-context version of GLEW, you need to call glewInit() only once in your program, or more precisely, once per process.

    donc jai recompilé glew avec le preprocesseur -DGLEW_MX, j'ai ajouté
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    #define GLEW_MX
    #include <GL/glew.h>
    ....
    ...
    GLEWContext glewctx;
    #define glewGetContext() (&_glewctx)
    et dans ma fonction d'initialisation de GLEW je fait un : glewContextInit (&glewctx);
    mais gcc me retourne une erreur : undefined reference to `glewContextInit'



    si quelqu'un a une idée ou peut m'expliquer comment utiliser glew dans une application multithread....

    Merci d'avance

  2. #2
    Membre habitué
    Homme Profil pro
    Inscrit en
    Avril 2004
    Messages
    340
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Avril 2004
    Messages : 340
    Points : 177
    Points
    177
    Par défaut
    les undefined ref, c'est une erreur au niveau de l'edition de lien. quelle est ta commande pour l'edition de lien ?
    L'Opus attire les Prélats

Discussions similaires

  1. Utiliser un cookie d'un webservice C# dans une appli C++ MFC
    Par manhattan.project dans le forum MFC
    Réponses: 1
    Dernier message: 17/04/2007, 08h55
  2. Peux-t'on utiliser un assemby 2.0 dans une appli 1.1 ?
    Par RamDevTeam dans le forum Framework .NET
    Réponses: 1
    Dernier message: 19/09/2006, 17h32
  3. [D2006] - Utiliser un composant C# dans une appli VCL.NET
    Par RamDevTeam dans le forum Delphi .NET
    Réponses: 1
    Dernier message: 13/02/2006, 16h07
  4. Réponses: 15
    Dernier message: 22/03/2005, 14h45

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo