Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Contributor
Posts: 2
Registered: ‎02-28-2012
My Device: PlayBook
My Carrier: -
Accepted Solution

glLineWidth() not working?

Hi,

 

I am experiencing strange behaviour when trying to render lines under OpenGL ES 2.0 and using glLineWidth().

It works fine with a line width of 1.0, but everything wider just results in a filled shape with occasional screen flickering. According to GL_ALIASED_LINE_WIDTH_RANGE a line width of 1 to 7 should be supported.

I don't have my PlayBook yet so I only tested it on the simulator.

As this would be an instant show-stopper for me, could anybody else please confirm that this issue exists in the simulator or on the real device (or help me what I am doing wrong)?

 

My test program is as simple as this:

 

GLfloat vVertices[] = { 0.0f, 0.5f, 0.0f, -0.5f, -0.5f, 0.0f, 0.5f, -0.5f, 0.0f };

 

glUseProgram(simpleShader);

glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, vVertices);

glEnableVertexAttribArray(position);

 

glLineWidth(2.0);

glDrawArrays(GL_LINE_LOOP, 0, 3);

Developer
Posts: 101
Registered: ‎02-25-2011
My Device: Playbook, q5, z10
My Carrier: TM

Re: glLineWidth() not working?

I'm using glLineWidth(2.0f) without any flickering on the playbook. works fine

 

sample snippet:

		glEnableClientState(GL_VERTEX_ARRAY);
		glVertexPointer(2, GL_FLOAT, 0, pointsX);

		glLineWidth(2.0f);
		glDrawArrays(GL_LINE_STRIP, 0, numberOfPoints);

		glDisableClientState(GL_VERTEX_ARRAY);

 

________________
mappau Dev Team
blackberry@mappau.com
twitter: mappau
Highlighted
New Contributor
Posts: 2
Registered: ‎02-28-2012
My Device: PlayBook
My Carrier: -

Re: glLineWidth() not working?

Thanks! It's (thankfully) really just a problem of the simulator.