Basic setup and management. More...
Basic setup and management.
Functions | |
TLN_Engine | TLN_Init (int hres, int vres, int numlayers, int numsprites, int numanimations) |
Initializes the graphic engine. More... | |
void | TLN_Deinit (void) |
Deinitialises current engine context and frees used resources. | |
bool | TLN_DeleteContext (TLN_Engine context) |
Deletes explicit context. More... | |
bool | TLN_SetContext (TLN_Engine context) |
Sets current engine context. More... | |
TLN_Engine | TLN_GetContext (void) |
Returns the current engine context. | |
void | TLN_SetTargetFps (int fps) |
Set Target fps (default 60) More... | |
int | TLN_GetTargetFps (void) |
Returns target fps. More... | |
int | TLN_GetWidth (void) |
Returns the width in pixels of the framebuffer. More... | |
int | TLN_GetHeight (void) |
Returns the height in pixels of the framebuffer. More... | |
uint32_t | TLN_GetNumObjects (void) |
Returns the number of objets used by the engine so far. More... | |
uint32_t | TLN_GetUsedMemory (void) |
Returns the total amount of memory used by the objects. More... | |
uint32_t | TLN_GetVersion (void) |
Retrieves Tilengine dll version. More... | |
int | TLN_GetNumLayers (void) |
Returns the number of layers specified during initialisation. More... | |
int | TLN_GetNumSprites (void) |
Returns the number of sprites specified during initialisation. More... | |
void | TLN_SetBGColor (uint8_t r, uint8_t g, uint8_t b) |
Sets the background color. More... | |
bool | TLN_SetBGColorFromTilemap (TLN_Tilemap tilemap) |
Sets the background color from a Tilemap defined color. More... | |
void | TLN_DisableBGColor (void) |
Disales background color rendering. If you know that the last background layer will always cover the entire screen, you can disable it to gain some performance. More... | |
bool | TLN_SetBGBitmap (TLN_Bitmap bitmap) |
Sets a static bitmap as background. More... | |
bool | TLN_SetBGPalette (TLN_Palette palette) |
Changes the palette for the background bitmap. More... | |
void | TLN_SetRenderTarget (uint8_t *data, int pitch) |
Sets the output surface for rendering. More... | |
void | TLN_UpdateFrame (int frame) |
Draws the frame to the previously specified render target. More... | |
void | TLN_SetLoadPath (const char *path) |
Sets base path for TLN_LoadXXX functions. More... | |
void | TLN_SetCustomBlendFunction (TLN_BlendFunction) |
Sets custom blend function to use when BLEND_CUSTOM mode is selected. More... | |
void | TLN_SetLogLevel (TLN_LogLevel log_level) |
Sets logging level for current instance. More... | |
bool | TLN_OpenResourcePack (const char *filename, const char *key) |
Open the resource package with optional aes-128 key and binds it. More... | |
void | TLN_CloseResourcePack (void) |
Closes current resource package and unbinds it. More... | |
TLN_Engine TLN_Init | ( | int | hres, |
int | vres, | ||
int | numlayers, | ||
int | numsprites, | ||
int | numanimations | ||
) |
Initializes the graphic engine.
hres | horizontal resolution in pixels |
vres | vertical resolution in pixels |
numlayers | number of layers |
numsprites | number of sprites |
numanimations | number of palette animation slots |
Performs initialisation of the main engine, creates the viewport with the specified dimensions and allocates the number of layers, sprites and animation slots
bool TLN_DeleteContext | ( | TLN_Engine | context | ) |
Deletes explicit context.
context | context reference to delete |
bool TLN_SetContext | ( | TLN_Engine | context | ) |
Sets current engine context.
context | TLN_Engine object to set as current context, returned by TLN_Init() |
void TLN_SetTargetFps | ( | int | fps | ) |
Set Target fps (default 60)
fps | Target fps |
int TLN_GetTargetFps | ( | void | ) |
Returns target fps.
int TLN_GetWidth | ( | void | ) |
Returns the width in pixels of the framebuffer.
int TLN_GetHeight | ( | void | ) |
Returns the height in pixels of the framebuffer.
uint32_t TLN_GetNumObjects | ( | void | ) |
Returns the number of objets used by the engine so far.
uint32_t TLN_GetUsedMemory | ( | void | ) |
Returns the total amount of memory used by the objects.
uint32_t TLN_GetVersion | ( | void | ) |
Retrieves Tilengine dll version.
int TLN_GetNumLayers | ( | void | ) |
Returns the number of layers specified during initialisation.
int TLN_GetNumSprites | ( | void | ) |
Returns the number of sprites specified during initialisation.
void TLN_SetBGColor | ( | uint8_t | r, |
uint8_t | g, | ||
uint8_t | b | ||
) |
Sets the background color.
r | red component (0-255) |
g | green component (0-255) |
b | blue component (0-255) |
The background color is the color of the pixel when there isn't any layer or sprite at that position.
bool TLN_SetBGColorFromTilemap | ( | TLN_Tilemap | tilemap | ) |
Sets the background color from a Tilemap defined color.
tilemap | Reference to the tilemap with the background color to set |
void TLN_DisableBGColor | ( | void | ) |
Disales background color rendering. If you know that the last background layer will always cover the entire screen, you can disable it to gain some performance.
bool TLN_SetBGBitmap | ( | TLN_Bitmap | bitmap | ) |
Sets a static bitmap as background.
bitmap | Reference to bitmap for the background. Set NULL to disable |
Sets an optional bitmap instead of a solid color where there is no layer or sprite. Unlike tilemaps or sprites, this bitmap cannot be moved and has no transparency
bool TLN_SetBGPalette | ( | TLN_Palette | palette | ) |
Changes the palette for the background bitmap.
palette | Reference to palette |
void TLN_SetRenderTarget | ( | uint8_t * | data, |
int | pitch | ||
) |
Sets the output surface for rendering.
data | Pointer to the start of the target framebuffer |
pitch | Number of bytes per each scanline of the framebuffer |
Sets the output surface for rendering. Tilengine doesn't provide a windowing or hardware video access. The application is responsible of allocating and maintaining the surface where tilengine does the rendering. It can be a SDL surface, a locked DirectX surface, an OpenGL texture, or whatever the application has access to.
void TLN_UpdateFrame | ( | int | frame | ) |
Draws the frame to the previously specified render target.
frame | Optional frame number. Set to 0 to autoincrement from previous value |
void TLN_SetLoadPath | ( | const char * | path | ) |
Sets base path for TLN_LoadXXX functions.
path | Base path. Files will load at path/filename. Can be NULL |
void TLN_SetCustomBlendFunction | ( | uint8_t(*)(uint8_t src, uint8_t dst) | blend_function | ) |
Sets custom blend function to use when BLEND_CUSTOM mode is selected.
blend_function | pointer to a user-provided function that takes two parameters: source component intensity, destination component intensity, and returns the desired intensity. This function is called for each RGB component when blending is enabled |
void TLN_SetLogLevel | ( | TLN_LogLevel | log_level | ) |
Sets logging level for current instance.
log_level | value to set, member of the TLN_LogLevel enumeration |
bool TLN_OpenResourcePack | ( | const char * | filename, |
const char * | key | ||
) |
Open the resource package with optional aes-128 key and binds it.
filename | file with the resource package (.dat extension) |
key | optional null-terminated ASCII string with aes decryption key |
void TLN_CloseResourcePack | ( | void | ) |
Closes current resource package and unbinds it.
Last update on Tue Aug 29 2023 for Tilengine 2.15.1