浏览代码

SDL: Fixed clang warnings.

bkaradzic 12 年之前
父节点
当前提交
8c27ed5962
共有 4 个文件被更改,包括 12 次插入9 次删除
  1. 5 7
      examples/common/entry/entry_p.h
  2. 2 2
      examples/common/entry/entry_sdl.cpp
  3. 4 0
      premake/example-common.lua
  4. 1 0
      premake/premake4.lua

+ 5 - 7
examples/common/entry/entry_p.h

@@ -10,13 +10,11 @@
 
 
 #include "entry.h"
 #include "entry.h"
 
 
-#ifndef ENTRY_CONFIG_USE_SDL
-#	define ENTRY_CONFIG_USE_SDL 0 //BX_PLATFORM_OSX
-#endif // ENTRY_CONFIG_USE_SDL
-
-#ifndef ENTRY_CONFIG_USE_NATIVE
-#	define ENTRY_CONFIG_USE_NATIVE !ENTRY_CONFIG_USE_SDL
-#endif // ENTRY_CONFIG_USE_NATIVE
+#if !defined(ENTRY_CONFIG_USE_SDL) && \
+	!defined(ENTRY_CONFIG_USE_NATIVE)
+#	define ENTRY_CONFIG_USE_SDL 0
+#	define ENTRY_CONFIG_USE_NATIVE 1
+#endif // ...
 
 
 #if !defined(ENTRY_DEFAULT_WIDTH) && !defined(ENTRY_DEFAULT_HEIGHT)
 #if !defined(ENTRY_DEFAULT_WIDTH) && !defined(ENTRY_DEFAULT_HEIGHT)
 #	define ENTRY_DEFAULT_WIDTH  1280
 #	define ENTRY_DEFAULT_WIDTH  1280

+ 2 - 2
examples/common/entry/entry_sdl.cpp

@@ -338,8 +338,8 @@ namespace entry
 		SDL_Event event;
 		SDL_Event event;
 		SDL_UserEvent& uev = event.user;
 		SDL_UserEvent& uev = event.user;
 		uev.type = SDL_USER_SET_WINDOW_SIZE;
 		uev.type = SDL_USER_SET_WINDOW_SIZE;
-		uev.data1 = (void*)_width;
-		uev.data2 = (void*)_height;
+		uev.data1 = reinterpret_cast<void*>(_width);
+		uev.data2 = reinterpret_cast<void*>(_height);
 		SDL_PushEvent(&event);
 		SDL_PushEvent(&event);
 	}
 	}
 
 

+ 4 - 0
premake/example-common.lua

@@ -13,6 +13,10 @@ project ("example-common")
 		BGFX_DIR .. "3rdparty",
 		BGFX_DIR .. "3rdparty",
 	}
 	}
 
 
+	defines {
+--		"ENTRY_CONFIG_USE_SDL=1",
+	}
+
 	files {
 	files {
 		BGFX_DIR .. "examples/common/**.cpp",
 		BGFX_DIR .. "examples/common/**.cpp",
 		BGFX_DIR .. "examples/common/**.h",
 		BGFX_DIR .. "examples/common/**.h",

+ 1 - 0
premake/premake4.lua

@@ -117,6 +117,7 @@ function exampleProject(_name, _uuid)
 		links {
 		links {
 			"Cocoa.framework",
 			"Cocoa.framework",
 			"OpenGL.framework",
 			"OpenGL.framework",
+--			"SDL2",
 		}
 		}
 
 
 	configuration { "ios*" }
 	configuration { "ios*" }