소스 검색

examples: Update functions example

Ole 9 년 전
부모
커밋
83f2ec9859
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      examples/functions.cpp

+ 3 - 3
examples/functions.cpp

@@ -23,15 +23,15 @@ int main() {
 
 	// Register 'my_function_1'
 	auto wrapped_1 = LUWRA_WRAP(my_function_1);
-	luwra::setGlobal(state, "my_function_1", wrapped_1);
+	state.set("my_function_1", wrapped_1);
 
 	// Register 'my_function_2'
 	auto wrapped_2 = LUWRA_WRAP(my_function_2);
-	luwra::setGlobal(state, "my_function_2", wrapped_2);
+	state.set("my_function_2", wrapped_2);
 
 	// Register 'my_function_3'
 	auto wrapped_3 = LUWRA_WRAP(my_function_3);
-	luwra::setGlobal(state, "my_function_3", wrapped_3);
+	state.set("my_function_3", wrapped_3);
 
 	// Load Lua code
 	int ret = state.runString(