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
Highlighted
Contributor
Posts: 23
Registered: ‎06-06-2012
My Device: Simulator
My Carrier: n/a
Accepted Solution

OpenGL and timers

Hi there,

 

I notice that all of the OpenGL demos basically call render() in a tight loop in the main function. Are there any best-practice techniques to lock to a specific framerate, synchronize rendering to hardware cycle (for example, iOS provides CADisplayLink which is a timer that fires on VBlank intervals), etc?

 

Thanks,


Dan.

Developer
Posts: 93
Registered: ‎05-31-2012
My Device: BlackBerry Playbook
My Carrier: Bell

Re: OpenGL and timers

Hi Dan,

 

Unlike Android or iOS, Playbook NDK properly enforces the swap interval is syncs surface swaps (similarly to DirectX). So you shouldn't need timers to syncronize your render loop. If you are targetting 60FPS, eglSwapInterval(mEGLDisplay, 1); or 30FPS eglSwapInterval(mEGLDisplay, 2);

 

Kind regards,

 

Stephane