CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::TextureAtlasUtility Class Reference

Utility class used for texture atlas layouts. More...

#include <CeresEngine/Texture/TextureAtlasLayout.hpp>

Classes

struct  Element
 Represents a single element used as in input to TextureAtlasUtility. More...
 
struct  Page
 Describes a single page of the texture atlas. More...
 

Static Public Member Functions

static Vector< PagecreateAtlasLayout (Vector< Element > &elements, UInt32 width, UInt32 height, UInt32 maxWidth, UInt32 maxHeight, bool pow2=false)
 Creates an optimal texture layout by packing texture elements in order to end up with as little empty space as possible.
 

Detailed Description

Utility class used for texture atlas layouts.

Member Function Documentation

◆ createAtlasLayout()

static Vector< Page > CeresEngine::TextureAtlasUtility::createAtlasLayout ( Vector< Element > &  elements,
UInt32  width,
UInt32  height,
UInt32  maxWidth,
UInt32  maxHeight,
bool  pow2 = false 
)
static

Creates an optimal texture layout by packing texture elements in order to end up with as little empty space as possible.

Algorithm will split elements over multiple textures if they don't fit in a single texture.

Parameters
elementsElements to process. They need to have their input structures filled in, and this method will fill output when it returns.
widthInitial width of the atlas texture.
heightInitial height of the atlas texture.
maxWidthMaximum width the atlas texture is allowed to grow to, when elements don't fit.
maxHeightMaximum height the atlas texture is allowed to grow to, when elements don't fit.
pow2When true the resulting atlas size will always be a power of two.
Returns
One or more descriptors that determine the size of the final atlas textures. Texture elements will reference these pages with their output.page parameter.

The documentation for this class was generated from the following file: