Kaynağa Gözat

examples: Update functions example

Ole 9 yıl önce
ebeveyn
işleme
83f2ec9859
1 değiştirilmiş dosya ile 3 ekleme ve 3 silme
  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(