|
|
@@ -6,15 +6,26 @@ class Texture2D : public Texture
|
|
|
{
|
|
|
Texture2D();
|
|
|
~Texture2D();
|
|
|
-
|
|
|
+
|
|
|
bool SetSize(int width, int height, unsigned format, TextureUsage usage = TEXTURE_STATIC);
|
|
|
-
|
|
|
+ tolua_outside bool Texture2DLoad @ Load(Image* image, bool useAlpha = false);
|
|
|
+
|
|
|
RenderSurface* GetRenderSurface() const;
|
|
|
|
|
|
tolua_readonly tolua_property__get_set RenderSurface* renderSurface;
|
|
|
};
|
|
|
|
|
|
${
|
|
|
+static bool Texture2DLoad(Texture2D* texture, Image* image, bool useAlpha)
|
|
|
+{
|
|
|
+ SharedPtr<Image> imagePtr(image);
|
|
|
+ bool ret = texture->Load(imagePtr, useAlpha);
|
|
|
+ // Need to safely detach the object from the shared pointer so that the Lua script can manually
|
|
|
+ // delete the object once done
|
|
|
+ imagePtr.Detach();
|
|
|
+ return ret;
|
|
|
+}
|
|
|
+
|
|
|
#define TOLUA_DISABLE_tolua_GraphicsLuaAPI_Texture2D_new00
|
|
|
static int tolua_GraphicsLuaAPI_Texture2D_new00(lua_State* tolua_S)
|
|
|
{
|