Nox Engine
 
Loading...
Searching...
No Matches
TextureManager Struct Reference

Provides a centralized, static interface for all texture-related operations. More...

#include <TextureManager.h>

Collaboration diagram for TextureManager:
Collaboration graph

Static Public Member Functions

static SDL_Point GetSizeOfSurface (const char *fileName)
 Gets the dimensions of an image file without loading the full texture.
 
static SDL_TextureLoadTexture (const char *fileName)
 Loads a texture from an image file.
 
static SDL_TextureLoadTexture (const SDL_Colour colour, const char *text)
 Creates a texture by rendering text.
 
static SDL_TextureLoadTexture (SDL_Rect &rect, SDL_Colour colour)
 Creates a solid-color rectangular texture.
 
static void DrawTexture (SDL_Texture *tex, SDL_Rect &src, SDL_Rect &dest)
 Draws a portion of a texture.
 
static void DrawTexture (SDL_Texture *tex, SDL_Rect &dest)
 Draws an entire texture to a destination rectangle.
 
static void DrawTexture (SDL_Texture *tex, SDL_Rect &src, SDL_Rect &dest, const double angle)
 Draws a portion of a texture with rotation.
 
static void DrawTexture (SDL_Texture *tex, SDL_Rect &dest, const double angle)
 Draws an entire texture with rotation.
 

Static Public Attributes

static TTF_Fontfont
 The global font used for text rendering.
 

Detailed Description

Provides a centralized, static interface for all texture-related operations.

This class handles loading textures from files, creating textures from text or colors, and drawing them to the global renderer.

Member Function Documentation

◆ DrawTexture() [1/4]

void TextureManager::DrawTexture ( SDL_Texture tex,
SDL_Rect dest 
)
static

Draws an entire texture to a destination rectangle.

Parameters
texThe source texture.
destThe destination rectangle on the screen.
Here is the call graph for this function:

◆ DrawTexture() [2/4]

void TextureManager::DrawTexture ( SDL_Texture tex,
SDL_Rect dest,
const double  angle 
)
static

Draws an entire texture with rotation.

Parameters
texThe source texture.
destThe destination rectangle.
angleThe rotation angle in degrees.
Here is the call graph for this function:

◆ DrawTexture() [3/4]

void TextureManager::DrawTexture ( SDL_Texture tex,
SDL_Rect src,
SDL_Rect dest 
)
static

Draws a portion of a texture.

Parameters
texThe source texture.
srcThe source rectangle defining the portion to draw.
destThe destination rectangle on the screen.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DrawTexture() [4/4]

void TextureManager::DrawTexture ( SDL_Texture tex,
SDL_Rect src,
SDL_Rect dest,
const double  angle 
)
static

Draws a portion of a texture with rotation.

Parameters
texThe source texture.
srcThe source rectangle.
destThe destination rectangle.
angleThe rotation angle in degrees.
Here is the call graph for this function:

◆ GetSizeOfSurface()

SDL_Point TextureManager::GetSizeOfSurface ( const char fileName)
static

Gets the dimensions of an image file without loading the full texture.

Parameters
fileNameThe path to the image file.
Returns
An SDL_Point containing the width and height.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadTexture() [1/3]

SDL_Texture * TextureManager::LoadTexture ( const char fileName)
static

Loads a texture from an image file.

Parameters
fileNameThe path to the image file.
Returns
A pointer to the loaded SDL_Texture.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadTexture() [2/3]

SDL_Texture * TextureManager::LoadTexture ( const SDL_Colour  colour,
const char text 
)
static

Creates a texture by rendering text.

Parameters
colourThe color of the text.
textThe string to render.
Returns
A pointer to the created SDL_Texture.
Here is the call graph for this function:

◆ LoadTexture() [3/3]

SDL_Texture * TextureManager::LoadTexture ( SDL_Rect rect,
SDL_Colour  colour 
)
static

Creates a solid-color rectangular texture.

Parameters
rectThe dimensions of the texture to create.
colourThe color of the texture.
Returns
A pointer to the created SDL_Texture.
Here is the call graph for this function:

The documentation for this struct was generated from the following files: