opengl renderer: windows runtime fix
Need to initialize networking by calling WSAStartup in the renderer process.
This commit is contained in:
committed by
Guy Zadickario
parent
950192dbe3
commit
31580f42b1
@@ -21,6 +21,10 @@ LOCAL_C_INCLUDES := $(emulatorOpengl)/host/include \
|
|||||||
$(emulatorOpengl)/shared/OpenglCodecCommon \
|
$(emulatorOpengl)/shared/OpenglCodecCommon \
|
||||||
$(emulatorOpengl)/host/libs/libOpenglRender
|
$(emulatorOpengl)/host/libs/libOpenglRender
|
||||||
|
|
||||||
|
ifeq ($(HOST_OS),windows)
|
||||||
|
LOCAL_LDLIBS += -lws2_32
|
||||||
|
endif
|
||||||
|
|
||||||
LOCAL_SHARED_LIBRARIES := libOpenglRender \
|
LOCAL_SHARED_LIBRARIES := libOpenglRender \
|
||||||
libGLESv1_dec \
|
libGLESv1_dec \
|
||||||
libGLESv2_dec \
|
libGLESv2_dec \
|
||||||
|
|||||||
@@ -22,6 +22,9 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <codec_defs.h>
|
#include <codec_defs.h>
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <winsock2.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
static void printUsage(const char *progName)
|
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());
|
printf("renderer pid %d , press any key to continue...\n", getpid());
|
||||||
getchar();
|
getchar();
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
WSADATA wsaData;
|
||||||
|
int rc = WSAStartup( MAKEWORD(2,2), &wsaData);
|
||||||
|
if (rc != 0) {
|
||||||
|
printf( "could not initialize Winsock\n" );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
//
|
//
|
||||||
// initialize Framebuffer
|
// initialize Framebuffer
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -16,6 +16,10 @@ SDL_LDLIBS := $(filter-out %.a %.lib,$(shell $(SDL_CONFIG) --static-libs))
|
|||||||
LOCAL_CFLAGS += $(SDL_CFLAGS) -g -O0
|
LOCAL_CFLAGS += $(SDL_CFLAGS) -g -O0
|
||||||
LOCAL_LDLIBS += $(SDL_LDLIBS)
|
LOCAL_LDLIBS += $(SDL_LDLIBS)
|
||||||
|
|
||||||
|
ifeq ($(HOST_OS),windows)
|
||||||
|
LOCAL_LDLIBS += -lws2_32
|
||||||
|
endif
|
||||||
|
|
||||||
LOCAL_STATIC_LIBRARIES += libSDL libSDLmain
|
LOCAL_STATIC_LIBRARIES += libSDL libSDLmain
|
||||||
|
|
||||||
$(call emugl-end-module)
|
$(call emugl-end-module)
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
#include "libOpenglRender/render_api.h"
|
#include "libOpenglRender/render_api.h"
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
#include <winsock2.h>
|
||||||
int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
|
int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
|
||||||
#else
|
#else
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
@@ -50,8 +51,15 @@ int main(int argc, char *argv[])
|
|||||||
SDL_GetWMInfo(&wminfo);
|
SDL_GetWMInfo(&wminfo);
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
windowId = wminfo.window;
|
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;
|
windowId = wminfo.info.x11.window;
|
||||||
|
#elif __APPLE__
|
||||||
|
windowId = wminfo.nsWindowPtr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
printf("initializing renderer process\n");
|
printf("initializing renderer process\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user