VR-Engage  2.2
Loading...
Searching...
No Matches
binding.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4******************************************************************************/
5
6//! \file binding.h
7//! \brief Defines functions for registering and loading Lua bindings
8//!
9//! This file contains functions for registering and loading Lua bindings for the
10//! VREngage system. It provides a mechanism to register C++ functions that will
11//! be exposed to Lua scripts, allowing Lua code to interact with the native
12//! functionality of the VREngage application.
13
14#pragma once
15
17
18struct lua_State;
19
20namespace makVre
21{
22//! \brief Function pointer type for Lua binding registration functions
23//!
24//! This type represents functions that register C++ functionality with Lua.
25//! These functions take a lua_State pointer and return an integer representing
26//! the number of values pushed onto the Lua stack.
27typedef int (*DtLuaRegistrationFunc)(lua_State* L);
28
29//! \brief Loads all registered VREngage bindings into a Lua state
30//! \param L Pointer to the Lua state to load bindings into
31//!
32//! This function loads all registered VREngage bindings into the specified Lua state.
33//! It should be called once for each Lua state that needs access to VREngage functionality.
35
36//! \brief Initializes the default set of VREngage Lua bindings
37//!
38//! This function registers the default set of VREngage Lua bindings.
39//! It should be called once during application startup before any Lua states
40//! are created or any custom bindings are registered.
42
43//! \brief Registers a custom binding function
44//! \param func Function pointer to the binding function to register
45//!
46//! This function registers a custom binding function that will be called
47//! when DtLoadVreBindings is called. Use this to extend the Lua scripting
48//! capabilities with custom functionality.
50} // namespace makVre
Defines export macros for the vreLuaBindings library.
#define VRELUABINDING_DLL
Export/import macro for non-Windows platforms.
Definition export.h:37
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
void VRELUABINDING_DLL DtInitializeDefaultBindings()
Initializes the default set of VREngage Lua bindings.
void VRELUABINDING_DLL DtRegisterBindingFunction(DtLuaRegistrationFunc func)
Registers a custom binding function.
void VRELUABINDING_DLL DtLoadVreBindings(lua_State *L)
Loads all registered VREngage bindings into a Lua state.
int(* DtLuaRegistrationFunc)(lua_State *L)
Function pointer type for Lua binding registration functions.
Definition binding.h:27