Voxvision
1
Creating and manipulating voxel octrees
|
Lua engine. More...
#include "../gcd-stubs.c"
#include "../voxtrees/tree.h"
#include "../voxrnd/camera.h"
#include "../voxrnd/fps-control.h"
#include "../voxrnd/renderer.h"
#include "../voxrnd/cd.h"
Go to the source code of this file.
Data Structures | |
struct | vox_engine |
Voxengine instance. More... | |
Macros | |
#define | VOX_ENGINE_DEBUG 1 |
Tells voxengine to start in debug mode. | |
#define | vox_engine_quit_requested(stat) (!(stat)) |
Return true if quit was requested from the control script. | |
Typedefs | |
typedef int | vox_engine_status |
Return type for vox_engine_tick | |
Functions | |
VOX_EXPORT struct vox_engine * | vox_create_engine (unsigned int width, unsigned int height, unsigned int flags, const char *script, int nargs, char *const arguments[]) |
Create voxengine. More... | |
VOX_EXPORT vox_engine_status | vox_engine_tick (struct vox_engine *engine) |
Engine tick function. More... | |
VOX_EXPORT void | vox_destroy_engine (struct vox_engine *engine) |
Destroy an engine. | |
Lua engine.
VOX_EXPORT struct vox_engine* vox_create_engine | ( | unsigned int | width, |
unsigned int | height, | ||
unsigned int | flags, | ||
const char * | script, | ||
int | nargs, | ||
char *const | arguments[] | ||
) |
Create voxengine.
This function creates a lua engine: initializes SDL, opens a window, initializes lua environment, loads needed modules and lua control script and so on. See the main page of documentation for more informantion. If you wish to pass an array of strings to lua control script, they will be visible in arg
table having they indices starting from 1.
width | Width of the window. |
height | Height of the window. |
flags | Currently 0 for normal work or VOX_ENGINE_DEBUG for debug mode. |
script | Control script in lua |
nargs | Number of arguments |
arguments | An array of zero terminated strings which you want to pass to lua as arguments. Must be NULL if nargs is zero. As this function returns, the array is no longer needed by the engine. |
VOX_EXPORT vox_engine_status vox_engine_tick | ( | struct vox_engine * | engine | ) |
Engine tick function.
Do an engine tick. See the main page of documentation for more information. This function is usually called inside an infinite loop in the main program.