static DFBResult system_initialize( CoreDFB *core, void **ret_data ) { DFBResult ret; PVR2DData *data; PVR2DDataShared *shared; FusionSHMPoolShared *pool; D_ASSERT( m_data == NULL ); data = D_CALLOC( 1, sizeof(PVR2DData) ); if (!data) return D_OOM(); data->core = core; pool = dfb_core_shmpool( core ); shared = SHCALLOC( pool, 1, sizeof(PVR2DDataShared) ); if (!shared) { D_FREE( data ); return D_OOSHM(); } shared->shmpool = pool; data->shared = shared; ret = InitPVR2D( data ); if (ret) { SHFREE( pool, shared ); D_FREE( data ); return ret; } ret = InitEGL( data ); if (ret) { SHFREE( pool, shared ); D_FREE( data ); return ret; } *ret_data = m_data = data; data->screen = dfb_screens_register( NULL, data, pvr2dPrimaryScreenFuncs ); data->layer = dfb_layers_register( data->screen, data, pvr2dPrimaryLayerFuncs ); dfb_surface_pool_initialize( core, pvr2dSurfacePoolFuncs, &shared->pool ); fusion_arena_add_shared_field( dfb_core_arena( core ), "pvr2d", shared ); return DFB_OK; }
WindowEGLImpl::WindowEGLImpl(WindowEGL* window) : m_window(window), m_callback(NULL) { assert(m_window); bool ret; ret = InitEGL(); assert(ret); ret = CreateSurface(); assert(ret); ret = InitGL(); assert(ret); }
void OpenGLRenderForm::StartRendering() { AppLog("OpenGLRenderForm::StartRendering()"); if (isRendering) return; isRendering = true; InitEGL(); OnStartRendering(); _timer = new Timer(); _timer->Construct(*this); _timer->Start(TIMER_INTERVAL_MS); }
void AndroidEGL::Init(APIVariant API, uint32 MajorVersion, uint32 MinorVersion, bool bDebug) { if (PImplData->Initalized) { return; } InitEGL(API); if (bSupportsKHRCreateContext) { const uint32 MaxElements = 13; uint32 Flags = 0; Flags |= bDebug ? EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR : 0; ContextAttributes = new int[MaxElements]; uint32 Element = 0; ContextAttributes[Element++] = EGL_CONTEXT_MAJOR_VERSION_KHR; ContextAttributes[Element++] = MajorVersion; ContextAttributes[Element++] = EGL_CONTEXT_MINOR_VERSION_KHR; ContextAttributes[Element++] = MinorVersion; if (API == AV_OpenGLCore) { ContextAttributes[Element++] = EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR; ContextAttributes[Element++] = EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR; } ContextAttributes[Element++] = EGL_CONTEXT_FLAGS_KHR; ContextAttributes[Element++] = Flags; ContextAttributes[Element++] = EGL_NONE; checkf( Element < MaxElements, TEXT("Too many elements in config list")); } else { // Fall back to the least common denominator ContextAttributes = new int[3]; ContextAttributes[0] = EGL_CONTEXT_CLIENT_VERSION; ContextAttributes[1] = 2; ContextAttributes[2] = EGL_NONE; } InitContexts(); PImplData->Initalized = true; // INITIATE_GL_FRAME_DUMP(); }
bool GLRenderer::initialize(EGLNativeWindowType window) #endif { #ifndef IOS Log("Initializing OpenGL"); if(!InitEGL(window)) { Log("[GlesCube] GlesCube can run on systems which supports OpenGL ES(R) 2.0."); Log("[GlesCube] When GlesCube does not correctly execute, there are a few reasons."); Log("[GlesCube] 1. The current device(real-target or simulator) does not support OpenGL ES(R) 2.0. Check the Release Notes."); Log("[GlesCube] 2. The system running on simulator cannot support OpenGL(R) 2.1 or later. Try with other system."); Log("[GlesCube] 3. The system running on simulator does not maintain the latest graphics driver. Update the graphics driver."); DestroyGL(); return false; } #endif if(!InitGL()) { return false; } return true; }