GLUS
Functions
glus_window.h File Reference

Go to the source code of this file.

Functions

GLUSAPI GLUSboolean GLUSAPIENTRY glusWindowCreate (const GLUSchar *title, const GLUSint width, const GLUSint height, const GLUSboolean fullscreen, const GLUSboolean noResize, const EGLint *configAttribList, const EGLint *contextAttribList)
 Creates the window. More...
 
GLUSAPI GLUSvoid GLUSAPIENTRY glusWindowDestroy (GLUSvoid)
 Cleans up the window and frees all resources. More...
 
GLUSAPI GLUSboolean GLUSAPIENTRY glusWindowRun (GLUSvoid)
 Starts the main loop. More...
 
GLUSAPI GLUSboolean GLUSAPIENTRY glusWindowStartup (GLUSvoid)
 Starts everything before the main loop. More...
 
GLUSAPI GLUSboolean GLUSAPIENTRY glusWindowLoop (GLUSvoid)
 Calls the main loop once. More...
 
GLUSAPI GLUSboolean GLUSAPIENTRY glusWindowLoopDoRecording (GLUSvoid)
 Calls the main loop once. More...
 
GLUSAPI GLUSvoid GLUSAPIENTRY glusWindowShutdown (GLUSvoid)
 Called after the main loop. More...
 
GLUSAPI GLUSvoid GLUSAPIENTRY glusWindowSwapInterval (GLUSint interval)
 Specifies the minimum number of video frame periods per buffer swap for the window. More...
 
GLUSAPI GLUSvoid GLUSAPIENTRY glusWindowSetInitFunc (GLUSboolean(*glusNewInit)(GLUSvoid))
 Sets the users initialization function. More...
 
GLUSAPI GLUSvoid GLUSAPIENTRY glusWindowSetReshapeFunc (GLUSvoid(*glusNewReshape)(const GLUSint width, const GLUSint height))
 Sets the users reshape function. More...
 
GLUSAPI GLUSvoid GLUSAPIENTRY glusWindowSetUpdateFunc (GLUSboolean(*glusNewUpdate)(const GLUSfloat time))
 Sets the users update function, which is called every frame. More...
 
GLUSAPI GLUSvoid GLUSAPIENTRY glusWindowSetTerminateFunc (GLUSvoid(*glusNewTerminate)(GLUSvoid))
 Sets the users terminate function, which is called in any case. More...
 
GLUSAPI GLUSvoid GLUSAPIENTRY glusWindowSetKeyFunc (GLUSvoid(*glusNewKey)(const GLUSboolean pressed, const GLUSint key))
 Sets the users key handler. More...
 
GLUSAPI GLUSvoid GLUSAPIENTRY glusWindowSetMouseFunc (GLUSvoid(*glusNewMouse)(const GLUSboolean pressed, const GLUSint button, const GLUSint xPos, const GLUSint yPos))
 Sets the users mouse handler. More...
 
GLUSAPI GLUSvoid GLUSAPIENTRY glusWindowSetMouseWheelFunc (GLUSvoid(*glusNewMouseWheel)(const GLUSint buttons, const GLUSint ticks, const GLUSint xPos, const GLUSint yPos))
 Sets the users mouse wheel function. More...
 
GLUSAPI GLUSvoid GLUSAPIENTRY glusWindowSetMouseMoveFunc (GLUSvoid(*glusNewMouseMove)(const GLUSint buttons, const GLUSint xPos, const GLUSint yPos))
 Sets the users mouse move function. More...
 
GLUSAPI GLUSboolean GLUSAPIENTRY glusWindowStartRecording (GLUSint numberFrames, GLUSint framesPerSecond)
 Starts recording image clips, by making screenshots of the window. More...
 
GLUSAPI GLUSboolean GLUSAPIENTRY glusWindowIsRecording (GLUSvoid)
 Checks, if a recording is running. More...
 
GLUSAPI GLUSvoid GLUSAPIENTRY glusWindowStopRecording (GLUSvoid)
 Stops recording the image clips. More...
 
GLUSAPI GLUSint GLUSAPIENTRY glusWindowGetWidth (GLUSvoid)
 Get window width. More...
 
GLUSAPI GLUSint GLUSAPIENTRY glusWindowGetHeight (GLUSvoid)
 Get window height. More...
 

Function Documentation

GLUSAPI GLUSboolean GLUSAPIENTRY glusWindowCreate ( const GLUSchar title,
const GLUSint  width,
const GLUSint  height,
const GLUSboolean  fullscreen,
const GLUSboolean  noResize,
const EGLint configAttribList,
const EGLint contextAttribList 
)

Creates the window.

In this function, mainly GLEW and GLFW functions are used. By default, a RGBA color buffer is created.

Parameters
titleTitle of the window.
widthWidth of the window.
heightHeight of the window.
fullscreenFlag for setting the window to fullscreen.
noResizeGLUS_TRUE, if it should not be possible to resize the window.
configAttribListEGL configuration attribute list.
contextAttribListEGL context attribute list.
Returns
GLUS_TRUE, if creation of OpenGL context and window succeeded.
GLUSAPI GLUSvoid GLUSAPIENTRY glusWindowDestroy ( GLUSvoid  )

Cleans up the window and frees all resources.

