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
Trusted Contributor
Posts: 232
Registered: ‎11-19-2010
My Device: Z10, Playbook
Accepted Solution

opengl ES 1.1 question

If I define the following two points for a line

 

line[0]=-1.0;

line[1]=0.6;

line[2]=1.0;

line[3]=-0.6;

 

and scale using

 

glScalef((float) (surface_width),(float) (surface_height),1.0f );

 

when I draw using (after setting gl vertex array and vertex pointer to the vertices array)

 

glDrawArrays(GL_LINES, 0, 2);

 

I get what I expect, a nice diagonal line from upper left down to lower right.

 

Now if I change only the vertices to

 

line[0]=-1.0;

line[1]=0.6;

line[2]=1.0;

line[3]=0.6; /*change this from -0.6 to 0.6*/

 

I get nothing drawn on the screen.

 

I'm using the BB10 simulator with landscape mode selected in the bar descriptor file.

 

Am I missing something simple here? I expect a line going straight across the screen at 2/3 the way up from center.

 

 

Trusted Contributor
Posts: 232
Registered: ‎11-19-2010
My Device: Z10, Playbook

Re: opengl ES 1.1 question

Never mind...

 

Had a projection set incorrect