mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Imported some of the dynamiccore branch from love-experiments:
- Type names for love's Lua objects are specified as an argument to luax_register_type, rather than being statically defined in an array. - luax_register_type takes a variable number of method array arguments, for registering superclass methods without copying them into the subclass' method array. Also removed most of the header declarations for wrapper functions.
This commit is contained in:
@@ -101,17 +101,8 @@ int w_Canvas_getMSAA(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static const luaL_Reg functions[] =
|
||||
static const luaL_Reg w_Canvas_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 },
|
||||
{ "newImageData", w_Canvas_newImageData },
|
||||
{ "getFormat", w_Canvas_getFormat },
|
||||
@@ -121,7 +112,7 @@ static const luaL_Reg functions[] =
|
||||
|
||||
extern "C" int luaopen_canvas(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, GRAPHICS_CANVAS_ID, functions);
|
||||
return luax_register_type(L, GRAPHICS_CANVAS_ID, "Canvas", w_Texture_functions, w_Canvas_functions, nullptr);
|
||||
}
|
||||
|
||||
} // opengl
|
||||
|
||||
@@ -35,10 +35,6 @@ namespace opengl
|
||||
|
||||
//see Canvas.h
|
||||
Canvas *luax_checkcanvas(lua_State *L, int idx);
|
||||
int w_Canvas_renderTo(lua_State *L);
|
||||
int w_Canvas_newImageData(lua_State *L);
|
||||
int w_Canvas_getFormat(lua_State *L);
|
||||
int w_Canvas_getMSAA(lua_State *L);
|
||||
extern "C" int luaopen_canvas(lua_State *L);
|
||||
|
||||
} // opengl
|
||||
|
||||
@@ -184,7 +184,7 @@ int w_Font_setFallbacks(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const luaL_Reg functions[] =
|
||||
static const luaL_Reg w_Font_functions[] =
|
||||
{
|
||||
{ "getHeight", w_Font_getHeight },
|
||||
{ "getWidth", w_Font_getWidth },
|
||||
@@ -203,7 +203,7 @@ static const luaL_Reg functions[] =
|
||||
|
||||
extern "C" int luaopen_font(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, GRAPHICS_FONT_ID, functions);
|
||||
return luax_register_type(L, GRAPHICS_FONT_ID, "Font", w_Font_functions, nullptr);
|
||||
}
|
||||
|
||||
} // opengl
|
||||
|
||||
@@ -33,18 +33,6 @@ namespace opengl
|
||||
{
|
||||
|
||||
Font *luax_checkfont(lua_State *L, int idx);
|
||||
int w_Font_getHeight(lua_State *L);
|
||||
int w_Font_getWidth(lua_State *L);
|
||||
int w_Font_getWrap(lua_State *L);
|
||||
int w_Font_setLineHeight(lua_State *L);
|
||||
int w_Font_getLineHeight(lua_State *L);
|
||||
int w_Font_setFilter(lua_State *L);
|
||||
int w_Font_getFilter(lua_State *L);
|
||||
int w_Font_getAscent(lua_State *L);
|
||||
int w_Font_getDescent(lua_State *L);
|
||||
int w_Font_getBaseline(lua_State *L);
|
||||
int w_Font_hasGlyphs(lua_State *L);
|
||||
int w_Font_setFallbacks(lua_State *L);
|
||||
extern "C" int luaopen_font(lua_State *L);
|
||||
|
||||
} // opengl
|
||||
|
||||
@@ -1946,9 +1946,16 @@ static const luaL_Reg functions[] =
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
static int luaopen_drawable(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, GRAPHICS_DRAWABLE_ID, "Drawable", nullptr);
|
||||
}
|
||||
|
||||
// Types for this module.
|
||||
static const lua_CFunction types[] =
|
||||
{
|
||||
luaopen_drawable,
|
||||
luaopen_texture,
|
||||
luaopen_font,
|
||||
luaopen_image,
|
||||
luaopen_quad,
|
||||
|
||||
@@ -41,86 +41,6 @@ namespace graphics
|
||||
namespace opengl
|
||||
{
|
||||
|
||||
int w_reset(lua_State *L);
|
||||
int w_clear(lua_State *L);
|
||||
int w_discard(lua_State *L);
|
||||
int w_present(lua_State *L);
|
||||
int w_isCreated(lua_State *L);
|
||||
int w_isActive(lua_State *L);
|
||||
int w_isGammaCorrect(lua_State *L);
|
||||
int w_getWidth(lua_State *L);
|
||||
int w_getHeight(lua_State *L);
|
||||
int w_getDimensions(lua_State *L);
|
||||
int w_setScissor(lua_State *L);
|
||||
int w_intersectScissor(lua_State *L);
|
||||
int w_getScissor(lua_State *L);
|
||||
int w_stencil(lua_State *L);
|
||||
int w_setStencilTest(lua_State *L);
|
||||
int w_getStencilTest(lua_State *L);
|
||||
int w_newImage(lua_State *L);
|
||||
int w_newQuad(lua_State *L);
|
||||
int w_newFont(lua_State *L);
|
||||
int w_newImageFont(lua_State *L);
|
||||
int w_newSpriteBatch(lua_State *L);
|
||||
int w_newParticleSystem(lua_State *L);
|
||||
int w_newCanvas(lua_State *L);
|
||||
int w_newShader(lua_State *L);
|
||||
int w_newMesh(lua_State *L);
|
||||
int w_newText(lua_State *L);
|
||||
int w_setColor(lua_State *L);
|
||||
int w_getColor(lua_State *L);
|
||||
int w_setBackgroundColor(lua_State *L);
|
||||
int w_getBackgroundColor(lua_State *L);
|
||||
int w_setNewFont(lua_State *L);
|
||||
int w_setFont(lua_State *L);
|
||||
int w_getFont(lua_State *L);
|
||||
int w_setColorMask(lua_State *L);
|
||||
int w_getColorMask(lua_State *L);
|
||||
int w_setBlendMode(lua_State *L);
|
||||
int w_getBlendMode(lua_State *L);
|
||||
int w_setDefaultFilter(lua_State *L);
|
||||
int w_getDefaultFilter(lua_State *L);
|
||||
int w_setDefaultMipmapFilter(lua_State *L);
|
||||
int w_getDefaultMipmapFilter(lua_State *L);
|
||||
int w_setLineWidth(lua_State *L);
|
||||
int w_setLineStyle(lua_State *L);
|
||||
int w_setLineJoin(lua_State *L);
|
||||
int w_getLineWidth(lua_State *L);
|
||||
int w_getLineStyle(lua_State *L);
|
||||
int w_getLineJoin(lua_State *L);
|
||||
int w_setPointSize(lua_State *L);
|
||||
int w_getPointSize(lua_State *L);
|
||||
int w_setWireframe(lua_State *L);
|
||||
int w_isWireframe(lua_State *L);
|
||||
int w_newScreenshot(lua_State *L);
|
||||
int w_setCanvas(lua_State *L);
|
||||
int w_getCanvas(lua_State *L);
|
||||
int w_setShader(lua_State *L);
|
||||
int w_getShader(lua_State *L);
|
||||
int w_setDefaultShaderCode(lua_State *L);
|
||||
int w_getSupported(lua_State *L);
|
||||
int w_getCanvasFormats(lua_State *L);
|
||||
int w_getCompressedImageFormats(lua_State *L);
|
||||
int w_getRendererInfo(lua_State *L);
|
||||
int w_getSystemLimits(lua_State *L);
|
||||
int w_getStats(lua_State *L);
|
||||
int w_draw(lua_State *L);
|
||||
int w_print(lua_State *L);
|
||||
int w_printf(lua_State *L);
|
||||
int w_points(lua_State *L);
|
||||
int w_line(lua_State *L);
|
||||
int w_rectangle(lua_State *L);
|
||||
int w_circle(lua_State *L);
|
||||
int w_ellipse(lua_State *L);
|
||||
int w_arc(lua_State *L);
|
||||
int w_polygon(lua_State *L);
|
||||
int w_push(lua_State *L);
|
||||
int w_pop(lua_State *L);
|
||||
int w_rotate(lua_State *L);
|
||||
int w_scale(lua_State *L);
|
||||
int w_translate(lua_State *L);
|
||||
int w_shear(lua_State *L);
|
||||
int w_origin(lua_State *L);
|
||||
extern "C" LOVE_EXPORT int luaopen_love_graphics(lua_State *L);
|
||||
|
||||
} // opengl
|
||||
|
||||
@@ -137,17 +137,8 @@ int w_Image_getFlags(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static const luaL_Reg functions[] =
|
||||
static const luaL_Reg w_Image_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 },
|
||||
|
||||
{ "setMipmapFilter", w_Image_setMipmapFilter },
|
||||
{ "getMipmapFilter", w_Image_getMipmapFilter },
|
||||
{ "isCompressed", w_Image_isCompressed },
|
||||
@@ -159,7 +150,7 @@ static const luaL_Reg functions[] =
|
||||
|
||||
extern "C" int luaopen_image(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, GRAPHICS_IMAGE_ID, functions);
|
||||
return luax_register_type(L, GRAPHICS_IMAGE_ID, "Image", w_Texture_functions, w_Image_functions, nullptr);
|
||||
}
|
||||
|
||||
} // opengl
|
||||
|
||||
@@ -34,12 +34,6 @@ namespace opengl
|
||||
{
|
||||
|
||||
Image *luax_checkimage(lua_State *L, int idx);
|
||||
int w_Image_setMipmapFilter(lua_State *L);
|
||||
int w_Image_getMipmapFilter(lua_State *L);
|
||||
int w_Image_isCompressed(lua_State *L);
|
||||
int w_Image_refresh(lua_State *L);
|
||||
int w_Image_getData(lua_State *L);
|
||||
int w_Image_getFlags(lua_State *L);
|
||||
extern "C" int luaopen_image(lua_State *L);
|
||||
|
||||
} // opengl
|
||||
|
||||
@@ -490,7 +490,7 @@ int w_Mesh_getDrawRange(lua_State *L)
|
||||
return 2;
|
||||
}
|
||||
|
||||
static const luaL_Reg functions[] =
|
||||
static const luaL_Reg w_Mesh_functions[] =
|
||||
{
|
||||
{ "setVertices", w_Mesh_setVertices },
|
||||
{ "setVertex", w_Mesh_setVertex },
|
||||
@@ -516,7 +516,7 @@ static const luaL_Reg functions[] =
|
||||
|
||||
extern "C" int luaopen_mesh(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, GRAPHICS_MESH_ID, functions);
|
||||
return luax_register_type(L, GRAPHICS_MESH_ID, "Mesh", w_Mesh_functions, nullptr);
|
||||
}
|
||||
|
||||
} // opengl
|
||||
|
||||
@@ -36,25 +36,6 @@ char *luax_writeAttributeData(lua_State *L, int startidx, Mesh::DataType type, i
|
||||
const char *luax_readAttributeData(lua_State *L, Mesh::DataType type, int components, const char *data);
|
||||
|
||||
Mesh *luax_checkmesh(lua_State *L, int idx);
|
||||
int w_Mesh_setVertices(lua_State *L);
|
||||
int w_Mesh_setVertex(lua_State *L);
|
||||
int w_Mesh_getVertex(lua_State *L);
|
||||
int w_Mesh_setVertexAttribute(lua_State *L);
|
||||
int w_Mesh_getVertexAttribute(lua_State *L);
|
||||
int w_Mesh_getVertexCount(lua_State *L);
|
||||
int w_Mesh_getVertexFormat(lua_State *L);
|
||||
int w_Mesh_setAttributeEnabled(lua_State *L);
|
||||
int w_Mesh_isAttributeEnabled(lua_State *L);
|
||||
int w_Mesh_attachAttribute(lua_State *L);
|
||||
int w_Mesh_flush(lua_State *L);
|
||||
int w_Mesh_setVertexMap(lua_State *L);
|
||||
int w_Mesh_getVertexMap(lua_State *L);
|
||||
int w_Mesh_setTexture(lua_State *L);
|
||||
int w_Mesh_getTexture(lua_State *L);
|
||||
int w_Mesh_setDrawMode(lua_State *L);
|
||||
int w_Mesh_getDrawMode(lua_State *L);
|
||||
int w_Mesh_setDrawRange(lua_State *L);
|
||||
int w_Mesh_getDrawRange(lua_State *L);
|
||||
extern "C" int luaopen_mesh(lua_State *L);
|
||||
|
||||
} // opengl
|
||||
|
||||
@@ -705,7 +705,7 @@ int w_ParticleSystem_update(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const luaL_Reg functions[] =
|
||||
static const luaL_Reg w_ParticleSystem_functions[] =
|
||||
{
|
||||
{ "clone", w_ParticleSystem_clone },
|
||||
{ "setTexture", w_ParticleSystem_setTexture },
|
||||
@@ -772,7 +772,7 @@ static const luaL_Reg functions[] =
|
||||
|
||||
extern "C" int luaopen_particlesystem(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, GRAPHICS_PARTICLE_SYSTEM_ID, functions);
|
||||
return luax_register_type(L, GRAPHICS_PARTICLE_SYSTEM_ID, "ParticleSystem", w_ParticleSystem_functions, nullptr);
|
||||
}
|
||||
|
||||
} // opengl
|
||||
|
||||
@@ -33,66 +33,6 @@ namespace opengl
|
||||
{
|
||||
|
||||
ParticleSystem *luax_checkparticlesystem(lua_State *L, int idx);
|
||||
int w_ParticleSystem_clone(lua_State *L);
|
||||
int w_ParticleSystem_setTexture(lua_State *L);
|
||||
int w_ParticleSystem_getTexture(lua_State *L);
|
||||
int w_ParticleSystem_setBufferSize(lua_State *L);
|
||||
int w_ParticleSystem_getBufferSize(lua_State *L);
|
||||
int w_ParticleSystem_setInsertMode(lua_State *L);
|
||||
int w_ParticleSystem_getInsertMode(lua_State *L);
|
||||
int w_ParticleSystem_setEmissionRate(lua_State *L);
|
||||
int w_ParticleSystem_getEmissionRate(lua_State *L);
|
||||
int w_ParticleSystem_setEmitterLifetime(lua_State *L);
|
||||
int w_ParticleSystem_getEmitterLifetime(lua_State *L);
|
||||
int w_ParticleSystem_setParticleLifetime(lua_State *L);
|
||||
int w_ParticleSystem_getParticleLifetime(lua_State *L);
|
||||
int w_ParticleSystem_setPosition(lua_State *L);
|
||||
int w_ParticleSystem_getPosition(lua_State *L);
|
||||
int w_ParticleSystem_moveTo(lua_State *L);
|
||||
int w_ParticleSystem_setAreaSpread(lua_State *L);
|
||||
int w_ParticleSystem_getAreaSpread(lua_State *L);
|
||||
int w_ParticleSystem_setDirection(lua_State *L);
|
||||
int w_ParticleSystem_getDirection(lua_State *L);
|
||||
int w_ParticleSystem_setSpread(lua_State *L);
|
||||
int w_ParticleSystem_getSpread(lua_State *L);
|
||||
int w_ParticleSystem_setSpeed(lua_State *L);
|
||||
int w_ParticleSystem_getSpeed(lua_State *L);
|
||||
int w_ParticleSystem_setLinearAcceleration(lua_State *L);
|
||||
int w_ParticleSystem_getLinearAcceleration(lua_State *L);
|
||||
int w_ParticleSystem_setRadialAcceleration(lua_State *L);
|
||||
int w_ParticleSystem_getRadialAcceleration(lua_State *L);
|
||||
int w_ParticleSystem_setTangentialAcceleration(lua_State *L);
|
||||
int w_ParticleSystem_getTangentialAcceleration(lua_State *L);
|
||||
int w_ParticleSystem_setLinearDamping(lua_State *L);
|
||||
int w_ParticleSystem_getLinearDamping(lua_State *L);
|
||||
int w_ParticleSystem_setSizes(lua_State *L);
|
||||
int w_ParticleSystem_getSizes(lua_State *L);
|
||||
int w_ParticleSystem_setSizeVariation(lua_State *L);
|
||||
int w_ParticleSystem_getSizeVariation(lua_State *L);
|
||||
int w_ParticleSystem_setRotation(lua_State *L);
|
||||
int w_ParticleSystem_getRotation(lua_State *L);
|
||||
int w_ParticleSystem_setSpin(lua_State *L);
|
||||
int w_ParticleSystem_getSpin(lua_State *L);
|
||||
int w_ParticleSystem_setSpinVariation(lua_State *L);
|
||||
int w_ParticleSystem_getSpinVariation(lua_State *L);
|
||||
int w_ParticleSystem_setColors(lua_State *L);
|
||||
int w_ParticleSystem_getColors(lua_State *L);
|
||||
int w_ParticleSystem_setQuads(lua_State *L);
|
||||
int w_ParticleSystem_getQuads(lua_State *L);
|
||||
int w_ParticleSystem_setOffset(lua_State *L);
|
||||
int w_ParticleSystem_getOffset(lua_State *L);
|
||||
int w_ParticleSystem_setRelativeRotation(lua_State *L);
|
||||
int w_ParticleSystem_hasRelativeRotation(lua_State *L);
|
||||
int w_ParticleSystem_getCount(lua_State *L);
|
||||
int w_ParticleSystem_start(lua_State *L);
|
||||
int w_ParticleSystem_stop(lua_State *L);
|
||||
int w_ParticleSystem_pause(lua_State *L);
|
||||
int w_ParticleSystem_reset(lua_State *L);
|
||||
int w_ParticleSystem_emit(lua_State *L);
|
||||
int w_ParticleSystem_isActive(lua_State *L);
|
||||
int w_ParticleSystem_isPaused(lua_State *L);
|
||||
int w_ParticleSystem_isStopped(lua_State *L);
|
||||
int w_ParticleSystem_update(lua_State *L);
|
||||
extern "C" int luaopen_particlesystem(lua_State *L);
|
||||
|
||||
} // opengl
|
||||
|
||||
@@ -401,7 +401,7 @@ int w_Shader_getExternVariable(lua_State *L)
|
||||
return 3;
|
||||
}
|
||||
|
||||
static const luaL_Reg functions[] =
|
||||
static const luaL_Reg w_Shader_functions[] =
|
||||
{
|
||||
{ "getWarnings", w_Shader_getWarnings },
|
||||
{ "sendInt", w_Shader_sendInt },
|
||||
@@ -417,7 +417,7 @@ static const luaL_Reg functions[] =
|
||||
|
||||
extern "C" int luaopen_shader(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, GRAPHICS_SHADER_ID, functions);
|
||||
return luax_register_type(L, GRAPHICS_SHADER_ID, "Shader", w_Shader_functions, nullptr);
|
||||
}
|
||||
|
||||
} // opengl
|
||||
|
||||
@@ -33,14 +33,6 @@ namespace opengl
|
||||
{
|
||||
|
||||
Shader *luax_checkshader(lua_State *L, int idx);
|
||||
int w_Shader_getWarnings(lua_State *L);
|
||||
int w_Shader_sendInt(lua_State *L);
|
||||
int w_Shader_sendFloat(lua_State *L);
|
||||
int w_Shader_sendColor(lua_State *L);
|
||||
int w_Shader_sendMatrix(lua_State *L);
|
||||
int w_Shader_sendTexture(lua_State *L);
|
||||
int w_Shader_send(lua_State *L);
|
||||
int w_Shader_getExternVariable(lua_State *L);
|
||||
extern "C" int luaopen_shader(lua_State *L);
|
||||
|
||||
} // opengl
|
||||
|
||||
@@ -213,7 +213,7 @@ int w_SpriteBatch_attachAttribute(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const luaL_Reg functions[] =
|
||||
static const luaL_Reg w_SpriteBatch_functions[] =
|
||||
{
|
||||
{ "add", w_SpriteBatch_add },
|
||||
{ "set", w_SpriteBatch_set },
|
||||
@@ -232,7 +232,7 @@ static const luaL_Reg functions[] =
|
||||
|
||||
extern "C" int luaopen_spritebatch(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, GRAPHICS_SPRITE_BATCH_ID, functions);
|
||||
return luax_register_type(L, GRAPHICS_SPRITE_BATCH_ID, "SpriteBatch", w_SpriteBatch_functions, nullptr);
|
||||
}
|
||||
|
||||
} // opengl
|
||||
|
||||
@@ -32,19 +32,6 @@ namespace opengl
|
||||
{
|
||||
|
||||
SpriteBatch *luax_checkspritebatch(lua_State *L, int idx);
|
||||
int w_SpriteBatch_add(lua_State *L);
|
||||
int w_SpriteBatch_set(lua_State *L);
|
||||
int w_SpriteBatch_clear(lua_State *L);
|
||||
int w_SpriteBatch_flush(lua_State *L);
|
||||
int w_SpriteBatch_setTexture(lua_State *L);
|
||||
int w_SpriteBatch_getTexture(lua_State *L);
|
||||
int w_SpriteBatch_setColor(lua_State *L);
|
||||
int w_SpriteBatch_getColor(lua_State *L);
|
||||
int w_SpriteBatch_getCount(lua_State *L);
|
||||
int w_SpriteBatch_setBufferSize(lua_State *L);
|
||||
int w_SpriteBatch_getBufferSize(lua_State *L);
|
||||
int w_SpriteBatch_attachAttribute(lua_State *L);
|
||||
|
||||
extern "C" int luaopen_spritebatch(lua_State *L);
|
||||
|
||||
} // opengl
|
||||
|
||||
@@ -222,7 +222,7 @@ int w_Text_getHeight(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static const luaL_Reg functions[] =
|
||||
static const luaL_Reg w_Text_functions[] =
|
||||
{
|
||||
{ "set", w_Text_set },
|
||||
{ "setf", w_Text_setf },
|
||||
@@ -238,7 +238,7 @@ static const luaL_Reg functions[] =
|
||||
|
||||
extern "C" int luaopen_text(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, GRAPHICS_TEXT_ID, functions);
|
||||
return luax_register_type(L, GRAPHICS_TEXT_ID, "Text", w_Text_functions, nullptr);
|
||||
}
|
||||
|
||||
} // opengl
|
||||
|
||||
@@ -33,15 +33,6 @@ namespace opengl
|
||||
|
||||
Text *luax_checktext(lua_State *L, int idx);
|
||||
void luax_checkcoloredstring(lua_State *L, int idx, std::vector<Font::ColoredString> &strings);
|
||||
int w_Text_set(lua_State *L);
|
||||
int w_Text_setf(lua_State *L);
|
||||
int w_Text_add(lua_State *L);
|
||||
int w_Text_addf(lua_State *L);
|
||||
int w_Text_clear(lua_State *L);
|
||||
int w_Text_setFont(lua_State *L);
|
||||
int w_Text_getFont(lua_State *L);
|
||||
int w_Text_getWidth(lua_State *L);
|
||||
int w_Text_getHeight(lua_State *L);
|
||||
extern "C" int luaopen_text(lua_State *L);
|
||||
|
||||
} // opengl
|
||||
|
||||
@@ -64,7 +64,7 @@ int w_Quad_getViewport(lua_State *L)
|
||||
return 4;
|
||||
}
|
||||
|
||||
static const luaL_Reg functions[] =
|
||||
static const luaL_Reg w_Quad_functions[] =
|
||||
{
|
||||
{ "setViewport", w_Quad_setViewport },
|
||||
{ "getViewport", w_Quad_getViewport },
|
||||
@@ -73,7 +73,7 @@ static const luaL_Reg functions[] =
|
||||
|
||||
extern "C" int luaopen_quad(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, GRAPHICS_QUAD_ID, functions);
|
||||
return luax_register_type(L, GRAPHICS_QUAD_ID, "Quad", w_Quad_functions, nullptr);
|
||||
}
|
||||
|
||||
} // graphics
|
||||
|
||||
@@ -31,8 +31,6 @@ namespace graphics
|
||||
{
|
||||
|
||||
Quad *luax_checkquad(lua_State *L, int idx);
|
||||
int w_Quad_setViewport(lua_State *L);
|
||||
int w_Quad_getViewport(lua_State *L);
|
||||
extern "C" int luaopen_quad(lua_State *L);
|
||||
|
||||
} // graphics
|
||||
|
||||
@@ -125,5 +125,22 @@ int w_Texture_getWrap(lua_State *L)
|
||||
return 2;
|
||||
}
|
||||
|
||||
const luaL_Reg w_Texture_functions[] =
|
||||
{
|
||||
{ "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 },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
extern "C" int luaopen_texture(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, GRAPHICS_TEXTURE_ID, "Texture", w_Texture_functions, nullptr);
|
||||
}
|
||||
|
||||
} // graphics
|
||||
} // love
|
||||
|
||||
@@ -30,13 +30,9 @@ namespace graphics
|
||||
{
|
||||
|
||||
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);
|
||||
extern "C" int luaopen_texture(lua_State *L);
|
||||
|
||||
extern const luaL_Reg w_Texture_functions[];
|
||||
|
||||
} // graphics
|
||||
} // love
|
||||
|
||||
Reference in New Issue
Block a user