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
Developer
Posts: 133
Registered: ‎05-10-2013
My Device: Blackberry Z10
My Carrier: -

Sample OpenGL in Foreign Window apps

Hey everyone,

 

Any idea where I can find some sample code or a sample app which renders OpenGL elements in a Foreign Window using c++ code (.cpp and .hpp files) an not c code? Something like a full version of an app which implements the notions on this Native SDK page:

 

http://developer.blackberry.com/native/documentation/bb10/the_basic_structure_of_cascades_app_using_...

 

It that is not doable, gow do you go about integrting OpenGL (.c) co into a native cascades app (.cpp)?

 

Thanks a ton!

----------------------------------------
Remember to mark the thread as solved at the post that solved your problem, and if you like a post, like it!
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Sample OpenGL in Foreign Window apps

The OpenGL API is a C API, and you can just call it from C++ as you always can call C code.

As far as I know, there isn't a C++ (object-oriented) wrapper API built around the C one, but that shouldn't stop anyone from just using it as-is.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 133
Registered: ‎05-10-2013
My Device: Blackberry Z10
My Carrier: -

Re: Sample OpenGL in Foreign Window apps

Do you call c code with "extern c"? And if so, where do you put that c code? sorry about the stupid questions, I've googled this a lot and found many example of calling c from c++, but none of them have worked so far.

----------------------------------------
Remember to mark the thread as solved at the post that solved your problem, and if you like a post, like it!
Developer
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: Sample OpenGL in Foreign Window apps

It'll be better if you give us short example what exactly does not work? what error do you get using what code?

It is totally ok to mix C and C++ code.