Display Functionality

Display, screen mode and wiev angle API (Must always be supported)

betray_init

void betray_init(BContextType context_type, int argc, char **argv, uint window_size_x, uint window_size_y, uint samples, boolean window_fullscreen, char *name);

Types:

Enum:

BContextType

B_CT_OPENGL

Description: Normal OpenGL context

B_CT_OPENGLES2

Description: OpenGL 2.0 ES Context

B_CT_OPENGL_OR_ES

Description: Creating a context of either OpenGL Or OpenGLES

betray_context_type_get

BContextType betray_context_type_get();

Description: Returns the type of context currently active. Can only be called after betray_init. If you want to know what context is possible to create use betray_support_context. This function is useful for finding out what context was created if betray was called with the parameter B_CT_OPENGL_OR_ES

Types:

Enum:

BContextType

B_CT_OPENGL

Description: Normal OpenGL context

B_CT_OPENGLES2

Description: OpenGL 2.0 ES Context

B_CT_OPENGL_OR_ES

Description: Creating a context of either OpenGL Or OpenGLES

betray_screen_mode_set

boolean betray_screen_mode_set(uint x_size, uint y_size, uint samples, boolean fullscreen);

Description: Change screen mode

betray_screen_mode_get

double betray_screen_mode_get(uint *x_size, uint *y_size, boolean *fullscreen);

Description: Get the current screen size, and if it is in fullscreen. Any pameters can be set to NULL, if you are not interested in any parameter. The fuinction returns the aspect ratio of the window/display

betray_view_vantage

void betray_view_vantage(float *pos);

Description: The head position compared to screen positioned at 0, 0, 0 with the width randing form -1.0 to 1.0 horizontaly. Should be supported in order to do prespective corect rendering for Sterio scopics and Headtracking. If no headtracking is active the data pointed to will be unaffected.

betray_view_direction

void betray_view_direction(float *matrix);

Description: A 4X4 rotation matrix that should be aplied to all drawing in order to support multi display solutions and headmounted dispålays.

betray_get_input_state

BInputState *betray_get_input_state(void);

Description: A fiuinction that always returns the current input state. Useful for debugging.