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
smartworlds
Posts: 4
Registered: ‎06-10-2012
My Device: 9650
My Carrier: Sprint
Accepted Solution

OpenGL function glRotatef can't work in ForeignWindow control

Hello,

I wrote a demo to show a rotated rectangle in foreignWindow control, the rectangle showed but can't rotate:

So is there something i am doing wrong with the code or is it just a foreignWindow limitation?

The following is part code of my demo:


void MyForeignWindow::render()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(2, GL_FLOAT, 0, this->vertices);

glEnableClientState(GL_COLOR_ARRAY);
glColorPointer(4, GL_FLOAT, 0, this->colors);

glRotatef(0.5f, 0.0f, 0.0f, 1.0f);

glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);

glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);

this->swap();
}

 


Please use plain text.
Developer
guru2000at
Posts: 101
Registered: ‎02-25-2011
My Device: Playbook, q5, z10
My Carrier: TM

Re: OpenGL function glRotatef can't work in ForeignWindow control

try change the angle to eg 45 degree. ... does it rotate ? or is there any opengl error ?

you can get this errors with eglGetError()

do you use any glpushmatrix in another render function (opengl is a statemachine!)

________________
mappau Dev Team
blackberry@mappau.com
twitter: mappau
Please use plain text.
New Contributor
smartworlds
Posts: 4
Registered: ‎06-10-2012
My Device: 9650
My Carrier: Sprint

Re: OpenGL function glRotatef can't work in ForeignWindow control

Thanks,

It's my mistake,  render() invoked only once and the angle is too small.

Please use plain text.