Oficina Framework  1.3
Games Framework
OficinaFramework::RenderingSystem::Texture Class Reference

Represents a texture. Use RenderingSystem::TexturePool to allocate a new Texture. More...

#include <RenderingSystem.hpp>

Public Member Functions

vec2dw GetSize () const
 Size of the image loaded into the texture. More...
 
GLuint GetName () const
 Name of the texture, as recognized by OpenGL. More...
 
std::string GetPath () const
 Path to the image on disk or PATH. More...
 
void Draw (vec2 Position, vec2 DestinationSize, vec2 SrcPosition, vec2 SrcSize, float angle, float transparency, vec2 Hotspot, Color4 tint, RenderProperty rp=RENDER_NORMALLY, RenderEffect re=MODULATE_EFFECT)
 Draws a rectangle of the texture on a destination rectangle. More...
 
void Draw (vec2 Position, vec2 DestinationSize, vec2 SrcPosition, vec2 SrcSize, float angle, float transparency, Color4 tint, RenderProperty rp=RENDER_NORMALLY, RenderEffect re=MODULATE_EFFECT)
 Draws a rectangle of the texture on a destination rectangle. More...
 
void Draw (vec2 Position, vec2 DestinationSize, float angle, float transparency, Color4 tint, RenderProperty rp=RENDER_NORMALLY, RenderEffect re=MODULATE_EFFECT)
 Draws the current texture on a destination rectangle. More...
 
void Draw (vec2 Position, vec2 DestinationSize, float angle, Color4 tint, RenderProperty rp=RENDER_NORMALLY, RenderEffect re=MODULATE_EFFECT)
 Draws the current texture on a destination rectangle. More...
 
void Draw (vec2 Position, vec2 DestinationSize, Color4 tint, RenderProperty rp=RENDER_NORMALLY, RenderEffect re=MODULATE_EFFECT)
 Draws the current texture on a destination rectangle. More...
 
void Draw (vec2 Position, float transparency, Color4 tint, RenderProperty rp=RENDER_NORMALLY, RenderEffect re=MODULATE_EFFECT)
 Draws the current texture on a certain point. More...
 
void Draw (vec2 Position, Color4 tint, float scale, RenderProperty rp=RENDER_NORMALLY, RenderEffect re=MODULATE_EFFECT)
 Draws the current texture on a certain point. More...
 
void Draw (vec2 Position, Color4 tint, RenderProperty rp=RENDER_NORMALLY, RenderEffect re=MODULATE_EFFECT)
 Draws the current texture on a certain point. More...
 

Friends

class RenderingSystem::TexturePool
 

Detailed Description

Represents a texture. Use RenderingSystem::TexturePool to allocate a new Texture.

Member Function Documentation

◆ Draw() [1/8]

void OficinaFramework::RenderingSystem::Texture::Draw ( vec2  Position,
vec2  DestinationSize,
vec2  SrcPosition,
vec2  SrcSize,
float  angle,
float  transparency,
vec2  Hotspot,
Color4  tint,
RenderProperty  rp = RENDER_NORMALLY,
RenderEffect  re = MODULATE_EFFECT 
)

Draws a rectangle of the texture on a destination rectangle.

Parameters
PositionTop left vertex of the destination quad.
DestinationSizeWidth and height of the destination quad.
SrcPositionTop left vertex of the source quad.
SrcSizeWidth and height of the source quad.
angleAngle in degrees, relative to the top left of the image, in which it should be rotated.
transparencyAlpha rating for rendering the whole texture.
HotspotPoint on the texture to be considered the center of the texture.
tintColor to tint the sprite. Defaults to White (1.0f, 1.0f, 1.0f, 1.0f). The alpha factor will be used to measure intensity of tinting.
rpProperty regarding whether the texture will be flipped in some way or not. Defaults to RENDER_NORMALLY.
reEffect when rendering the texture. Defaults to MODULATE_EFFECT.

◆ Draw() [2/8]

void OficinaFramework::RenderingSystem::Texture::Draw ( vec2  Position,
vec2  DestinationSize,
vec2  SrcPosition,
vec2  SrcSize,
float  angle,
float  transparency,
Color4  tint,
RenderProperty  rp = RENDER_NORMALLY,
RenderEffect  re = MODULATE_EFFECT 
)

Draws a rectangle of the texture on a destination rectangle.

Parameters
PositionTop left vertex of the destination quad.
DestinationSizeWidth and height of the destination quad.
SrcPositionTop left vertex of the source quad.
SrcSizeWidth and height of the source quad.
angleAngle in degrees, relative to the top left of the image, in which it should be rotated.
transparencyAlpha rating for rendering the whole texture.
tintColor to tint the sprite. Defaults to White (1.0f, 1.0f, 1.0f, 1.0f). The alpha factor will be used to measure intensity of tinting.
rpProperty regarding whether the texture will be flipped in some way or not. Defaults to RENDER_NORMALLY.
reEffect when rendering the texture. Defaults to MODULATE_EFFECT.

◆ Draw() [3/8]

void OficinaFramework::RenderingSystem::Texture::Draw ( vec2  Position,
vec2  DestinationSize,
float  angle,
float  transparency,
Color4  tint,
RenderProperty  rp = RENDER_NORMALLY,
RenderEffect  re = MODULATE_EFFECT 
)

Draws the current texture on a destination rectangle.

Parameters
PositionTop left vertex of the destination quad.
DestinationSizeWidth and height of the destination quad.
angleAngle in degrees, relative to the top left of the image, in which it should be rotated.
transparencyAlpha rating for rendering the whole texture.
tintColor to tint the sprite. Defaults to White (1.0f, 1.0f, 1.0f, 1.0f). The alpha factor will be used to measure intensity of tinting.
rpProperty regarding whether the texture will be flipped in some way or not. Defaults to RENDER_NORMALLY.
reEffect when rendering the texture. Defaults to MODULATE_EFFECT.

◆ Draw() [4/8]

void OficinaFramework::RenderingSystem::Texture::Draw ( vec2  Position,
vec2  DestinationSize,
float  angle,
Color4  tint,
RenderProperty  rp = RENDER_NORMALLY,
RenderEffect  re = MODULATE_EFFECT 
)

Draws the current texture on a destination rectangle.

Parameters
PositionTop left vertex of the destination quad.
DestinationSizeWidth and height of the destination quad.
angleAngle in degrees, relative to the top left of the image, in which it should be rotated.
tintColor to tint the sprite. Defaults to White (1.0f, 1.0f, 1.0f, 1.0f). The alpha factor will be used to measure intensity of tinting.
rpProperty regarding whether the texture will be flipped in some way or not. Defaults to RENDER_NORMALLY.
reEffect when rendering the texture. Defaults to MODULATE_EFFECT.

◆ Draw() [5/8]

void OficinaFramework::RenderingSystem::Texture::Draw ( vec2  Position,
vec2  DestinationSize,
Color4  tint,
RenderProperty  rp = RENDER_NORMALLY,
RenderEffect  re = MODULATE_EFFECT 
)

Draws the current texture on a destination rectangle.

Parameters
PositionTop left vertex of the destination quad.
DestinationSizeWidth and height of the destination quad.
tintColor to tint the sprite. Defaults to White (1.0f, 1.0f, 1.0f, 1.0f). The alpha factor will be used to measure intensity of tinting.
rpProperty regarding whether the texture will be flipped in some way or not. Defaults to RENDER_NORMALLY.
reEffect when rendering the texture. Defaults to MODULATE_EFFECT.

◆ Draw() [6/8]

void OficinaFramework::RenderingSystem::Texture::Draw ( vec2  Position,
float  transparency,
Color4  tint,
RenderProperty  rp = RENDER_NORMALLY,
RenderEffect  re = MODULATE_EFFECT 
)

Draws the current texture on a certain point.

Parameters
PositionTop left vertex of the texture to be rendered.
transparencyAlpha rating for rendering the whole texture.
tintColor to tint the sprite. Defaults to White (1.0f, 1.0f, 1.0f, 1.0f). The alpha factor will be used to measure intensity of tinting.
rpProperty regarding whether the texture will be flipped in some way or not. Defaults to RENDER_NORMALLY.
reEffect when rendering the texture. Defaults to MODULATE_EFFECT.

◆ Draw() [7/8]

void OficinaFramework::RenderingSystem::Texture::Draw ( vec2  Position,
Color4  tint,
float  scale,
RenderProperty  rp = RENDER_NORMALLY,
RenderEffect  re = MODULATE_EFFECT 
)

Draws the current texture on a certain point.

Parameters
PositionTop left vertex of the texture to be rendered.
tintColor to tint the sprite. Defaults to White (1.0f, 1.0f, 1.0f, 1.0f). The alpha factor will be used to measure intensity of tinting.
scaleMagnification of the texture to be drawn. Defaults to 1x (1.0f).
rpProperty regarding whether the texture will be flipped in some way or not. Defaults to RENDER_NORMALLY.
reEffect when rendering the texture. Defaults to MODULATE_EFFECT.

◆ Draw() [8/8]

void OficinaFramework::RenderingSystem::Texture::Draw ( vec2  Position,
Color4  tint,
RenderProperty  rp = RENDER_NORMALLY,
RenderEffect  re = MODULATE_EFFECT 
)

Draws the current texture on a certain point.

Parameters
PositionTop left vertex of the texture to be rendered.
tintColor to tint the sprite. Defaults to White (1.0f, 1.0f, 1.0f, 1.0f). The alpha factor will be used to measure intensity of tinting.
rpProperty regarding whether the texture will be flipped in some way or not. Defaults to RENDER_NORMALLY.
reEffect when rendering the texture. Defaults to MODULATE_EFFECT.

◆ GetName()

GLuint OficinaFramework::RenderingSystem::Texture::GetName ( ) const

Name of the texture, as recognized by OpenGL.

Returns
Texture identifier on the GPU.

◆ GetPath()

std::string OficinaFramework::RenderingSystem::Texture::GetPath ( ) const

Path to the image on disk or PATH.

Returns
Actual path to the texture on PATH.

◆ GetSize()

vec2dw OficinaFramework::RenderingSystem::Texture::GetSize ( ) const

Size of the image loaded into the texture.

Returns
A dword-precision vec2 containing the texture's width and height.

Friends And Related Function Documentation

◆ RenderingSystem::TexturePool

friend class RenderingSystem::TexturePool
friend

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