
#ifndef AG_H
#define AG_H

#include <lua.hpp>

namespace ag
{
    void register_functions(lua_State * L);

    /* Lua interfaces */
    int clearEventHandler(lua_State * L);
    int doPhysics(lua_State * L);
    int drawObjects(lua_State * L);
    int elapsedTime(lua_State * L);
    int endFrame(lua_State * L);
    int exit(lua_State * L);
    int getCamera(lua_State * L);
    int getScreenSize(lua_State * L);
    int import(lua_State * L);
    int isKeyDown(lua_State * L);
    int loadModel(lua_State * L);
    int loadModelStatic(lua_State * L);
    int loadTexture(lua_State * L);
    int print(lua_State * L);
    int println(lua_State * L);
    int registerEventHandler(lua_State * L);
    int setAutoDrawObjects(lua_State * L);
    int setAutoEndFrame(lua_State * L);
    int setAutoPhysics(lua_State * L);
    int setAutoStartFrame(lua_State * L);
    int setCamera(lua_State * L);
    int setGravity(lua_State * L);
    int sleep(lua_State * L);
    int startFrame(lua_State * L);

    /* 2D overlay functions */
    int drawArc(lua_State * L);
    int drawCircle(lua_State * L);
    int drawImage(lua_State * L);
    int drawLine(lua_State * L);
    int drawRect(lua_State * L);
    int drawText(lua_State * L);
    int fillRect(lua_State * L);
    int getTextSize(lua_State * L);

    /* managed object creation functions */
    int createBox(lua_State * L);
    int createBoxStatic(lua_State * L);
    int createCapsule(lua_State * L);
    int createCapsuleStatic(lua_State * L);
    int createCylinder(lua_State * L);
    int createCylinderStatic(lua_State * L);
    int createPlane(lua_State * L);
    int createSphere(lua_State * L);
    int createSphereStatic(lua_State * L);

    namespace object
    {
        int draw(lua_State * L);
        int setPosition(lua_State * L);
        int getPosition(lua_State * L);
        int setRotation(lua_State * L);
        int clone(lua_State * L);
        int destroy(lua_State * L);
        int setVisible(lua_State * L);
        int addForce(lua_State * L);
        int addForceRel(lua_State * L);
        int addTorque(lua_State * L);
        int addTorqueRel(lua_State * L);
        int setColor(lua_State * L);
        int setTexture(lua_State * L);
        int getMass(lua_State * L);
        int setMass(lua_State * L);
        int getAABB(lua_State * L);
        int getSize(lua_State * L);
    }
}

#endif
