Vertex triangle[3]; triangle[0].x = 0.0f; triangle[0].y = 0.0f; triangle[0].z = 0.0f; triangle[0].nx = 0.0f; triangle[0].ny = 0.0f; triangle[0].nz = 1.0f; triangle[0].s0 = 0.0f; triangle[0].s1 = 0.0f; triangle[1].x = 1.0f; triangle[1].y = 0.0f; triangle[1].z = 0.0f; triangle[1].nx = 0.0f; triangle[1].ny = 0.0f; triangle[1].nz = 1.0f; triangle[1].s0 = 1.0f; triangle[1].s1 = 0.0f; triangle[2].x = 0.0f; triangle[2].y = 1.0f; triangle[2].z = 0.0f; triangle[2].nx = 0.0f; triangle[2].ny = 0.0f; triangle[2].nz = 1.0f; triangle[2].s0 = 0.0f; triangle[2].s1 = 1.0f; glGenBuffers(1,&tri_id); glBindBuffer(GL_ARRAY_BUFFER,tri_id); glBufferData(GL_ARRAY_BUFFER, sizeof(Vertex)*3,&triangle[0].x,GL_STATIC_DRAW); glGenBuffers(1,&ind_id); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,ind_id); glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(unsigned short)*3,indices,GL_STATIC_DRAW); glEnableVertexAttribArray(0); glVertexAttribPointer(0,3,GL_FLOAT,GL_FALSE,sizeof(Vertex),(char*)(0)); glEnableVertexAttribArray(1); glVertexAttribPointer(1,3,GL_FLOAT,GL_FALSE,sizeof(Vertex),(char*)(12)); glEnableVertexAttribArray(2); glVertexAttribPointer(2,2,GL_FLOAT,GL_FALSE,sizeof(Vertex),(char*)(24));

I then call this function in my main loop of the program:

glClearColor(0.0f,0.0f,0.0f,1.0f); glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_SHORT, indices);

The shaders which I am using are just a basic fragment and vertex shader. I have checked and they have been compiled and loaded succesfully.

What happens is the screen blinks. The entire screen... rapidly... when running my program.

Edit:

I just noticed the triangle 0's for all verts thing and changed it... I also noticed the double bind buffer and removed that -

**Edited by Homunculi, 21 May 2012 - 12:03 AM.**