VBO help (SOLVED)

Started by
1 comment, last by dawidjoubert 18 years, 4 months ago
Hi there, im trying to get VBOs to work in my project but so far i have had no luck. I am using GLEE plugin header for the management of OpenGL Extensions and at the moment the MULTITEXTURING & VSYNC extensions work wonderfully however it seems i cant get the VBOs to work. GLEE is suppose to support it and i dont think its glee thats broken i think its me thats broken. Here is how i check for the VBO extension VBOSupported =IsExtensionSupported( "GL_ARB_vertex_buffer_object" ); If i comment the VBO support line out then the program runs without using vbos and everything is fine. YES my machine does support VBO because the Nehe Tutorial along with some other progies use it. Here is the Create buffer source
[Source]
	if (VBOSupported)
	{
		UseVBO = true;
		while (glGetError() != GL_NO_ERROR);
		// Generate And Bind The Vertex Buffer
		glGenBuffersARB( 1, &VBOVertices );// Get A Valid Name
		glBindBufferARB( GL_ARRAY_BUFFER_ARB, VBOVertices );// Bind The Buffer
		// Load The Data
		glBufferDataARB( GL_ARRAY_BUFFER_ARB, lPoints*3*sizeof(float), lPoint, GL_STATIC_DRAW_ARB );

		// Our Copy Of The Data Is No Longer Necessary, It Is Safe In The Graphics Card
		//delete [] lPoint; lPoint = NULL;
		//delete [] lVertex; lVertex = NULL;

		return glGetError();
	}
[/Source]
[/source] And here is how i render the VBOs
[Source]
		glDisable(GL_TEXTURE_2D);
		glColor4f(1,1,1,1);
		glBindBufferARB( GL_ARRAY_BUFFER_ARB, VBOVertices);
		glVertexPointer(3, GL_FLOAT,0,(char *) NULL);
		//glTexCoordPointer( 2, GL_FLOAT, 0, (char *) NULL);
		glDrawArrays(GL_LINE_STRIP, 0, lPoints);

		// Disable Pointers
		glDisableClientState( GL_VERTEX_ARRAY );// Disable Vertex Arrays
		glDisableClientState( GL_TEXTURE_COORD_ARRAY );// Disable Texture Coord Arrays
[/Source]
[/source] As you can see im rendering lines but it doesnt matter, it doesnt work with triangles nor triangle strips or quad strips. And yes i have initialized glee as i said the multitexturing extension works [Edited by - dawidjoubert on December 17, 2005 3:24:01 PM]
----------------------------

http://djoubert.co.uk
Advertisement
Well in that source you aren't enabling the vertex array client state, or the texture array, or binding anything to a texture array.
Quote:Original post by bluntman
Well in that source you aren't enabling the vertex array client state, or the texture array, or binding anything to a texture array.


Thanks alot, that was it.. i knew it was something simple.


Regards
----------------------------

http://djoubert.co.uk

This topic is closed to new replies.

Advertisement