Jump to content
  • Advertisement
Sign in to follow this  
Loren_Soth

VBO = Vertex array drawing with no texture Coords.

This topic is 5013 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello to all ! When i do my work with vbo object i turn off the multitexture passes, and disable the client states GL_VERTEX_ARRAY and GL_TEXTURE_COORD_ARRAY like ..... ////////////////////////////////////////// // Turn the second multitexture pass off glActiveTextureARB(GL_TEXTURE1_ARB); glDisable(GL_TEXTURE_2D); // Turn the first multitexture pass off glActiveTextureARB(GL_TEXTURE0_ARB); glDisable(GL_TEXTURE_2D); glDisableClientState( GL_VERTEX_ARRAY ); glDisableClientState( GL_TEXTURE_COORD_ARRAY ); //////////////////////////////////////////////////////// thats ok ! no problem but later on when i try to do smt like that ... //////////////////////////////////////////////////////// glEnableClientState(GL_VERTEX_ARRAY); glVertexPointer(3, GL_FLOAT, sizeof (Vertex), Vertices); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glTexCoordPointer(2, GL_FLOAT, sizeof (TexCoord), TextureCoords); glDrawElements (GL_TRIANGLES, ToplamIndices ,GL_UNSIGNED_INT , Indices ) ; glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_TEXTURE_COORD_ARRAY); //////////////////////////////////////////////////////// it draws the object with no texture coordinates applied that indices supply ! (When i disable the multitexturing (i mean erase the MT codes) glDrawElements draws with texture coordinates) What is the problem ?? ý think texture coordinate pointer still shows the memory at the card in spite of i used .. glTexCoordPointer(2, GL_FLOAT, sizeof (TexCoord), TextureCoords);

Share this post


Link to post
Share on other sites
Advertisement
yeah after that code i wrote at first message
i wrote this code...

/////////////////////////

glActiveTextureARB(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_2D);

////////////////////////////


still it doesnt work :((

Share this post


Link to post
Share on other sites
Alright i got the problem ! later on when i use this

////////////////////////////////////////////////////////

glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, sizeof (Vertex), Vertices);

glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(2, GL_FLOAT, sizeof (TexCoord), TextureCoords);


glDrawElements (GL_TRIANGLES, ToplamIndices ,GL_UNSIGNED_INT , Indices ) ;


glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);



////////////////////////////////////////////////////////

actually "Indices" should point a location at RAM, but however it still points to the memory at the Video card in spite of i unbind it with this...

glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);

now how should i make it like that glDrawElements draws with the given Texture coordinates at 4.th argument ?

Share this post


Link to post
Share on other sites
okay i ve found the answer !

i should disable them in this order ...

/////////////////////
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisable(GL_TEXTURE_2D);
glActiveTextureARB(GL_TEXTURE0_ARB);
glClientActiveTextureARB(GL_TEXTURE0_ARB);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisable(GL_TEXTURE_2D);

/////////////////////

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!