am deebe1a6: Merge "opengl renderer: windows runtime fix"

* commit 'deebe1a62be61b11a26dd6634f8969151bb4f8c3':
  opengl renderer: windows runtime fix
This commit is contained in:
David Turner
2011-07-06 07:30:41 -07:00
committed by Android Git Automerger
4 changed files with 27 additions and 1 deletions

View File

@@ -21,6 +21,10 @@ LOCAL_C_INCLUDES := $(emulatorOpengl)/host/include \
$(emulatorOpengl)/shared/OpenglCodecCommon \
$(emulatorOpengl)/host/libs/libOpenglRender
ifeq ($(HOST_OS),windows)
LOCAL_LDLIBS += -lws2_32
endif
LOCAL_SHARED_LIBRARIES := libOpenglRender \
libGLESv1_dec \
libGLESv2_dec \

View File

@@ -22,6 +22,9 @@
#include <sys/types.h>
#include <unistd.h>
#include <codec_defs.h>
#ifdef _WIN32
#include <winsock2.h>
#endif
static void printUsage(const char *progName)
@@ -92,6 +95,13 @@ int main(int argc, char *argv[])
printf("renderer pid %d , press any key to continue...\n", getpid());
getchar();
#ifdef _WIN32
WSADATA wsaData;
int rc = WSAStartup( MAKEWORD(2,2), &wsaData);
if (rc != 0) {
printf( "could not initialize Winsock\n" );
}
#endif
//
// initialize Framebuffer
//

View File

@@ -16,6 +16,10 @@ SDL_LDLIBS := $(filter-out %.a %.lib,$(shell $(SDL_CONFIG) --static-libs))
LOCAL_CFLAGS += $(SDL_CFLAGS) -g -O0
LOCAL_LDLIBS += $(SDL_LDLIBS)
ifeq ($(HOST_OS),windows)
LOCAL_LDLIBS += -lws2_32
endif
LOCAL_STATIC_LIBRARIES += libSDL libSDLmain
$(call emugl-end-module)

View File

@@ -21,6 +21,7 @@
#include "libOpenglRender/render_api.h"
#ifdef _WIN32
#include <winsock2.h>
int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
#else
int main(int argc, char *argv[])
@@ -50,8 +51,15 @@ int main(int argc, char *argv[])
SDL_GetWMInfo(&wminfo);
#ifdef _WIN32
windowId = wminfo.window;
#else
WSADATA wsaData;
int rc = WSAStartup( MAKEWORD(2,2), &wsaData);
if (rc != 0) {
printf( "could not initialize Winsock\n" );
}
#elif __linux__
windowId = wminfo.info.x11.window;
#elif __APPLE__
windowId = wminfo.nsWindowPtr;
#endif
printf("initializing renderer process\n");