01-06-2013 03:35 PM
Hi,
I'm porting a C++/OpenGl ES 2.0 game to the current Playbook API. My problem is that inside of bbutil_init_egl, eglGetDisplay is returning EGL_NO_DISPLAY without setting any error:
int main(int argc, char *argv[]) {
screen_context_t screen_cxt;
//Initialize BPS library
bps_set_verbosity(2);
bps_initialize();
screen_create_context(&screen_cxt, 0);
if (EXIT_SUCCESS != bbutil_init_egl(screen_cxt, GL_ES_2, AUTO)) {
fprintf(stderr, "bbutil_init_egl failed\n");
The log output is:
[BPS:INFO] BPS setting verbosity 2
[BPS:INFO] bps init
[BPS:INFO] BPS initialized successfully
[BPS:INFO] Initializing channels for thread
[BPS:INFO] channel_create(783852,1,0) called
[BPS:INFO] io_notifier_create(3526836,0)
eglGetDisplay: function succeeded
bbutil_init_egl failed
Any idea where to start debugging this?
I tried the same initialization code in a stripped down little C++ app and did NOT see the problem there. So maybe it's something in my build settings or manifest or something?
Thanks
Solved! Go to Solution.
01-06-2013 05:19 PM
I think, there's a fair bit more required before you can set up the EGL stuff. Have you read the docs on it, or looked at a sample? The Momentics IDE can make an OpenGL template app for you with some code that sets that up, or you can read the gory details (recommended) under http://developer.blackberry.com/native/documentati
01-06-2013 09:44 PM
Thanks for the reply.
Yes, I've looked over the docs and tried out the sample App - it works fine.
I guess my question is, for the bbutil.c code that comes with the OpenGL ES2 template App, under what conditions would eglGetDisplay return EGL_NO_DISPLAY?:
egl_disp = eglGetDisplay(EGL_DEFAULT_DISPLAY);
if (egl_disp == EGL_NO_DISPLAY) {
bbutil_egl_perror("eglGetDisplay");
bbutil_terminate();
return EXIT_FAILURE;
}
01-11-2013 10:34 AM
Following up:
I fixed this problem, it actually seemed to be related to some problem with static linking of my app. I was compiling some support code as static libraries and then linking them to my final app. When I removed the static linking and just compiled all that support code into the main project, this problem went away! Really weird.