|
AnimaEngine
1.0.0
Nintendo DS Pokemon Black, White, Black 2, and White 2 sprite extraction and preview toolchain
|
Platform-independent renderer and OS abstraction layer. More...
Go to the source code of this file.
Data Structures | |
| struct | GrColor |
| Abstract color representation using 8-bit red, green, blue, and alpha values. More... | |
| struct | GrRect |
| Abstract rectangle bounding box in 2D coordinate space. More... | |
| struct | GrTexture |
| Abstract texture representation mapped to graphics card registers. More... | |
| struct | GrFilePathList |
| Abstracted directory list container. More... | |
Typedefs | |
| typedef struct GrColor | GrColor |
| Abstract color representation using 8-bit red, green, blue, and alpha values. More... | |
| typedef struct GrRect | GrRect |
| Abstract rectangle bounding box in 2D coordinate space. More... | |
| typedef struct GrTexture | GrTexture |
| Abstract texture representation mapped to graphics card registers. More... | |
| typedef struct GrFilePathList | GrFilePathList |
| Abstracted directory list container. More... | |
Functions | |
| void | Gr_InitWindow (int w, int h, const char *title) |
| Initialises the application window and renderer context. More... | |
| void | Gr_CloseWindow (void) |
| Terminates the windowing subsystem and cleans up remaining hardware resources. More... | |
| int | Gr_WindowShouldClose (void) |
| Checks if the OS window closing event (close button, Alt+F4) has been triggered. More... | |
| int | Gr_GetScreenW (void) |
| Gets the current window canvas width in pixels. More... | |
| int | Gr_GetScreenH (void) |
| Gets the current window canvas height in pixels. More... | |
| void | Gr_SetMinSize (int w, int h) |
| resticts the minimum allowable window sizing for resizable targets. More... | |
| void | Gr_SetTargetFPS (int fps) |
| resticts the rendering execution speed to the target frames per second. More... | |
| void | Gr_BeginFrame (void) |
| Signals the rendering backend that a new frame has started (flushes draw calls). More... | |
| void | Gr_EndFrame (void) |
| Signals the rendering backend that a frame has finished (swaps framebuffers). More... | |
| void | Gr_Clear (GrColor c) |
| Clears the entire active framebuffer with a solid background color. More... | |
| float | Gr_GetTime (void) |
| Returns total time elapsed in seconds since the window context started. More... | |
| float | Gr_GetFrameDelta (void) |
| Returns the duration time step in seconds between the previous frame and this frame. More... | |
| int | Gr_FileExists (const char *path) |
| Checks if a file path exists and is accessible. More... | |
| GrFilePathList | Gr_LoadDirectoryFiles (const char *dirPath) |
| Loads all filenames/directories inside a specified folder. More... | |
| void | Gr_UnloadDirectoryFiles (GrFilePathList list) |
| Deallocates directory list memory allocations. More... | |
| int | Gr_IsPathFile (const char *path) |
| Checks whether the given path represents a file or a directory. More... | |
| const char * | Gr_GetFileName (const char *filePath) |
| Extracts the file name pointer (excluding folders) from a path string. More... | |
| const char * | Gr_GetWorkingDirectory (void) |
| Gets current process working directory (CWD) path. More... | |
| const char * | Gr_GetPrevDirectoryPath (const char *dirPath) |
| Resolves parent directory path. More... | |
| int | Gr_MouseX (void) |
| Gets active cursor horizontal pixel index. More... | |
| int | Gr_MouseY (void) |
| Gets active cursor vertical pixel index. More... | |
| int | Gr_MousePressed (int btn) |
| Checks if a mouse button was clicked. More... | |
| int | Gr_MouseDown (int btn) |
| Checks if a mouse button is currently held down. More... | |
| int | Gr_GetWheel (void) |
| Gets mouse wheel offset delta. More... | |
| int | Gr_KeyPressed (int key) |
| Checks if keyboard key was clicked. More... | |
| int | Gr_KeyDown (int key) |
| Checks if keyboard key is being held. More... | |
| int | Gr_GetChar (void) |
| Pops latest character pressed from keyboard queue. More... | |
| const char * | Gr_Clipboard (void) |
| Gets active system clipboard contents. More... | |
| int | Gr_FileDropped (void) |
| Checks if any files have been dropped onto the window area in this frame. More... | |
| int | Gr_DropCount (void) |
| Gets count of dropped files. More... | |
| const char * | Gr_DropPath (int i) |
| Gets path of dropped file by index. More... | |
| void | Gr_DropFinish (void) |
| Cleans up drag-and-drop platform handles. More... | |
| GrRect | Gr_MeasureText (const char *text, int size) |
| Computes width bounds for a text string under a target font height size. More... | |
| void | Gr_DrawText (const char *text, float x, float y, int size, GrColor c) |
| Draws direct raster text on active canvas. More... | |
| void | Gr_DrawRect (GrRect r, GrColor c) |
| Draws solid rectangle. More... | |
| void | Gr_DrawRectRounded (GrRect r, float rad, GrColor c) |
| Draws rounded corners solid rectangle. More... | |
| void | Gr_DrawRectRoundedLines (GrRect r, float rad, GrColor c) |
| Draws lines of a rounded corners rectangle. More... | |
| void | Gr_DrawCircle (int cx, int cy, float r, GrColor c) |
| Draws solid circle. More... | |
| void | Gr_ScissorBegin (int x, int y, int w, int h) |
| Sets a rectangular scissor clipping box on drawing calls. More... | |
| void | Gr_ScissorEnd (void) |
| Disables scissor clipping bounding boxes. More... | |
| int | Gr_CheckPointInRect (GrRect r, float px, float py) |
| Verifies collision point bounds inside a rectangle. More... | |
| int | Gr_CheckPointInCircle (float px, float py, float cx, float cy, float r) |
| Verifies collision bounds inside a circle. More... | |
| int | Gr_MakeTextureRGBA (GrTexture *t, const unsigned char *rgba, int w, int h) |
| Allocates dynamic texture mapping using raw RGBA pixel arrays. More... | |
| void | Gr_UpdateTexture (GrTexture *t, const unsigned char *rgba) |
| Copies new raw RGBA pixel bytes directly into an active texture VRAM address. More... | |
| void | Gr_DrawTexture (GrTexture *t, GrRect src, GrRect dst, GrColor tint) |
| Draws a textured quad inside target coordinates. More... | |
| void | Gr_UnloadTexture (GrTexture *t) |
| Deallocates hardware graphics memory registers used by a texture. More... | |
| const char * | Gr_FormatText (const char *fmt,...) |
| Formats text string using printf-style layout arguments. More... | |
Platform-independent renderer and OS abstraction layer.
This module defines the color, rectangle, texture, and windowing abstractions used by the GUI browser application. Implementing this interface allows swapping backends (e.g. Raylib, SDL, OpenGL).
Abstract color representation using 8-bit red, green, blue, and alpha values.
| typedef struct GrFilePathList GrFilePathList |
Abstracted directory list container.
Abstract texture representation mapped to graphics card registers.
| void Gr_BeginFrame | ( | void | ) |
Signals the rendering backend that a new frame has started (flushes draw calls).
| int Gr_CheckPointInCircle | ( | float | px, |
| float | py, | ||
| float | cx, | ||
| float | cy, | ||
| float | r | ||
| ) |
Verifies collision bounds inside a circle.
| int Gr_CheckPointInRect | ( | GrRect | r, |
| float | px, | ||
| float | py | ||
| ) |
Verifies collision point bounds inside a rectangle.
| void Gr_Clear | ( | GrColor | c | ) |
Clears the entire active framebuffer with a solid background color.
| c | Target background color. |
| const char* Gr_Clipboard | ( | void | ) |
Gets active system clipboard contents.
| void Gr_CloseWindow | ( | void | ) |
Terminates the windowing subsystem and cleans up remaining hardware resources.
| void Gr_DrawCircle | ( | int | cx, |
| int | cy, | ||
| float | r, | ||
| GrColor | c | ||
| ) |
Draws solid circle.
| cx | Center X index. |
| cy | Center Y index. |
| r | Circle radius in pixels. |
| c | Solid color. |
Draws solid rectangle.
| r | Layout bounds. |
| c | Solid color. |
Draws rounded corners solid rectangle.
| r | Layout bounds. |
| rad | Corner rounding radius factor (0.0 to 1.0). |
| c | Solid color. |
Draws lines of a rounded corners rectangle.
| r | Layout bounds. |
| rad | Rounding factor. |
| c | Line color. |
| void Gr_DrawText | ( | const char * | text, |
| float | x, | ||
| float | y, | ||
| int | size, | ||
| GrColor | c | ||
| ) |
Draws direct raster text on active canvas.
| text | Target string. |
| x | Horizontal pixel position. |
| y | Vertical pixel position. |
| size | Font height in pixels. |
| c | Font color. |
Draws a textured quad inside target coordinates.
| t | Texture register pointer. |
| src | Source cropped boundaries within the texture. |
| dst | Destination target placement boundaries. |
| tint | Color multiplier overlay. |
| int Gr_DropCount | ( | void | ) |
Gets count of dropped files.
| void Gr_DropFinish | ( | void | ) |
Cleans up drag-and-drop platform handles.
| const char* Gr_DropPath | ( | int | i | ) |
Gets path of dropped file by index.
| void Gr_EndFrame | ( | void | ) |
Signals the rendering backend that a frame has finished (swaps framebuffers).
| int Gr_FileDropped | ( | void | ) |
Checks if any files have been dropped onto the window area in this frame.
| int Gr_FileExists | ( | const char * | path | ) |
Checks if a file path exists and is accessible.
| path | System path string. |
| const char* Gr_FormatText | ( | const char * | fmt, |
| ... | |||
| ) |
Formats text string using printf-style layout arguments.
| fmt | printf-style format string. |
| int Gr_GetChar | ( | void | ) |
Pops latest character pressed from keyboard queue.
| const char* Gr_GetFileName | ( | const char * | filePath | ) |
Extracts the file name pointer (excluding folders) from a path string.
| filePath | Complete path string. |
| float Gr_GetFrameDelta | ( | void | ) |
Returns the duration time step in seconds between the previous frame and this frame.
| const char* Gr_GetPrevDirectoryPath | ( | const char * | dirPath | ) |
Resolves parent directory path.
| dirPath | Complete directory path. |
| int Gr_GetScreenH | ( | void | ) |
Gets the current window canvas height in pixels.
| int Gr_GetScreenW | ( | void | ) |
Gets the current window canvas width in pixels.
| float Gr_GetTime | ( | void | ) |
Returns total time elapsed in seconds since the window context started.
| int Gr_GetWheel | ( | void | ) |
Gets mouse wheel offset delta.
| const char* Gr_GetWorkingDirectory | ( | void | ) |
Gets current process working directory (CWD) path.
| void Gr_InitWindow | ( | int | w, |
| int | h, | ||
| const char * | title | ||
| ) |
Initialises the application window and renderer context.
| w | Window width. |
| h | Window height. |
| title | UTF-8 window title. |
| int Gr_IsPathFile | ( | const char * | path | ) |
Checks whether the given path represents a file or a directory.
| path | Target path string. |
| int Gr_KeyDown | ( | int | key | ) |
Checks if keyboard key is being held.
| int Gr_KeyPressed | ( | int | key | ) |
Checks if keyboard key was clicked.
| GrFilePathList Gr_LoadDirectoryFiles | ( | const char * | dirPath | ) |
Loads all filenames/directories inside a specified folder.
| dirPath | Folder path string. |
| int Gr_MakeTextureRGBA | ( | GrTexture * | t, |
| const unsigned char * | rgba, | ||
| int | w, | ||
| int | h | ||
| ) |
Allocates dynamic texture mapping using raw RGBA pixel arrays.
| t | Abstract texture destination container. |
| rgba | Pixel bytes. |
| w | Texture width. |
| h | Texture height. |
| GrRect Gr_MeasureText | ( | const char * | text, |
| int | size | ||
| ) |
Computes width bounds for a text string under a target font height size.
| text | UTF-8 string. |
| size | Font height in pixels. |
| int Gr_MouseDown | ( | int | btn | ) |
Checks if a mouse button is currently held down.
| int Gr_MousePressed | ( | int | btn | ) |
Checks if a mouse button was clicked.
| int Gr_MouseX | ( | void | ) |
Gets active cursor horizontal pixel index.
| int Gr_MouseY | ( | void | ) |
Gets active cursor vertical pixel index.
| void Gr_ScissorBegin | ( | int | x, |
| int | y, | ||
| int | w, | ||
| int | h | ||
| ) |
Sets a rectangular scissor clipping box on drawing calls.
| x | Origin X coordinate. |
| y | Origin Y coordinate. |
| w | Clipping area width. |
| h | Clipping area height. |
| void Gr_ScissorEnd | ( | void | ) |
Disables scissor clipping bounding boxes.
| void Gr_SetMinSize | ( | int | w, |
| int | h | ||
| ) |
resticts the minimum allowable window sizing for resizable targets.
| w | Minimum width limit. |
| h | Minimum height limit. |
| void Gr_SetTargetFPS | ( | int | fps | ) |
resticts the rendering execution speed to the target frames per second.
| fps | Target FPS (e.g. 60). |
| void Gr_UnloadDirectoryFiles | ( | GrFilePathList | list | ) |
Deallocates directory list memory allocations.
| list | Direct container to clean. |
| void Gr_UnloadTexture | ( | GrTexture * | t | ) |
Deallocates hardware graphics memory registers used by a texture.
| t | Texture pointer to clean. |
| void Gr_UpdateTexture | ( | GrTexture * | t, |
| const unsigned char * | rgba | ||
| ) |
Copies new raw RGBA pixel bytes directly into an active texture VRAM address.
| t | Active texture container. |
| rgba | New pixel bytes (must match width * height * 4). |
| int Gr_WindowShouldClose | ( | void | ) |
Checks if the OS window closing event (close button, Alt+F4) has been triggered.