Hi guys,

The issue I have is that I am trying to draw 2 triangles as a quad and texture over it. Drawing the font seems to work no problem but when trying to draw a textured tile it doesn't seem to. If I draw with the following code:

Code :
void OGL_Renderer_3_2::drawVertexArray(GLuint textureId, bool defaultTextureCoords){
	//clearScreen(0, 0, 0);
	glEnable(GL_BLEND);
	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
 
	glUseProgram(mShaderManager->getShaderProgram());
	getError();
 
	mModelViewMatrix = glGetUniformLocation(mShaderManager->getShaderProgram(), "mvp");
	getError();
 
	glUniformMatrix4fv(mModelViewMatrix, 1, GL_FALSE, glm::value_ptr(ModelViewMatrix));
	getError();
 
 
 
	glActiveTexture(GL_TEXTURE0 + textureId);
	glBindTexture(GL_TEXTURE_2D, textureId);
 
 
	GLint texUnitLoc = glGetUniformLocation(mShaderManager->getShaderProgram(), "tex0");
	glUniform1i(texUnitLoc, textureId);
 
	glBindVertexArray(mVertexArray);
	getError();
 
 
	glDrawArrays(GL_TRIANGLES, 0, 6);
	getError();
 
 
	glBindVertexArray(0);
	getError();
	glActiveTexture(GL_TEXTURE0);
	glBindTexture(GL_TEXTURE_2D, 0);
	getError();
	glUseProgram(0);
	getError();
	glDisable(GL_BLEND);
}

I get this screen:
Click image for larger version. 

Name:	Screen Shot 2013-02-18 at 9.30.14 AM.jpg 
Views:	205 
Size:	7.1 KB 
ID:	985

if I change glDrawArrays to 5 vertices (using either TriangleStrips or Triangles) I get this:
Click image for larger version. 

Name:	Screen Shot 2013-02-18 at 9.30.42 AM.jpg 
Views:	234 
Size:	4.9 KB 
ID:	986

Here is the vertex function where the triangles get their data:
Code :
/** * Used internally to fill the vertex array with quad vertex information.
 */
void OGL_Renderer_3_2::fillVertexArray(GLfloat x, GLfloat y, GLfloat w, GLfloat h)
{
	mVertexArrayData[0] = static_cast<GLfloat>(x); mVertexArrayData[1] = static_cast<GLfloat>(y + h); mVertexArrayData[2] = 0.0;
	mVertexArrayData[3] = static_cast<GLfloat>(x); mVertexArrayData[4] = static_cast<GLfloat>(y); mVertexArrayData[5] = 0.0;
	mVertexArrayData[6] = static_cast<GLfloat>(x + w); mVertexArrayData[7] = static_cast<GLfloat>(y); mVertexArrayData[8] = 0.0;
	mVertexArrayData[9] = static_cast<GLfloat>(x + w); mVertexArrayData[10] = static_cast<GLfloat>(y); mVertexArrayData[11] = 0.0;
	mVertexArrayData[12] = static_cast<GLfloat>(x);	mVertexArrayData[13] = static_cast<GLfloat>(y + h); mVertexArrayData[14] = 0.0;
	mVertexArrayData[15] = static_cast<GLfloat>(x + w);	mVertexArrayData[16] = static_cast<GLfloat>(y + h); mVertexArrayData[17] = 0.0;
 
 
 
	glBindBuffer(GL_ARRAY_BUFFER, mVertexBufferObject);
	getError();
	glBufferData(GL_ARRAY_BUFFER, 3 * 6 * sizeof(GLfloat), mVertexArrayData, GL_DYNAMIC_DRAW);
	getError();
	glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0);
	getError();
	glBindBuffer(GL_ARRAY_BUFFER, NULL);
	getError();
	glFlush();
	getError();
}

My instinct tells me that there is extra data or garbled data but I can't see where I would have bogus data.