void FGearVRPlugin::PreInit() { #if GEARVR_SUPPORTED_PLATFORMS if (!AndroidThunkCpp_IsGearVRApplication()) { // don't do anything if we aren't packaged for GearVR return; } FGearVR::PreInit(); #endif//GEARVR_SUPPORTED_PLATFORMS }
TSharedPtr< class IHeadMountedDisplay, ESPMode::ThreadSafe > FGearVRPlugin::CreateHeadMountedDisplay() { #if GEARVR_SUPPORTED_PLATFORMS if (!AndroidThunkCpp_IsGearVRApplication()) { // don't do anything if we aren't packaged for GearVR return NULL; } TSharedPtr< FGearVR, ESPMode::ThreadSafe > GearVR(new FGearVR()); if (GearVR->IsInitialized()) { return GearVR; } #endif//GEARVR_SUPPORTED_PLATFORMS return NULL; }
void FPlatformOpenGLDevice::Init() { extern void InitDebugContext(); FPlatformMisc::LowLevelOutputDebugString(TEXT("FPlatformOpenGLDevice:Init")); bool bCreateSurface = !AndroidThunkCpp_IsGearVRApplication(); AndroidEGL::GetInstance()->InitSurface(false, bCreateSurface); PlatformRenderingContextSetup(this); LoadEXT(); InitDefaultGLContextState(); InitDebugContext(); PlatformSharedContextSetup(this); InitDefaultGLContextState(); InitDebugContext(); AndroidEGL::GetInstance()->InitBackBuffer(); //can be done only after context is made current. }