Merge "emulator: opengl: add initLibrary function to render library"
This commit is contained in:
@@ -107,24 +107,6 @@ bool FrameBuffer::initialize(int width, int height)
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// Load EGL Plugin
|
||||
//
|
||||
if (!init_egl_dispatch()) {
|
||||
// Failed to load EGL
|
||||
printf("Failed to init_egl_dispatch\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// Load GLES Plugin
|
||||
//
|
||||
if (!init_gl_dispatch()) {
|
||||
// Failed to load GLES
|
||||
ERR("Failed to init_gl_dispatch\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// allocate space for the FrameBuffer object
|
||||
//
|
||||
@@ -142,7 +124,7 @@ bool FrameBuffer::initialize(int width, int height)
|
||||
fb->m_caps.hasGL2 = false;
|
||||
}
|
||||
else {
|
||||
fb->m_caps.hasGL2 = init_gl2_dispatch();
|
||||
fb->m_caps.hasGL2 = s_gl2_enabled;
|
||||
}
|
||||
#else
|
||||
fb->m_caps.hasGL2 = false;
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "osDynLibrary.h"
|
||||
|
||||
gl2_decoder_context_t s_gl2;
|
||||
int s_gl2_enabled;
|
||||
|
||||
static osUtils::dynLibrary *s_gles2_lib = NULL;
|
||||
|
||||
@@ -50,6 +51,7 @@ bool init_gl2_dispatch()
|
||||
// init the GLES dispatch table
|
||||
//
|
||||
s_gl2.initDispatchByName( gl2_dispatch_get_proc_func, NULL );
|
||||
s_gl2_enabled = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ bool init_gl2_dispatch();
|
||||
void *gl2_dispatch_get_proc_func(const char *name, void *userData);
|
||||
|
||||
extern gl2_decoder_context_t s_gl2;
|
||||
extern int s_gl2_enabled;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -20,6 +20,10 @@
|
||||
#include "osProcess.h"
|
||||
#include "TimeUtils.h"
|
||||
|
||||
#include "EGLDispatch.h"
|
||||
#include "GLDispatch.h"
|
||||
#include "GL2Dispatch.h"
|
||||
|
||||
static osUtils::childProcess *s_renderProc = NULL;
|
||||
static RenderServer *s_renderThread = NULL;
|
||||
static int s_renderPort = 0;
|
||||
@@ -39,6 +43,32 @@ static IOStream *createRenderThread(int p_stream_buffer_size,
|
||||
#define RENDER_API_USE_THREAD
|
||||
//#endif
|
||||
|
||||
bool initLibrary(void)
|
||||
{
|
||||
//
|
||||
// Load EGL Plugin
|
||||
//
|
||||
if (!init_egl_dispatch()) {
|
||||
// Failed to load EGL
|
||||
printf("Failed to init_egl_dispatch\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// Load GLES Plugin
|
||||
//
|
||||
if (!init_gl_dispatch()) {
|
||||
// Failed to load GLES
|
||||
ERR("Failed to init_gl_dispatch\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
/* failure to init the GLES2 dispatch table is not fatal */
|
||||
init_gl2_dispatch();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool initOpenGLRenderer(int width, int height, int portNum)
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user