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

New Developer
Posts: 24
Registered: ‎02-06-2011
My Device: BlackBerry Z30
My Carrier: Virgin Mobile

Multiple Windows

Hi all,


I'm fairly new to development with OpenGL, and I have a question regarding having multiple screens (and by that I mean something along the lines of a menu 'screen', game 'screen', options 'screen', etc).


If I want to implement mutliple screens, would it be best to create a different EGL surface for each screen? or would it be best to create a single surface for the playbook screen and then change whats being drawn on it depending on which screen is to be displayed?


I couldn't find any example that talked about this on the dev page... would anyone be able to point me in the write direction or link me to some sample code? Thanks Smiley Happy

Posts: 29
Registered: ‎03-19-2012
My Device: Z10
My Carrier: BELL

Re: Multiple Windows

[ Edited ]

Hi Just_Bart,


Thanks for posting!


The best way to implement multiple screens within an full OpenGL App would be to use a single EGL surface and then render the appropriate OpenGL content (Model) based on the game events. One reason to not use multiple EGL surface is that switching between them would cause a screen flush and that is not good.


Most of the OpenGL game rendering books should have this information.


Another good starting point would be to take a look at some of the opensource implementations (such as www.gameplay3d.org) that must have this code implemented inside.


Cheers, Ram


New Developer
Posts: 24
Registered: ‎02-06-2011
My Device: BlackBerry Z30
My Carrier: Virgin Mobile

Re: Multiple Windows

Hi Ram,

Thanks for the reply, that's just the reply I was hoping for, quick and to the point Smiley Happy Since I'm getting into OpenGL I wasn't sure exactly how surfaces we're to be used / used for aside for drawing, currently the way I have things set up in my code is to use just one surface per screen - so minimal code change should be required. I'll look into that link shortly!