Changeset 62 for trunk/tests/lualib_test/lualib_test.cc
- Timestamp:
- 05/30/13 16:44:38 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/lualib_test/lualib_test.cc
r53 r62 3 3 #include <nv/lua/lua_glm.hh> 4 4 #include <nv/logger.hh> 5 #include <nv/types.hh> 6 #include <nv/object.hh> 5 7 #include <string> 6 8 #include <iostream> 9 #include <functional> 10 11 struct test_struct 12 { 13 std::string f; 14 int i; 15 }; 16 17 NV_REGISTER_NAME( test_struct ) 7 18 8 19 int main(int, char* []) 9 20 { 21 nv::type_database db; 22 nv::object::register_type( &db ); 23 24 db.create_type<int>(); 25 db.create_type<std::string>(); 26 nv::type_field fields[] = { 27 nv::type_field("f", &test_struct::f ), 28 nv::type_field("i", &test_struct::i ), 29 }; 30 db.create_type<test_struct>().fields( fields ); 31 32 10 33 nv::logger log(nv::LOG_TRACE); 11 34 log.add_sink( new nv::log_file_sink("log.txt"), nv::LOG_TRACE ); 12 35 log.add_sink( new nv::log_console_sink(), nv::LOG_TRACE ); 13 36 nv::load_lua_library(); 14 37 15 38 NV_LOG( nv::LOG_NOTICE, "Logging started" ); 16 39 … … 38 61 luaL_dofile(lua_state, "init.lua"); 39 62 40 while (true)63 for (;;) 41 64 { 42 65 std::string input;
Note: See TracChangeset
for help on using the changeset viewer.