mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Abstracted lua bindings for general Texture methods into wrap_Texture.cpp
This commit is contained in:
@@ -79,80 +79,6 @@ int w_Canvas_getPixel(lua_State * L)
|
||||
return 4;
|
||||
}
|
||||
|
||||
int w_Canvas_setFilter(lua_State *L)
|
||||
{
|
||||
Canvas *canvas = luax_checkcanvas(L, 1);
|
||||
|
||||
Texture::Filter f;
|
||||
|
||||
const char *minstr = luaL_checkstring(L, 2);
|
||||
const char *magstr = luaL_optstring(L, 3, minstr);
|
||||
|
||||
if (!Texture::getConstant(minstr, f.min))
|
||||
return luaL_error(L, "Invalid filter mode: %s", minstr);
|
||||
if (!Texture::getConstant(magstr, f.mag))
|
||||
return luaL_error(L, "Invalid filter mode: %s", magstr);
|
||||
|
||||
f.anisotropy = (float) luaL_optnumber(L, 4, 1.0);
|
||||
|
||||
canvas->setFilter(f);
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
int w_Canvas_getFilter(lua_State *L)
|
||||
{
|
||||
Canvas *canvas = luax_checkcanvas(L, 1);
|
||||
const Texture::Filter f = canvas->getFilter();
|
||||
|
||||
const char *minstr;
|
||||
const char *magstr;
|
||||
Texture::getConstant(f.min, minstr);
|
||||
Texture::getConstant(f.mag, magstr);
|
||||
|
||||
lua_pushstring(L, minstr);
|
||||
lua_pushstring(L, magstr);
|
||||
lua_pushnumber(L, f.anisotropy);
|
||||
|
||||
return 3;
|
||||
}
|
||||
|
||||
int w_Canvas_setWrap(lua_State *L)
|
||||
{
|
||||
Canvas *canvas = luax_checkcanvas(L, 1);
|
||||
|
||||
Texture::Wrap w;
|
||||
|
||||
const char *sstr = luaL_checkstring(L, 2);
|
||||
const char *tstr = luaL_optstring(L, 3, sstr);
|
||||
|
||||
if (!Texture::getConstant(sstr, w.s))
|
||||
return luaL_error(L, "Invalid wrap mode: %s", sstr);
|
||||
if (!Texture::getConstant(tstr, w.t))
|
||||
return luaL_error(L, "Invalid wrap mode, %s", tstr);
|
||||
|
||||
canvas->setWrap(w);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int w_Canvas_getWrap(lua_State *L)
|
||||
{
|
||||
Canvas *canvas = luax_checkcanvas(L, 1);
|
||||
const Texture::Wrap w = canvas->getWrap();
|
||||
|
||||
const char *wrap_s;
|
||||
const char *wrap_t;
|
||||
Texture::getConstant(w.s, wrap_s);
|
||||
Texture::getConstant(w.t, wrap_t);
|
||||
|
||||
lua_pushstring(L, wrap_s);
|
||||
lua_pushstring(L, wrap_t);
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
||||
int w_Canvas_clear(lua_State *L)
|
||||
{
|
||||
Canvas *canvas = luax_checkcanvas(L, 1);
|
||||
@@ -185,28 +111,6 @@ int w_Canvas_clear(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int w_Canvas_getWidth(lua_State *L)
|
||||
{
|
||||
Canvas *canvas = luax_checkcanvas(L, 1);
|
||||
lua_pushnumber(L, canvas->getWidth());
|
||||
return 1;
|
||||
}
|
||||
|
||||
int w_Canvas_getHeight(lua_State *L)
|
||||
{
|
||||
Canvas *canvas = luax_checkcanvas(L, 1);
|
||||
lua_pushnumber(L, canvas->getHeight());
|
||||
return 1;
|
||||
}
|
||||
|
||||
int w_Canvas_getDimensions(lua_State *L)
|
||||
{
|
||||
Canvas *canvas = luax_checkcanvas(L, 1);
|
||||
lua_pushnumber(L, canvas->getWidth());
|
||||
lua_pushnumber(L, canvas->getHeight());
|
||||
return 2;
|
||||
}
|
||||
|
||||
int w_Canvas_getType(lua_State *L)
|
||||
{
|
||||
Canvas *canvas = luax_checkcanvas(L, 1);
|
||||
@@ -219,17 +123,19 @@ int w_Canvas_getType(lua_State *L)
|
||||
|
||||
static const luaL_Reg functions[] =
|
||||
{
|
||||
// From wrap_Texture.
|
||||
{ "getWidth", w_Texture_getWidth },
|
||||
{ "getHeight", w_Texture_getHeight },
|
||||
{ "getDimensions", w_Texture_getDimensions },
|
||||
{ "setFilter", w_Texture_setFilter },
|
||||
{ "getFilter", w_Texture_getFilter },
|
||||
{ "setWrap", w_Texture_setWrap },
|
||||
{ "getWrap", w_Texture_getWrap },
|
||||
|
||||
{ "renderTo", w_Canvas_renderTo },
|
||||
{ "getImageData", w_Canvas_getImageData },
|
||||
{ "getPixel", w_Canvas_getPixel },
|
||||
{ "setFilter", w_Canvas_setFilter },
|
||||
{ "getFilter", w_Canvas_getFilter },
|
||||
{ "setWrap", w_Canvas_setWrap },
|
||||
{ "getWrap", w_Canvas_getWrap },
|
||||
{ "clear", w_Canvas_clear },
|
||||
{ "getWidth", w_Canvas_getWidth },
|
||||
{ "getHeight", w_Canvas_getHeight },
|
||||
{ "getDimensions", w_Canvas_getDimensions },
|
||||
{ "getType", w_Canvas_getType },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
// LOVE
|
||||
#include "common/runtime.h"
|
||||
#include "Canvas.h"
|
||||
#include "wrap_Texture.h"
|
||||
|
||||
namespace love
|
||||
{
|
||||
@@ -37,14 +38,7 @@ Canvas *luax_checkcanvas(lua_State *L, int idx);
|
||||
int w_Canvas_renderTo(lua_State *L);
|
||||
int w_Canvas_getImageData(lua_State *L);
|
||||
int w_Canvas_getPixel(lua_State * L);
|
||||
int w_Canvas_setFilter(lua_State *L);
|
||||
int w_Canvas_getFilter(lua_State *L);
|
||||
int w_Canvas_setWrap(lua_State *L);
|
||||
int w_Canvas_getWrap(lua_State *L);
|
||||
int w_Canvas_clear(lua_State *L);
|
||||
int w_Canvas_getWidth(lua_State *L);
|
||||
int w_Canvas_getHeight(lua_State *L);
|
||||
int w_Canvas_getDimensions(lua_State *L);
|
||||
int w_Canvas_getType(lua_State *L);
|
||||
extern "C" int luaopen_canvas(lua_State *L);
|
||||
|
||||
|
||||
@@ -277,7 +277,7 @@ int w_newImageFont(lua_State *L)
|
||||
|
||||
int w_newSpriteBatch(lua_State *L)
|
||||
{
|
||||
Texture *texture = luax_checktype<Texture>(L, 1, "Texture", GRAPHICS_TEXTURE_T);
|
||||
Texture *texture = luax_checktexture(L, 1);
|
||||
int size = luaL_optint(L, 2, 1000);
|
||||
SpriteBatch::UsageHint usage = SpriteBatch::USAGE_DYNAMIC;
|
||||
if (lua_gettop(L) > 2)
|
||||
@@ -296,7 +296,7 @@ int w_newSpriteBatch(lua_State *L)
|
||||
|
||||
int w_newParticleSystem(lua_State *L)
|
||||
{
|
||||
Texture *texture = luax_checktype<Texture>(L, 1, "Texture", GRAPHICS_TEXTURE_T);
|
||||
Texture *texture = luax_checktexture(L, 1);
|
||||
lua_Number size = luaL_optnumber(L, 2, 1000);
|
||||
ParticleSystem *t = 0;
|
||||
if (size < 1.0 || size > ParticleSystem::MAX_PARTICLES)
|
||||
@@ -437,7 +437,7 @@ int w_newMesh(lua_State *L)
|
||||
// Second argument: optional texture.
|
||||
Texture *tex = nullptr;
|
||||
if (!lua_isnoneornil(L, 2))
|
||||
tex = luax_checktype<Texture>(L, 2, "Texture", GRAPHICS_TEXTURE_T);
|
||||
tex = luax_checktexture(L, 2);
|
||||
|
||||
// Third argument: optional draw mode.
|
||||
const char *str = 0;
|
||||
@@ -1011,7 +1011,7 @@ int w_draw(lua_State *L)
|
||||
|
||||
if (luax_istype(L, 2, GRAPHICS_QUAD_T))
|
||||
{
|
||||
texture = luax_checktype<Texture>(L, 1, "Texture", GRAPHICS_TEXTURE_T);
|
||||
texture = luax_checktexture(L, 1);
|
||||
quad = luax_totype<Quad>(L, 2, "Quad", GRAPHICS_QUAD_T);
|
||||
startidx = 3;
|
||||
}
|
||||
|
||||
@@ -33,61 +33,6 @@ Image *luax_checkimage(lua_State *L, int idx)
|
||||
return luax_checktype<Image>(L, idx, "Image", GRAPHICS_IMAGE_T);
|
||||
}
|
||||
|
||||
int w_Image_getWidth(lua_State *L)
|
||||
{
|
||||
Image *t = luax_checkimage(L, 1);
|
||||
lua_pushnumber(L, t->getWidth());
|
||||
return 1;
|
||||
}
|
||||
|
||||
int w_Image_getHeight(lua_State *L)
|
||||
{
|
||||
Image *t = luax_checkimage(L, 1);
|
||||
lua_pushnumber(L, t->getHeight());
|
||||
return 1;
|
||||
}
|
||||
|
||||
int w_Image_getDimensions(lua_State *L)
|
||||
{
|
||||
Image *t = luax_checkimage(L, 1);
|
||||
lua_pushnumber(L, t->getWidth());
|
||||
lua_pushnumber(L, t->getHeight());
|
||||
return 2;
|
||||
}
|
||||
|
||||
int w_Image_setFilter(lua_State *L)
|
||||
{
|
||||
Image *t = luax_checkimage(L, 1);
|
||||
Texture::Filter f = t->getFilter();
|
||||
|
||||
const char *minstr = luaL_checkstring(L, 2);
|
||||
const char *magstr = luaL_optstring(L, 3, minstr);
|
||||
|
||||
if (!Texture::getConstant(minstr, f.min))
|
||||
return luaL_error(L, "Invalid filter mode: %s", minstr);
|
||||
if (!Texture::getConstant(magstr, f.mag))
|
||||
return luaL_error(L, "Invalid filter mode: %s", magstr);
|
||||
|
||||
f.anisotropy = (float) luaL_optnumber(L, 4, 1.0);
|
||||
|
||||
EXCEPT_GUARD(t->setFilter(f);)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int w_Image_getFilter(lua_State *L)
|
||||
{
|
||||
Image *t = luax_checkimage(L, 1);
|
||||
const Texture::Filter f = t->getFilter();
|
||||
const char *minstr;
|
||||
const char *magstr;
|
||||
Texture::getConstant(f.min, minstr);
|
||||
Texture::getConstant(f.mag, magstr);
|
||||
lua_pushstring(L, minstr);
|
||||
lua_pushstring(L, magstr);
|
||||
lua_pushnumber(L, f.anisotropy);
|
||||
return 3;
|
||||
}
|
||||
|
||||
int w_Image_setMipmapFilter(lua_State *L)
|
||||
{
|
||||
Image *t = luax_checkimage(L, 1);
|
||||
@@ -126,37 +71,6 @@ int w_Image_getMipmapFilter(lua_State *L)
|
||||
return 2;
|
||||
}
|
||||
|
||||
int w_Image_setWrap(lua_State *L)
|
||||
{
|
||||
Image *i = luax_checkimage(L, 1);
|
||||
|
||||
Texture::Wrap w;
|
||||
|
||||
const char *sstr = luaL_checkstring(L, 2);
|
||||
const char *tstr = luaL_optstring(L, 3, sstr);
|
||||
|
||||
if (!Texture::getConstant(sstr, w.s))
|
||||
return luaL_error(L, "Invalid wrap mode: %s", sstr);
|
||||
if (!Texture::getConstant(tstr, w.t))
|
||||
return luaL_error(L, "Invalid wrap mode, %s", tstr);
|
||||
|
||||
i->setWrap(w);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int w_Image_getWrap(lua_State *L)
|
||||
{
|
||||
Image *i = luax_checkimage(L, 1);
|
||||
const Texture::Wrap w = i->getWrap();
|
||||
const char *sstr;
|
||||
const char *tstr;
|
||||
Texture::getConstant(w.s, sstr);
|
||||
Texture::getConstant(w.t, tstr);
|
||||
lua_pushstring(L, sstr);
|
||||
lua_pushstring(L, tstr);
|
||||
return 2;
|
||||
}
|
||||
|
||||
int w_Image_isCompressed(lua_State *L)
|
||||
{
|
||||
Image *i = luax_checkimage(L, 1);
|
||||
@@ -203,13 +117,15 @@ int w_Image_getData(lua_State *L)
|
||||
|
||||
static const luaL_Reg functions[] =
|
||||
{
|
||||
{ "getWidth", w_Image_getWidth },
|
||||
{ "getHeight", w_Image_getHeight },
|
||||
{ "getDimensions", w_Image_getDimensions },
|
||||
{ "setFilter", w_Image_setFilter },
|
||||
{ "getFilter", w_Image_getFilter },
|
||||
{ "setWrap", w_Image_setWrap },
|
||||
{ "getWrap", w_Image_getWrap },
|
||||
// From wrap_Texture.
|
||||
{ "getWidth", w_Texture_getWidth },
|
||||
{ "getHeight", w_Texture_getHeight },
|
||||
{ "getDimensions", w_Texture_getDimensions },
|
||||
{ "setFilter", w_Texture_setFilter },
|
||||
{ "getFilter", w_Texture_getFilter },
|
||||
{ "setWrap", w_Texture_setWrap },
|
||||
{ "getWrap", w_Texture_getWrap },
|
||||
|
||||
{ "setMipmapFilter", w_Image_setMipmapFilter },
|
||||
{ "getMipmapFilter", w_Image_getMipmapFilter },
|
||||
{ "isCompressed", w_Image_isCompressed },
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
// LOVE
|
||||
#include "common/runtime.h"
|
||||
#include "Image.h"
|
||||
#include "wrap_Texture.h"
|
||||
|
||||
namespace love
|
||||
{
|
||||
@@ -33,15 +34,8 @@ namespace opengl
|
||||
{
|
||||
|
||||
Image *luax_checkimage(lua_State *L, int idx);
|
||||
int w_Image_getWidth(lua_State *L);
|
||||
int w_Image_getHeight(lua_State *L);
|
||||
int w_Image_getDimensions(lua_State *L);
|
||||
int w_Image_setFilter(lua_State *L);
|
||||
int w_Image_getFilter(lua_State *L);
|
||||
int w_Image_setMipmapFilter(lua_State *L);
|
||||
int w_Image_getMipmapFilter(lua_State *L);
|
||||
int w_Image_setWrap(lua_State *L);
|
||||
int w_Image_getWrap(lua_State *L);
|
||||
int w_Image_isCompressed(lua_State *L);
|
||||
int w_Image_refresh(lua_State *L);
|
||||
int w_Image_getData(lua_State *L);
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "wrap_Mesh.h"
|
||||
#include "Image.h"
|
||||
#include "Canvas.h"
|
||||
#include "wrap_Texture.h"
|
||||
|
||||
// C++
|
||||
#include <typeinfo>
|
||||
@@ -243,7 +244,7 @@ int w_Mesh_setTexture(lua_State *L)
|
||||
t->setTexture();
|
||||
else
|
||||
{
|
||||
Texture *tex = luax_checktype<Texture>(L, 2, "Texture", GRAPHICS_TEXTURE_T);
|
||||
Texture *tex = luax_checktexture(L, 2);
|
||||
t->setTexture(tex);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
#include "Image.h"
|
||||
#include "Canvas.h"
|
||||
#include "wrap_Texture.h"
|
||||
|
||||
// C
|
||||
#include <cstring>
|
||||
@@ -57,7 +58,7 @@ int w_ParticleSystem_clone(lua_State *L)
|
||||
int w_ParticleSystem_setTexture(lua_State *L)
|
||||
{
|
||||
ParticleSystem *t = luax_checkparticlesystem(L, 1);
|
||||
Texture *tex = luax_checktype<Texture>(L, 2, "Texture", GRAPHICS_TEXTURE_T);
|
||||
Texture *tex = luax_checktexture(L, 2);
|
||||
t->setTexture(tex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -19,8 +19,7 @@
|
||||
**/
|
||||
|
||||
#include "wrap_Shader.h"
|
||||
#include "wrap_Image.h"
|
||||
#include "wrap_Canvas.h"
|
||||
#include "wrap_Texture.h"
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
@@ -257,7 +256,7 @@ int w_Shader_sendTexture(lua_State *L)
|
||||
{
|
||||
Shader *shader = luax_checkshader(L, 1);
|
||||
const char *name = luaL_checkstring(L, 2);
|
||||
Texture *texture = luax_checktype<Texture>(L, 3, "Texture", GRAPHICS_TEXTURE_T);
|
||||
Texture *texture = luax_checktexture(L, 3);
|
||||
|
||||
EXCEPT_GUARD(shader->sendTexture(name, texture);)
|
||||
return 0;
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "wrap_SpriteBatch.h"
|
||||
#include "Image.h"
|
||||
#include "Canvas.h"
|
||||
#include "wrap_Texture.h"
|
||||
|
||||
// C++
|
||||
#include <typeinfo>
|
||||
@@ -134,7 +135,7 @@ int w_SpriteBatch_unbind(lua_State *L)
|
||||
int w_SpriteBatch_setTexture(lua_State *L)
|
||||
{
|
||||
SpriteBatch *t = luax_checkspritebatch(L, 1);
|
||||
Texture *tex = luax_checktype<Texture>(L, 2, "Texture", GRAPHICS_TEXTURE_T);
|
||||
Texture *tex = luax_checktexture(L, 2);
|
||||
t->setTexture(tex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
/**
|
||||
* Copyright (c) 2006-2014 LOVE Development Team
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software
|
||||
* in a product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
**/
|
||||
|
||||
#include "wrap_Texture.h"
|
||||
|
||||
namespace love
|
||||
{
|
||||
namespace graphics
|
||||
{
|
||||
namespace opengl
|
||||
{
|
||||
|
||||
Texture *luax_checktexture(lua_State *L, int idx)
|
||||
{
|
||||
return luax_checktype<Texture>(L, idx, "Texture", GRAPHICS_TEXTURE_T);
|
||||
}
|
||||
|
||||
int w_Texture_getWidth(lua_State *L)
|
||||
{
|
||||
Texture *t = luax_checktexture(L, 1);
|
||||
lua_pushnumber(L, t->getWidth());
|
||||
return 1;
|
||||
}
|
||||
|
||||
int w_Texture_getHeight(lua_State *L)
|
||||
{
|
||||
Texture *t = luax_checktexture(L, 1);
|
||||
lua_pushnumber(L, t->getHeight());
|
||||
return 1;
|
||||
}
|
||||
|
||||
int w_Texture_getDimensions(lua_State *L)
|
||||
{
|
||||
Texture *t = luax_checktexture(L, 1);
|
||||
lua_pushnumber(L, t->getWidth());
|
||||
lua_pushnumber(L, t->getHeight());
|
||||
return 2;
|
||||
}
|
||||
|
||||
int w_Texture_setFilter(lua_State *L)
|
||||
{
|
||||
Texture *t = luax_checktexture(L, 1);
|
||||
Texture::Filter f = t->getFilter();
|
||||
|
||||
const char *minstr = luaL_checkstring(L, 2);
|
||||
const char *magstr = luaL_optstring(L, 3, minstr);
|
||||
|
||||
if (!Texture::getConstant(minstr, f.min))
|
||||
return luaL_error(L, "Invalid filter mode: %s", minstr);
|
||||
if (!Texture::getConstant(magstr, f.mag))
|
||||
return luaL_error(L, "Invalid filter mode: %s", magstr);
|
||||
|
||||
f.anisotropy = (float) luaL_optnumber(L, 4, 1.0);
|
||||
|
||||
EXCEPT_GUARD(t->setFilter(f);)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int w_Texture_getFilter(lua_State *L)
|
||||
{
|
||||
Texture *t = luax_checktexture(L, 1);
|
||||
const Texture::Filter f = t->getFilter();
|
||||
|
||||
const char *minstr = nullptr;
|
||||
const char *magstr = nullptr;
|
||||
|
||||
if (!Texture::getConstant(f.min, minstr))
|
||||
return luaL_error(L, "Unknown filter mode.");
|
||||
if (!Texture::getConstant(f.mag, magstr))
|
||||
return luaL_error(L, "Unknown filter mode.");
|
||||
|
||||
lua_pushstring(L, minstr);
|
||||
lua_pushstring(L, magstr);
|
||||
lua_pushnumber(L, f.anisotropy);
|
||||
return 3;
|
||||
}
|
||||
|
||||
int w_Texture_setWrap(lua_State *L)
|
||||
{
|
||||
Texture *t = luax_checktexture(L, 1);
|
||||
Texture::Wrap w;
|
||||
|
||||
const char *sstr = luaL_checkstring(L, 2);
|
||||
const char *tstr = luaL_optstring(L, 3, sstr);
|
||||
|
||||
if (!Texture::getConstant(sstr, w.s))
|
||||
return luaL_error(L, "Invalid wrap mode: %s", sstr);
|
||||
if (!Texture::getConstant(tstr, w.t))
|
||||
return luaL_error(L, "Invalid wrap mode, %s", tstr);
|
||||
|
||||
t->setWrap(w);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int w_Texture_getWrap(lua_State *L)
|
||||
{
|
||||
Texture *t = luax_checktexture(L, 1);
|
||||
const Texture::Wrap w = t->getWrap();
|
||||
|
||||
const char *sstr = nullptr;
|
||||
const char *tstr = nullptr;
|
||||
|
||||
if (!Texture::getConstant(w.s, sstr))
|
||||
return luaL_error(L, "Unknown wrap mode.");
|
||||
if (!Texture::getConstant(w.t, tstr))
|
||||
return luaL_error(L, "Unknown wrap mode.");
|
||||
|
||||
lua_pushstring(L, sstr);
|
||||
lua_pushstring(L, tstr);
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
||||
} // opengl
|
||||
} // graphics
|
||||
} // love
|
||||
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* Copyright (c) 2006-2014 LOVE Development Team
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software
|
||||
* in a product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
**/
|
||||
|
||||
#ifndef LOVE_GRAPHICS_OPENGL_WRAP_TEXTURE_H
|
||||
#define LOVE_GRAPHICS_OPENGL_WRAP_TEXTURE_H
|
||||
|
||||
#include "Texture.h"
|
||||
#include "common/runtime.h"
|
||||
|
||||
namespace love
|
||||
{
|
||||
namespace graphics
|
||||
{
|
||||
namespace opengl
|
||||
{
|
||||
|
||||
Texture *luax_checktexture(lua_State *L, int idx);
|
||||
int w_Texture_getWidth(lua_State *L);
|
||||
int w_Texture_getHeight(lua_State *L);
|
||||
int w_Texture_getDimensions(lua_State *L);
|
||||
int w_Texture_setFilter(lua_State *L);
|
||||
int w_Texture_getFilter(lua_State *L);
|
||||
int w_Texture_setWrap(lua_State *L);
|
||||
int w_Texture_getWrap(lua_State *L);
|
||||
|
||||
} // opengl
|
||||
} // graphics
|
||||
} // love
|
||||
|
||||
#endif // LOVE_GRAPHICS_OPENGL_WRAP_TEXTURE_H
|
||||
Reference in New Issue
Block a user