Ylva And Malin
Typedefs | Functions
ym_gfx

ym_gfx is responsible for graphics processing within the ym project. More...

Typedefs

typedef void ym_gfx_window
 Simple typedef for void, as no direct handling of the window is legal. More...
 

Functions

YM_NO_DISCARD ym_errc ym_gfx_init (ym_mem_reg_id memory_region)
 Initializes the ym_gfx module with a given memory region. More...
 
YM_NO_DISCARD ym_errc ym_gfx_shutdown ()
 Finished the last of de-initialization needed by the ym_gfx module. More...
 
YM_NO_DISCARD ym_errc ym_gfx_create_window (u16 width, u16 height, const char *window_name, ym_gfx_window **out_window)
 Creates a ym_gfx_window with the specified width, height, and name. More...
 
void ym_gfx_destroy_window (ym_gfx_window *window)
 Destroys/deallocates the window pointed to by window. More...
 
YM_NO_DISCARD bool ym_gfx_window_is_open (const ym_gfx_window *window)
 Checks if the current supplied window is open, or if it has been closed. More...
 
void ym_gfx_window_get_size (ym_gfx_window *window, uint *out_width, uint *out_height)
 Gets the width and height dimension of the given window. More...
 
void ym_gfx_window_clear (ym_gfx_window *window)
 Clears the given window. More...
 
void ym_gfx_window_display (ym_gfx_window *window)
 Displays everything that has been rendered to the window. More...
 
void ym_gfx_window_poll_events (ym_gfx_window *window)
 Polls events tied to the window in question. More...
 

Detailed Description

ym_gfx is responsible for graphics processing within the ym project.

It contains platform independent support for simple graphics processing, like window functionality.

Typedef Documentation

Simple typedef for void, as no direct handling of the window is legal.

To keep the window system cross platform it has been decided that the window system should be completely opaque. And access is only given through functions that accepts a ym_gfx_window* as a parameter.

Function Documentation

YM_NO_DISCARD ym_errc ym_gfx_create_window ( u16  width,
u16  height,
const char *  window_name,
ym_gfx_window **  out_window 
)

Creates a ym_gfx_window with the specified width, height, and name.

Allocates and prepares a new window with the supplied parameters.

Parameters
widthThe width of the window to create in pixels
heightThe height of the window to create in pixels.
window_nameThe name of the window to be created. Cannot be NULL.
Returns
Pointer to newly allocated window on success, NULL on failures.
Todo:
Find out how to do error checking here. Don't want to change the typedef to void* rather than void. As the cast is easier to have mistakes then. Potentially do a out_errc?

Here is the call graph for this function:

Here is the caller graph for this function:

void ym_gfx_destroy_window ( ym_gfx_window window)

Destroys/deallocates the window pointed to by window.

Parameters
windowWindow to destroy/deallocate. Cannot be NULL.

Here is the caller graph for this function:

YM_NO_DISCARD ym_errc ym_gfx_init ( ym_mem_reg_id  memory_region)

Initializes the ym_gfx module with a given memory region.

Initializes the ym_gfx module, allowing it to do any needed setup before it can function properly.

Parameters
memory_regionPointer to the memory region the ym_gfx module should use for allocating memory. Cannot be NULL. The region is stored, and cannot be deleted before ym_gfx is shut down.
Returns
ym_errc_success on success. ym_errc_* on failure.

Here is the caller graph for this function:

YM_NO_DISCARD ym_errc ym_gfx_shutdown ( )

Finished the last of de-initialization needed by the ym_gfx module.

De-initializes the ym_gfx module. Doing any required cleanup before shutting down.

Returns
ym_errc_success on success. ym_errc_* on failure.
void ym_gfx_window_clear ( ym_gfx_window window)

Clears the given window.

Parameters
windowThe window to be cleared.

Here is the caller graph for this function:

void ym_gfx_window_display ( ym_gfx_window window)

Displays everything that has been rendered to the window.

Essentially it swaps the gl buffer.

Parameters
windowThe window to display to. Cannot be NULL.

Here is the caller graph for this function:

void ym_gfx_window_get_size ( ym_gfx_window window,
uint out_width,
uint out_height 
)

Gets the width and height dimension of the given window.

Parameters
windowThe window to check. Cannot be NULL.
out_widthOut parameter used to store width.
out_heightOut parameter used to store height.

Here is the caller graph for this function:

YM_NO_DISCARD bool ym_gfx_window_is_open ( const ym_gfx_window window)

Checks if the current supplied window is open, or if it has been closed.

Parameters
windowThe window to check if open. Cannot be NULL.
Returns
True if the window is open. False if it has been closed.

Here is the caller graph for this function:

void ym_gfx_window_poll_events ( ym_gfx_window window)

Polls events tied to the window in question.

Polls all events that the OS pushed. Additionally the keyboard and mouse is updated.

Parameters
windowWindow to poll events from. Cannot be NULL.

Here is the caller graph for this function: