X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fblackberry%2Ffg_init_blackberry.c;h=aaef2cb270ee742895572e6698bc8271dfab7397;hb=cc3d0ca4db0793c3c3760d7b34dded07c396edf0;hp=40b1ed62d8fc79ec4eeb64415b2621e9dc436f32;hpb=1f67274c9ebf2ed21d6302af23175a24ed56c820;p=freeglut diff --git a/src/blackberry/fg_init_blackberry.c b/src/blackberry/fg_init_blackberry.c index 40b1ed6..aaef2cb 100644 --- a/src/blackberry/fg_init_blackberry.c +++ b/src/blackberry/fg_init_blackberry.c @@ -29,30 +29,38 @@ #include "fg_init.h" #include "egl/fg_init_egl.h" #include -#include +#include void fgPlatformInitialize() { - bps_initialize(); + bps_initialize(); - navigator_request_events(0); - //XXX rotation lock? navigator_rotation_lock(true); + fghPlatformInitializeEGL(); - fghPlatformInitializeEGL(); + /* Prepare for screen events */ + fgDisplay.pDisplay.event = NULL; + fgDisplay.pDisplay.screenContext = NULL; - /* Get start time */ - fgState.Time = fgSystemTime(); + /* Create window */ + if (screen_create_context(&fgDisplay.pDisplay.screenContext, 0)) { + fgError("Could not create screen context"); + return; + } - fgState.Initialised = GL_TRUE; + /* Get start time */ + fgState.Time = fgSystemTime(); + + fgState.Initialised = GL_TRUE; } void fgPlatformCloseDisplay() { - fghPlatformCloseDisplayEGL(); + fghPlatformCloseDisplayEGL(); - navigator_stop_events(0); + screen_destroy_context(fgDisplay.pDisplay.screenContext); + fgDisplay.pDisplay.screenContext = NULL; - bps_shutdown(); + bps_shutdown(); } /**