Changeset 213 for trunk


Ignore:
Timestamp:
09/09/13 20:04:42 (12 years ago)
Author:
epyon
Message:
  • lua/state - upvalue_index moved to lua/values
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/nv/lua/lua_dispatch.hh

    r212 r213  
    154154                        int fixed_method_wrapper( lua_State* L )
    155155                        {
    156                                 C* c = (C*)to_pointer( L, nv::lua::upvalue_index(1) );
     156                                C* c = (C*)to_pointer( L, nv::lua::detail::upvalue_index(1) );
    157157                                return dispatcher<typename return_type<F>::type>::call( L, c, 1, f );
    158158                        }
  • trunk/nv/lua/lua_state.hh

    r212 r213  
    44// This file is part of NV Libraries.
    55// For conditions of distribution and use, see copyright notice in nv.hh
     6//
     7// TODO: decouple from the type database
     8// TODO: paths for function registration?
     9
    610
    711#ifndef NV_LUA_HH
     
    2529                const int ref_nil   = -1;
    2630                const int ret_multi = -1;
    27 
    28                 int upvalue_index( int i );
    2931
    3032                typedef int reference;
  • trunk/nv/lua/lua_values.hh

    r211 r213  
    5252                namespace detail
    5353                {
    54                         struct void_type {};
     54                        int upvalue_index( int i );
    5555
    5656                        void push_unsigned( lua_State *L, lunsigned v );
  • trunk/src/lua/lua_state.cc

    r212 r213  
    433433}
    434434
    435 int nv::lua::upvalue_index( int i )
    436 {
    437         return lua_upvalueindex(i);
    438 }
  • trunk/src/lua/lua_values.cc

    r208 r213  
    1313using nv::lua::lnumber;
    1414using nv::lua::lunsigned;
     15
     16int nv::lua::detail::upvalue_index( int i )
     17{
     18        return lua_upvalueindex(i);
     19}
    1520
    1621bool nv::lua::detail::is_userdata( lua_State *L, int index, const char* metatable )
  • trunk/tests/lualib_test/lualib_test.cc

    r99 r213  
    11#include <nv/lib/lua.hh>
    22#include <nv/lua/lua_state.hh>
     3#include <nv/lua/lua_dispatch.hh>
    34#include <nv/lua/lua_raw.hh>
    45#include <nv/lua/lua_glm.hh>
     
    1011#include <functional>
    1112#include <nv/gui/gui_element.hh>
     13
     14void hello( const std::string& h )
     15{
     16        std::cout << h << " world from C++!" << std::endl;
     17}
     18
    1219
    1320int main(int, char* [])
     
    2229        {
    2330                nv::lua::state state( true );
    24                 nlua_register_glm( state );
     31                nv::lua::register_glm( state );
    2532                // run the Lua script
     33                state.register_function<decltype(hello),&hello>( "hello" );
    2634                state.do_file( "init.lua" );
     35                //std::cout << nv::function_traits<decltype(hello)>::arg_count << std::endl;
    2736
    2837                log.set_level( nv::LOG_INFO );
Note: See TracChangeset for help on using the changeset viewer.