From 3a064ab5391e249d680f76d02a4c1b4c25cf0c72 Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Fri, 5 Aug 2011 16:28:01 +0200 Subject: [PATCH] emulator: opengl: Make render_api.h C-compatible This change modifies the function declarations under developement/tools/emulator/opengl/host/include/render_api.h to make them callable from C. This is preparation work for integrating the rendering library into the emulator. The plan is to dlopen() the library dynamically and using non-mangled function names makes using dlsym() both easier and more portable. Change-Id: I34656ea4618dbb989fb6ff78df43e9bfb38a7799 --- .../host/include/libOpenglRender/render_api.h | 17 +++++++---------- .../host/libs/libOpenglRender/render_api.cpp | 3 +++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tools/emulator/opengl/host/include/libOpenglRender/render_api.h b/tools/emulator/opengl/host/include/libOpenglRender/render_api.h index fa563164a..324ae1fbf 100644 --- a/tools/emulator/opengl/host/include/libOpenglRender/render_api.h +++ b/tools/emulator/opengl/host/include/libOpenglRender/render_api.h @@ -16,7 +16,10 @@ #ifndef _OPENGL_RENDERER_RENDER_API_H #define _OPENGL_RENDERER_RENDER_API_H -#include "IOStream.h" +#ifdef __cplusplus +extern "C" { +#endif + #include "render_api_platform_types.h" // @@ -41,14 +44,8 @@ bool initOpenGLRenderer(FBNativeWindowType window, // bool stopOpenGLRenderer(); -// -// createRenderThread - opens a new communication channel to the renderer -// process and creates new rendering thread. -// returns a pointer to IOStream through which command tokens are being sent -// to the render thread for execution. 'p_stream_buffer_size' is the internal -// stream buffer size. -// The thread is destroyed when deleting the IOStream object. -// -IOStream *createRenderThread(int p_stream_buffer_size); +#ifdef __cplusplus +} +#endif #endif diff --git a/tools/emulator/opengl/host/libs/libOpenglRender/render_api.cpp b/tools/emulator/opengl/host/libs/libOpenglRender/render_api.cpp index a9237af31..c4719816d 100644 --- a/tools/emulator/opengl/host/libs/libOpenglRender/render_api.cpp +++ b/tools/emulator/opengl/host/libs/libOpenglRender/render_api.cpp @@ -14,6 +14,7 @@ * limitations under the License. */ #include "libOpenglRender/render_api.h" +#include "IOStream.h" #include "FrameBuffer.h" #include "RenderServer.h" #include "osProcess.h" @@ -23,6 +24,8 @@ static osUtils::childProcess *s_renderProc = NULL; static RenderServer *s_renderThread = NULL; static int s_renderPort = 0; +static IOStream *createRenderThread(int p_stream_buffer_size); + #ifdef __APPLE__ #define RENDER_API_USE_THREAD #endif