ソースを参照

Fixed Raspberry Pi error (could open Window).

Yao Wei Tjong 姚伟忠 12 年 前
コミット
6cf19fa9ce

+ 1 - 1
Source/ThirdParty/SDL/CMakeLists.txt

@@ -50,7 +50,7 @@ elseif (ANDROID)
 else ()
     # On Linux, make sure development libraries exist, and use their include file directories  
     if (RASPI)
-        file (GLOB VIDEO_DRIVER_C_FILES src/video/raspberry/*.c)
+        file (GLOB VIDEO_DRIVER_C_FILES src/video/raspberry/*.c src/input/evdev/*.c)
     else ()
         find_package (OpenGL REQUIRED)
         include_directories (${OpenGL_INCLUDE_DIRS})

+ 6 - 2
Source/ThirdParty/SDL/include/SDL_config_linux.h

@@ -36,7 +36,7 @@
 
 /* Make sure that this isn't included by Visual C++ */
 #ifdef _MSC_VER
-#error You should run hg revert SDL_config.h 
+#error You should run hg revert SDL_config.h
 #endif
 
 /* C language features */
@@ -277,13 +277,17 @@
 // Urho3D: Use OpenGL ES 2 implementation from Broadcom VideoCore for Raspberry Pi
 #ifdef RASPI
 #undef SDL_VIDEO_DRIVER_X11			/* No X */
-#define SDL_VIDEO_DRIVER_RASPI 1
+#define SDL_VIDEO_DRIVER_RPI 1
 
 /* Enable OpenGL ES 2 */
 #define SDL_VIDEO_OPENGL_ES2 1
+#define SDL_VIDEO_OPENGL_EGL 1
 #define SDL_VIDEO_RENDER_OGL_ES 1
 #define SDL_VIDEO_RENDER_OGL_ES2 1
 
+/* Linux keyboard */
+#define SDL_INPUT_LINUXKD 1
+
 #else
 
 /* #undef SDL_VIDEO_RENDER_D3D */

+ 6 - 3
Source/ThirdParty/SDL/src/video/raspberry/SDL_rpivideo.h

@@ -19,13 +19,16 @@
   3. This notice may not be removed or altered from any source distribution.
 */
 
+// Modified by Yao Wei Tjong for Urho3D
+
 #ifndef __SDL_RPIVIDEO_H__
 #define __SDL_RPIVIDEO_H__
 
 #include "SDL_config.h"
 #include "../SDL_sysvideo.h"
 
-#include "bcm_host.h"
+// Urho3D
+//#include "bcm_host.h"
 #include "GLES/gl.h"
 #include "EGL/egl.h"
 #include "EGL/eglext.h"
@@ -45,9 +48,9 @@ typedef struct SDL_DisplayData
 typedef struct SDL_WindowData
 {
     EGL_DISPMANX_WINDOW_T dispman_window;
-#if SDL_VIDEO_OPENGL_EGL  
+#if SDL_VIDEO_OPENGL_EGL
     EGLSurface egl_surface;
-#endif    
+#endif
 } SDL_WindowData;
 
 #define SDL_RPI_VIDEOLAYER 10000 /* High enough so to occlude everything */