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 :

[Debutant Java JOGL] problème glVertexPointer()


Sujet :

OpenGL

  1. #1
    Membre du Club
    Profil pro
    Inscrit en
    Août 2002
    Messages
    119
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2002
    Messages : 119
    Points : 68
    Points
    68
    Par défaut [Debutant Java JOGL] problème glVertexPointer()
    j ai un probleme pour enregsitré un tableau de pointeur : voici mon code qui pose problème sans doute a cause des FloatBuffer que j arrive aps a comprendre comment ca marche !

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    		float[] fs =
    			{
    				0.25f, 0.25f,
    				0.75f, 0.25f,
    				0.95f, 0.5f,
    				0.75f, 0.75f,
    				0.25f, 0.75f 
    				};
    		FloatBuffer floatBuffer = FloatBuffer.wrap(fs);
    		gl.glEnableClientState(GL.GL_VERTEX_ARRAY);
    		gl.glVertexPointer( 2,GL.GL_FLOAT,0,floatBuffer);
    et mon ereur :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
     
    net.java.games.jogl.GLException: Argument "ptr" was not a direct buffer
    	at net.java.games.jogl.impl.windows.WindowsGLImpl.glVertexPointer(WindowsGLImpl.java:20509)
    	at TestOpen.MyGLEventListener.display(MyGLEventListener.java:56)
    	at net.java.games.jogl.impl.GLDrawableHelper.display(GLDrawableHelper.java:74)
    	at net.java.games.jogl.GLCanvas$DisplayAction.run(GLCanvas.java:206)
    	at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:239)
    	at net.java.games.jogl.GLCanvas.displayImpl(GLCanvas.java:194)
    	at net.java.games.jogl.GLCanvas.display(GLCanvas.java:82)
    	at net.java.games.jogl.GLCanvas.paint(GLCanvas.java:89)
    	at sun.awt.RepaintArea.paint(RepaintArea.java:177)
    	at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:260)
    	at java.awt.Component.dispatchEventImpl(Component.java:3678)
    	at java.awt.Component.dispatchEvent(Component.java:3477)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
    	at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
    Je vous remercie d avance !!!

  2. #2
    Expert confirmé
    Avatar de GLDavid
    Homme Profil pro
    Service Delivery Manager
    Inscrit en
    Janvier 2003
    Messages
    2 859
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Service Delivery Manager
    Secteur : Industrie Pharmaceutique

    Informations forums :
    Inscription : Janvier 2003
    Messages : 2 859
    Points : 4 807
    Points
    4 807
    Par défaut
    Salut.

    Je sais pas si ça peut t'aider mais essaie de déclarer ton tableau fs ainsi :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    float []fs = new float [5*2];
    Puis remplis-le avec les diverses valeurs.
    Au pire, précises peu car il t'indique l'argument ptr. As-tu utilisé un tel type ?

    @ ++
    GLDavid
    Consultez la FAQ Perl ainsi que mes cours de Perl.
    N'oubliez pas les balises code ni le tag

    Je ne répond à aucune question technique par MP.

  3. #3
    Expert confirmé
    Avatar de GLDavid
    Homme Profil pro
    Service Delivery Manager
    Inscrit en
    Janvier 2003
    Messages
    2 859
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Service Delivery Manager
    Secteur : Industrie Pharmaceutique

    Informations forums :
    Inscription : Janvier 2003
    Messages : 2 859
    Points : 4 807
    Points
    4 807
    Par défaut
    J'oubliais aussi, tu as le forum JOGL chez Sun qui peut t'aider (moi, ça m'a été d'un grand secours) :
    http://www.javagaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=jogl

    @ ++
    GLDavid
    Consultez la FAQ Perl ainsi que mes cours de Perl.
    N'oubliez pas les balises code ni le tag

    Je ne répond à aucune question technique par MP.

Discussions similaires

  1. [java] JOGl
    Par Blo0d4x3 dans le forum OpenGL
    Réponses: 8
    Dernier message: 20/03/2006, 21h07
  2. [Java][Xpath] Problème pour rédiger une expression
    Par althea_vestrit dans le forum XSL/XSLT/XPATH
    Réponses: 3
    Dernier message: 23/01/2006, 20h53
  3. [Java 2D] problème de composition d'images
    Par wwave dans le forum 2D
    Réponses: 4
    Dernier message: 11/07/2005, 12h28
  4. [debutant] Java et MySQL
    Par micknic dans le forum JDBC
    Réponses: 6
    Dernier message: 16/04/2005, 14h29
  5. [Debutant][Join Sql] problème de join
    Par ultimax dans le forum Langage SQL
    Réponses: 4
    Dernier message: 16/11/2004, 12h01

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