PowerVR OpenGL | ES 2 SDK problem?

Hello,

I’m trying to draw a triangle strip with the OpenGL | ES 2 SDK from Imagination Tech for windows (OGLES2_WINDOWS_PCEMULATION_2.03.23.1162)

It works well when using GL_FLOAT’s for my vertices but when using GL_FIXED it seems to allways miss the last vertex. Let me show a working example drawing a plane:


GLfloat pfVertices[] = { 0.0f, 0.0f,
				0.0f, 1.0f,
				1.0f, 0.0f,
				1.0f, 1.0f};

GLushort indeces[] = {0, 2, 1, 3};
glVertexAttribPointer(VERTEX_ARRAY, 2, GL_FLOAT, GL_FALSE, 0, pfVertices);
glDrawElements(GL_TRIANGLE_STRIP, 4, GL_UNSIGNED_SHORT, indices);


when using fixed data type like this;


int fixedVertices[] = {  0 << 16, 0 << 16,
				0 << 16, 1 << 16,
				1 << 16, 0 << 16,
				1 << 16, 1 << 16};

GLushort indeces[] = {0, 2, 1, 3};
glVertexAttribPointer(VERTEX_ARRAY, 2, GL_FIXED, GL_FALSE, 0, fixedVertices);
glDrawElements(GL_TRIANGLE_STRIP, 4, GL_UNSIGNED_SHORT, indeces);

only one single triangle appears.

My idea is that the last vertex is discarded when using fixed data type, the following example shows a working plane:


int fixedVertices[] = {   0 << 16, 0 << 16,
				0 << 16, 1 << 16,
				1 << 16, 0 << 16,
				1 << 16, 1 << 16,
				2 << 16, 0 << 16};

GLushort indeces[] = {0, 2, 1, 3, 4};
glVertexAttribPointer(VERTEX_ARRAY, 2, GL_FIXED, GL_FALSE, 0, fixedVertices);
glDrawElements(GL_TRIANGLE_STRIP, 5, GL_UNSIGNED_SHORT, indeces);

Do anyone else having the same problems? Is this a bug? On desktop GL this works without any problems.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.