Browse Source

Declare the template specialization in the header to keep MSVC happy.

Yao Wei Tjong 姚伟忠 9 years ago
parent
commit
8d76730f5c
2 changed files with 9 additions and 0 deletions
  1. 2 0
      Source/Urho3D/LuaScript/ToluaUtils.cpp
  2. 7 0
      Source/Urho3D/LuaScript/ToluaUtils.h

+ 2 - 0
Source/Urho3D/LuaScript/ToluaUtils.cpp

@@ -22,8 +22,10 @@
 
 #include "../Precompiled.h"
 
+#ifndef _WIN32
 #include "../Graphics/IndexBuffer.h"
 #include "../Graphics/VertexBuffer.h"
+#endif
 #include "../IO/VectorBuffer.h"
 
 #include <toluapp/tolua++.h>

+ 7 - 0
Source/Urho3D/LuaScript/ToluaUtils.h

@@ -23,6 +23,10 @@
 #pragma once
 
 #include "../Core/Context.h"
+#ifdef _WIN32
+#include "../Graphics/IndexBuffer.h"
+#include "../Graphics/VertexBuffer.h"
+#endif
 
 struct lua_State;
 
@@ -183,6 +187,9 @@ template <> int ToluaPushVector<String>(lua_State* L, void* data, const char* ty
 template <> int ToluaIsPODVector<bool>(double /*overload*/, lua_State* L, int lo, const char* type, int def, tolua_Error* err);
 template <> void* ToluaToPODVector<bool>(double /*overload*/, lua_State* L, int narg, void* def);
 template <> int ToluaPushPODVector<bool>(double /*overload*/, lua_State* L, void* data, const char* type);
+
+template <> void* ToluaToVector<SharedPtr<IndexBuffer> >(lua_State* L, int narg, void* def);
+template <> void* ToluaToVector<SharedPtr<VertexBuffer> >(lua_State* L, int narg, void* def);
 #endif
 
 /// Convert object at the given index and store it in Variant. This function is not thread-safe.