lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Dear Sir,

 

I am trying to bring some interactivity to my c appliaction,

To begin with, I am trying to draw a rectangle which is defined in Gui.c from LUA in my application Application_main.c.

 

Gui.c

 

/*structure actually defined in Gui.h*/

 

typedef struct {

char  R;

char  G;

char  B;

} Gui_color_t;

 

Int Gui_Draw_Rectangle( x,y,Width,Height, /*(Gui_color_t *)color*/){

Gui_color_t color; // I have had coded this for testing LUA; I am not comfortable with tables yet

******Some code*******

 

}

 

Application_main.c

 

Int Lua_main( void )

{

            int error;

            lua_State *L = lua_open();   /* opens Lua */

            luaL_Reg Creg;

 

            lua_Integer n;

            luaL_openlibs(L);

 

            printf("luaL_openlibs\n");

            lua_pushcfunction(L, SCSL_Draw_Rect(L));

            printf("lua_pushcfunction\n");

 

/*            n = 0;

            lua_pushinteger(L, n);*/

            n = 100;

            lua_pushinteger(L, n);

            n = 100;

            printf("lua_pushinteger\n");

            lua_pushinteger(L, n);

            n = 300;

            lua_pushinteger(L, n);

            n = 300;

            lua_pushinteger(L, n);

            printf("lua_call\n");

            lua_call( L, 5, 0);

            printf("lua_call\n");

            lua_close(L);

 

            return 0;

}

 

 

Int Application_MainEntry ( )

{

            ********Some code ********

Lua_main();

 

*******Some Code********

}

 

 

I get all the prints in the Lua_main function. I see all the prints on the console but not the rectangle.

 

Can you help me out in this regard.

 

Thanks in advance.

 

Best Regards,

Patil

 



DISCLAIMER:
This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.