OpenBlox
A game engine which provides a simple and easy to learn Lua API.
OB Namespace Reference

Namespaces

 Enum
 
 Instance
 
 Lua
 
 Type
 

Classes

struct  _ob_waiting_task
 
class  AssetLocator
 
class  AssetResponse
 
class  BitStream
 
class  ClassFactory
 
class  ClassMetadata
 
class  OBEngine
 
class  OBException
 
class  OBInputEventReceiver
 
class  OBLogger
 
class  OBRenderUtils
 
class  OBSerializer
 
class  Plugin
 
class  PluginManager
 
class  TaskScheduler
 

Typedefs

typedef void(* InstanceInitFnc) (OBEngine *eng)
 
typedef std::function< void(irr::video::IVideoDriver *)> post_render_func_t
 
typedef int(* ob_task_fnc) (void *metad, ob_uint64 startTime)
 

Enumerations

enum  OBLogLevel {
  OLL_Debug, OLL_Information, OLL_Warning, OLL_Error,
  OLL_None
}
 
enum  empties_t { empties_ok, no_empties }
 

Functions

int luaO_typeerror (lua_State *L, int arg, const char *tname)
 
ob_uint64 currentTimeMillis ()
 
bool ob_str_startsWith (std::string str, std::string prefix)
 

Typedef Documentation

◆ InstanceInitFnc

typedef void(* OB::InstanceInitFnc) (OBEngine *eng)

◆ ob_task_fnc

typedef int(* OB::ob_task_fnc) (void *metad, ob_uint64 startTime)

This typedef describes the type of function accepted by the TaskScheduler. When queuing a task, you specify a function of this type, and any type to be used as metadata. That type is cast to a void*, which will be passed as the first parameter of this function on invocation. The second parameter, startTime, is the time, in milliseconds, that the task was queued.

The return code of this function is very important, as each return code signals a different handling in the TaskScheduler. If you don't know what you're doing, just return 0 and you'll be fine. Other return codes are described here:

0 - Signals success, removes this task from the scheduler and the TaskScheduler continues processing tasks.

1 - Signals that this task either did not complete its' job or has not run yet, and that it should be left on the scheduler. The scheduler continues processing further tasks, but this task is left to be processed later.

2 - Signals success, same as a response code 0, except the TaskScheduler should stop processing tasks for this tick.

3 - Signals that the task did not complete its' job, same as a response code 1, except the TaskScheduler should stop processing tasks for this tick.

◆ post_render_func_t

typedef std::function<void(irr::video::IVideoDriver*)> OB::post_render_func_t

Enumeration Type Documentation

◆ empties_t

Enumerator
empties_ok 
no_empties 

◆ OBLogLevel

All possible log levels. OLL_Debug means to log everything, OLL_None means to log (just about) nothing. When used to print messages, messages marked OLL_Debug have the lowest priority, while OLL_None has the highest. Messages marked OLL_None will always be printed, regardless of log level.

Author
John M. Harris, Jr.
Enumerator
OLL_Debug 

Used for printing information used for debugging

OLL_Information 

Used for printing useful information such as hardware information

OLL_Warning 

Used to print warnings, such as something unexpected occurring

OLL_Error 

Used to print critical errors

OLL_None 

Messages with this log level will always be printed.

When used as a filter, nothing other than messages with the level 'OLL_None' will be logged.

Function Documentation

◆ currentTimeMillis()

ob_uint64 OB::currentTimeMillis ( )

Returns the current time in milliseconds.

Returns
Current time in millis
Author
John M. Harris, Jr.

◆ luaO_typeerror()

int OB::luaO_typeerror ( lua_State *  L,
int  arg,
const char *  tname 
)
inline

◆ ob_str_startsWith()

bool OB::ob_str_startsWith ( std::string  str,
std::string  prefix 
)

Returns true if str starts with prefix.

Author
John M. Harris, Jr.