⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lua_aleg.c

📁 lua脚本语言调用allegro游戏程序库的接口-跨平台
💻 C
字号:
/****************************************************************************
**                                                                         **
**                  LuAllegro library - Lua port of Allegro                **
**                       Copyright (C) 2005 Peter Jamroz                   **
**                 e-mail: peterjam at poczta dot onet dot pl              **
**                                                                         **
**        Permission to use, copy, modify, publish this software           **
**    is hereby granted to any person obtaining a copy of this software,   **
**                              FREE OF CHARGE,                            **
**                     under the following conditions:                     **
**                                                                         **
** 1:  The above copyright notice and this permission notice shall be      **
**     included in all copies or substantial portions of the Software.     **
**                                                                         **
** 2:  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,     **
**   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    **
**   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.**
**   IN NO EVENT SHALL THE AUTHOR OR COPYRIGHT HOLDER BE LIABLE FOR ANY    **
**   CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  **
**   TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     **
**   SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                **
**                                                                         **
****************************************************************************/
#include <lua_aleg.h>
#include <lua_root.h>
#include <lua_mode.h>
#include <lua_prim.h>
#include <lua_text.h>
#include <lua_font.h>
#include <lua_load.h>
#include <lua_maus.h>
#include <lua_misc.h>
#include <lua_time.h>
#include <lua_blit.h>
#include <lua_patt.h>
#include <lua_true.h>
#include <lua_pal.h>
#include <lua_rle.h>
#include <lua_bmp.h>
#include <lua_kbd.h>
#include <lua_gui.h>
#include <lua_str.h>

#include <allegro.h>

//------------------------------------------------------------------------------------------
int l_set_window_title          (lua_State* L);
int l_close_button_pressed      (lua_State* L);
int l_exit                      (lua_State* L);

//------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------

LUA_API lua_Number lua_tonumber_def (lua_State *L, int idx,lua_Number def_val)
{
if (lua_isnumber(L,idx))
   return lua_tonumber(L,idx);  
else 
   return def_val;
}


//---------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------
int luaopen_allegro (lua_State *L) 
{

   luaopen_allegro_root(L);
   luaopen_allegro_prim(L);
   luaopen_allegro_maus(L);
   luaopen_allegro_time(L);
   luaopen_allegro_text(L);
   luaopen_allegro_font(L);
   luaopen_allegro_blit(L);
   luaopen_allegro_mode(L);
   luaopen_allegro_patt(L);
   luaopen_allegro_true(L);
   luaopen_allegro_load(L);
   luaopen_allegro_pal (L);
   luaopen_allegro_rle (L);
   luaopen_allegro_bmp (L);
   luaopen_allegro_kbd (L);
   luaopen_allegro_gui (L);

   luaopen_image_string(L);
   
   luaopen_misc(L);   //open binary operations library

   return 1;
}


//-----------------------------------------------------------------------------------------------
int luaopen_luallegro (lua_State *L) 
{
   return luaopen_allegro(L);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -