Give the GameScene and Entities something to display, Text, Sprites and AnimatedSprites help bring the world to life. More...
Classes | |
class | AnimatedSprite |
class | AnimationSequence |
class | BoxShape |
class | Camera |
class | CircleShape |
class | Color |
class | FullScreenQuad |
class | Graphic |
class | GraphicList |
class | Line |
class | LineContainer |
class | OutlinedBoxShape |
class | OutlinedCircleShape |
class | OutlinedPolygonShape |
class | PolygonShape |
class | RenderTarget |
class | Sprite |
struct | SpriteFrame |
class | SpriteManager |
class | SpriteMap |
class | SpriteSheet |
class | Text |
class | TextureManager |
Typedefs | |
typedef float | TexelSpace |
typedef tbCore::uint16 | PixelSpace |
typedef tbCore::uint32 | TextureHandle |
Enumerations | |
enum | ColorPalette { ColorPalette::Opaque, ColorPalette::Transparent, ColorPalette::White, ColorPalette::Black, ColorPalette::Red, ColorPalette::Yellow, ColorPalette::Green, ColorPalette::Cyan, ColorPalette::Blue, ColorPalette::Magenta, ColorPalette::LightGrey, ColorPalette::LightGray = LightGrey, ColorPalette::Grey, ColorPalette::Gray = Grey, ColorPalette::DarkGrey, ColorPalette::DarkGray = DarkGrey, ColorPalette::Brown, ColorPalette::Purple, ColorPalette::MonkyBlue, ColorPalette::MonkyOrange } |
enum | GifOutputSize { Full, Half } |
enum | AnchorLocation { kAnchorCenter = 0, kAnchorTopLeft, kAnchorTopCenter, kAnchorTopRight, kAnchorCenterLeft, kAnchorCenterRight, kAnchorBottomLeft, kAnchorBottomCenter, kAnchorBottomRight } |
Functions | |
void | SetActiveCamera (Camera &camera) |
void | SetActiveCamera (Camera *camera) |
Camera & | GetActiveCamera (void) |
void | GifPerformCapture (const float deltaTime, const bool toggleCapture, const GifOutputSize &outputSize=GifOutputSize::Half) |
void | GifCaptureCleanup (void) |
PixelSpace | ScreenWidth (void) |
PixelSpace | ScreenHeight (void) |
float | ScreenAspectRatio (void) |
tbMath::Vector2 | ScreenCenter (void) |
Variables | |
SpriteManager | theSpriteManager |
const TextureHandle | kInvalidTexture |
const TextureHandle & | kBlankTexture |
TextureManager & | theTextureManager |
TODO: TIM: Documentation: This is still early in development and the Graphics framework is still being designed.
Represents a measurement in pixel space be it the width/height of an image in pixels, or the location on the screen or texture in pixels.
typedef float TurtleBrains::Graphics::TexelSpace |
Represents a value from 0 to 1 in texture space for the width/height or location on a texture.
A TextureHandle is a unique value for each unique texture created with the TextureManager. Use the handle to access the textures properties and to destroy any resources associated.
TODO: TIM: Implementation: Maybe this should be a tiny class/object that automatically cleans up resources?
These locations are used in the Sprite::SetOrigin() which takes an AnchorLocation.
Enumerator | |
---|---|
kAnchorCenter |
This anchor will set the origin to the center of the Sprite horizontally and vertically. |
kAnchorTopLeft |
This anchor will set the origin to the top-left corner, effectively: SetOrigin(0.0f, 0.0f). |
kAnchorTopCenter |
This anchor will set the origin to the top and horizontal center of the Sprite. |
kAnchorTopRight |
This anchor will set the origin to the top and right most corner of the Sprite. |
kAnchorCenterLeft |
This anchor will set the origin to the center vertically and left most edge of the Sprite. |
kAnchorCenterRight |
This anchor will set the origin to the center vertically and right most edge of the Sprite. |
kAnchorBottomLeft |
This anchor will set the origin to the bottom and left most corner of the Sprite. |
kAnchorBottomCenter |
This anchor will set the origin to the bottom edge and horizontal center of the Sprite. |
kAnchorBottomRight |
This anchor will set the origin to the bottom and right most corner of the Sprite. |
|
strong |
A simple palette that can be used to set/change colors quickly. This is one of the few ways to implicitly create a Color object, to be used directly with TurtleBrains::Graphic::SetColor().
Camera& TurtleBrains::Graphics::GetActiveCamera | ( | void | ) |
Retrieves the currently active camera, which there can only ever be one active camera and there is always an active camera.
void TurtleBrains::Graphics::GifCaptureCleanup | ( | void | ) |
This should be called during shutdown if GifPerformCapture had been called as it will wait until any worker threads cleanly end and join back to main thread.
void TurtleBrains::Graphics::GifPerformCapture | ( | const float | deltaTime, |
const bool | toggleCapture, | ||
const GifOutputSize & | outputSize = GifOutputSize::Half |
||
) |
This is the only function that needs to be called, once per frame during Update().
deltaTime | The amount of time since the previous call to PerformCapture. |
toggleCapture | True if the capture state should be toggled on/off or off/on depending on the current state. Typically this would be a value from IsKeyPressed(). |
outputSize | Will change the size of the GIF that is exported from FULL, to Half to reduce size for social media platforms, at the cost of reduced quality. |
float TurtleBrains::Graphics::ScreenAspectRatio | ( | void | ) |
Computes and returns the aspect ratio of the screen, width/height. 1920/1080 ~= 1.77778.
tbMath::Vector2 TurtleBrains::Graphics::ScreenCenter | ( | void | ) |
Creates and returns a Vector2 object of the location of the center of the screen, half width / height.
PixelSpace TurtleBrains::Graphics::ScreenHeight | ( | void | ) |
Returns the height of the screen/window in pixels.
PixelSpace TurtleBrains::Graphics::ScreenWidth | ( | void | ) |
Returns the width of the screen/window in pixels.
void TurtleBrains::Graphics::SetActiveCamera | ( | Camera & | camera | ) |
Sets the current camera to be inactive and sets the provided camera as an active camera that will not be cleaned up. It is expected the camera object provided will be in existance until it is no longer the active camera.
camera | The newly activated camera ready to apply to the view. |
void TurtleBrains::Graphics::SetActiveCamera | ( | Camera * | camera | ) |
Sets the current camera to be inactive and sets the provided camera as an active camera that will automatically be cleaned up by calling delete on the object once a new camera becomes active.
camera | A pointer to a camera object that was allocated with new. This object will become the active camera ready to apply to the view, and will automatically get deleted once a new camera is activated. |
const TextureHandle& TurtleBrains::Graphics::kBlankTexture |
This is a small, white texture that is automatically loaded for rendering Lines without a separate shader.
const TextureHandle TurtleBrains::Graphics::kInvalidTexture |
This is a constant value that represents a null/invalid texture handle.
SpriteManager TurtleBrains::Graphics::theSpriteManager |
Instead of creating your own SpriteManager object, this is a way to access it as a singleton. This may turn into a pointer to the object, although the SpriteManager api will remain the same.
TextureManager& TurtleBrains::Graphics::theTextureManager |
Instead of creating your own TextureManager object, this is a way to access it as a singleton. This may turn into a pointer to the object, although the TextureManager API will remain the same.