Only needs to be called, if creation of the window failed.

GLUSAPI GLUSint GLUSAPIENTRY glusWindowGetHeight ( GLUSvoid  )

Get window height.

Returns
The height of the window.
GLUSAPI GLUSint GLUSAPIENTRY glusWindowGetWidth ( GLUSvoid  )

Get window width.

Returns
The width of the window.
GLUSAPI GLUSboolean GLUSAPIENTRY glusWindowIsRecording ( GLUSvoid  )

Checks, if a recording is running.

Returns
GLUS_ TRUE, is recording is running.
GLUSAPI GLUSboolean GLUSAPIENTRY glusWindowLoop ( GLUSvoid  )

Calls the main loop once.

Update function is called. Use this function, if glusRun can not be used.

Returns
GLUS_ TRUE, if looping should continue.
GLUSAPI GLUSboolean GLUSAPIENTRY glusWindowLoopDoRecording ( GLUSvoid  )

Calls the main loop once.

Update function is called and one screenshot is taken and stored. Use this function, if glusRun can not be used.

Returns
GLUS_ TRUE, if looping should continue.

Starts the main loop.

First the init, reshape, update and - if terminated - terminate functions are called.

Returns
GLUS_ TRUE, if running the main loop succeeded.
GLUSAPI GLUSvoid GLUSAPIENTRY glusWindowSetInitFunc ( GLUSboolean(*)(GLUSvoid glusNewInit)

Sets the users initialization function.

Called before the reshape and update functions.

The function must return GLUS_TRUE, if the initialization succeeded. If not, the program terminates.

GLUSAPI GLUSvoid GLUSAPIENTRY glusWindowSetKeyFunc ( GLUSvoid(*)(const GLUSboolean pressed, const GLUSint key)  glusNewKey)

Sets the users key handler.

The function receives the values, if a key was pressed or released.

GLUSAPI GLUSvoid GLUSAPIENTRY glusWindowSetMouseFunc ( GLUSvoid(*)(const GLUSboolean pressed, const GLUSint button, const GLUSint xPos, const GLUSint yPos)  glusNewMouse)

Sets the users mouse handler.

The function receives the state of a button and the x and y position in the window.

Buttons are: 1 Left mouse button. 2 Middle mouse button. 4 Right mouse button.

GLUSAPI GLUSvoid GLUSAPIENTRY glusWindowSetMouseMoveFunc ( GLUSvoid(*)(const GLUSint buttons, const GLUSint xPos, const GLUSint yPos)  glusNewMouseMove)

Sets the users mouse move function.

The function receives the states of all buttons and the current x and y position.

GLUSAPI GLUSvoid GLUSAPIENTRY glusWindowSetMouseWheelFunc ( GLUSvoid(*)(const GLUSint buttons, const GLUSint ticks, const GLUSint xPos, const GLUSint yPos)  glusNewMouseWheel)

Sets the users mouse wheel function.

The function receives the states of all buttons, the direction of the wheel in ticks and the current x and y position.

GLUSAPI GLUSvoid GLUSAPIENTRY glusWindowSetReshapeFunc ( GLUSvoid(*)(const GLUSint width, const GLUSint height)  glusNewReshape)

Sets the users reshape function.

Called after the initialization and before the update function. If the window is resized, this function is also called before the update function.

The function receives the current width and height of the resized window.

GLUSAPI GLUSvoid GLUSAPIENTRY glusWindowSetTerminateFunc ( GLUSvoid(*)(GLUSvoid glusNewTerminate)

Sets the users terminate function, which is called in any case.

It can be used to clean up resources.

GLUSAPI GLUSvoid GLUSAPIENTRY glusWindowSetUpdateFunc ( GLUSboolean(*)(const GLUSfloat time)  glusNewUpdate)

Sets the users update function, which is called every frame.

The time difference since last frame is passed in seconds and the resolution is at least in milliseconds.

If the function does not return GLUS_TRUE, the application is terminated.

GLUSAPI GLUSvoid GLUSAPIENTRY glusWindowShutdown ( GLUSvoid  )

Called after the main loop.

The terminate function is called. Use this function, if glusRun can not be used.

GLUSAPI GLUSboolean GLUSAPIENTRY glusWindowStartRecording ( GLUSint  numberFrames,
GLUSint  framesPerSecond 
)

Starts recording image clips, by making screenshots of the window.

Parameters
numberFramesThe number of frames to record.
framesPerSecondFrames per second to use.
Returns
GLUS_ TRUE, is start succeeded.
GLUSAPI GLUSboolean GLUSAPIENTRY glusWindowStartup ( GLUSvoid  )

Starts everything before the main loop.

The init and reshape functions are called. Use this function, if glusRun can not be used.

Returns
GLUS_ TRUE, if startup succeeded.
GLUSAPI GLUSvoid GLUSAPIENTRY glusWindowStopRecording ( GLUSvoid  )

Stops recording the image clips.

GLUSAPI GLUSvoid GLUSAPIENTRY glusWindowSwapInterval ( GLUSint  interval)

Specifies the minimum number of video frame periods per buffer swap for the window.

Has to be called after the window is created.

Parameters
intervalSpecifies the minimum number of video frames that are displayed before a buffer swap will occur.