Arctic Engine
Designed to give you control and not take anything away.
Collaboration diagram for Drawing:

Classes

class  arctic::DecoratedFrame
 
class  arctic::Font
 Class representing a font. More...
 
class  arctic::FontInstance
 Class representing a font instance. More...
 
class  arctic::HwSprite
 
struct  arctic::HwSpriteDrawing
 
class  arctic::Sprite
 

Enumerations

enum  arctic::CloneTransform {
  arctic::kCloneUntransformed , arctic::kCloneRotateCw90 , arctic::kCloneRotateCcw90 , arctic::kCloneRotate180 ,
  arctic::kCloneMirrorLr , arctic::kCloneMirrorUd
}
 Enum representing the transformation to apply when cloning a sprite. More...
 
enum  arctic::DrawBlendingMode {
  kCopyRgba = 0 , arctic::kDrawBlendingModeCopyRgba = 0 , kAlphaBlend = 1 , arctic::kDrawBlendingModeAlphaBlend = 1 ,
  kColorize = 2 , arctic::kDrawBlendingModeColorize = 2 , arctic::kDrawBlendingModeAdd = 3 , arctic::kDrawBlendingModeSolidColor = 4 ,
  arctic::kDrawBlendingModePremultipliedAlphaBlend = 5
}
 Enum representing the blending mode for drawing. More...
 
enum  arctic::DrawFilterMode { arctic::kFilterNearest , arctic::kFilterBilinear }
 Enum representing the filter mode for drawing. More...
 
enum  arctic::TextAlignment { kTextAlignmentLeft = 0 , kTextAlignmentCenter = 1 , kTextAlignmentRight = 2 }
 Enumeration of text alignment options.
 
enum  arctic::TextOrigin {
  arctic::kTextOriginBottom = 0 , arctic::kTextOriginFirstBase = 1 , arctic::kTextOriginLastBase = 2 , arctic::kTextOriginTop = 3 ,
  arctic::kTextOriginCenter = 4
}
 The origin point used for rendering. More...
 

Functions

Vec2F arctic::BlockEdgePos (Vec2F lower_left_pos, Vec2F size, float corner_radius, Vec2F direction)
 Calculate the position of a point on the edge of a block. More...
 
void arctic::Clear ()
 Clear the backbuffer with black color.
 
void arctic::Clear (Rgba color)
 Clear the backbuffer with the color specified. More...
 
void arctic::DrawArrow (Sprite &to_sprite, Vec2F source_pos, Vec2F destination_pos, float body_width, float head_width, float head_length, Rgba color)
 Draw an arrow shape. More...
 
void arctic::DrawArrow (Sprite &to_sprite, Vec2F source_pos, Vec2F destination_pos, float body_width, float head_width, float head_length, Rgba color, float border_size, Rgba border_color)
 Draw an arrow shape. The shape has a border. More...
 
void arctic::DrawBlock (Sprite &to_sprite, Vec2F lower_left_pos, Vec2F size, float corner_radius, Rgba color)
 Draw a rounded corner rectangular block shape. More...
 
void arctic::DrawBlock (Sprite &to_sprite, Vec2F lower_left_pos, Vec2F size, float corner_radius, Rgba color, float border_size, Rgba border_color)
 Draw a rounded corner rectangular block shape. The shape has a border. More...
 
void arctic::DrawCircle (Sprite to_sprite, Vec2Si32 c, Si32 r, Rgba color)
 Draws a solid color filled circle to a sprite. More...
 
void arctic::DrawCircle (Vec2Si32 c, Si32 r, Rgba color)
 Draws a solid color filled circle. More...
 
void arctic::DrawLine (Sprite to_sprite, Vec2Si32 a, Vec2Si32 b, Rgba color)
 Draws a solid color line from point a to point b to a sprite. More...
 
void arctic::DrawLine (Sprite to_sprite, Vec2Si32 a, Vec2Si32 b, Rgba color_a, Rgba color_b)
 Draws a gradient color line from point a to point b to a sprite. More...
 
void arctic::DrawLine (Vec2Si32 a, Vec2Si32 b, Rgba color)
 Draws a solid color line from point a to point b. More...
 
void arctic::DrawLine (Vec2Si32 a, Vec2Si32 b, Rgba color_a, Rgba color_b)
 Draws a gradient color line from point a to point b. More...
 
void arctic::DrawOval (Sprite to_sprite, Rgba color, Vec2Si32 ll, Vec2Si32 ur)
 Draws a solid color filled oval to a sprite. More...
 
void arctic::DrawOval (Sprite to_sprite, Vec2Si32 c, Vec2Si32 r, Rgba color)
 Draws a solid color filled oval to a sprite. More...
 
void arctic::DrawOval (Vec2Si32 c, Vec2Si32 r, Rgba color)
 Draws a solid color filled oval. More...
 
void arctic::DrawRectangle (Sprite to_sprite, Vec2Si32 ll, Vec2Si32 ur, Rgba color)
 Draws a solid color filled rectangle to a sprite. More...
 
void arctic::DrawRectangle (Vec2Si32 ll, Vec2Si32 ur, Rgba color)
 Draws a solid color filled rectangle. More...
 
void arctic::DrawTriangle (Sprite to_sprite, Vec2F a, Vec2F b, Vec2F c, Vec2F ta, Vec2F tb, Vec2F tc, Sprite texture, DrawBlendingMode blending_mode, DrawFilterMode filter_mode, Rgba in_color)
 Draws a textured triangle to a sprite. More...
 
void arctic::DrawTriangle (Sprite to_sprite, Vec2Si32 a, Vec2Si32 b, Vec2Si32 c, Rgba color)
 Draws a solid color filled triangle to a sprite. More...
 
void arctic::DrawTriangle (Sprite to_sprite, Vec2Si32 a, Vec2Si32 b, Vec2Si32 c, Rgba color_a, Rgba color_b, Rgba color_c)
 Draws a gradient color filled triangle to a sprite. More...
 
void arctic::DrawTriangle (Vec2Si32 a, Vec2Si32 b, Vec2Si32 c, Rgba color)
 Draws a solid color filled triangle. More...
 
void arctic::DrawTriangle (Vec2Si32 a, Vec2Si32 b, Vec2Si32 c, Rgba color_a, Rgba color_b, Rgba color_c)
 Draws a gradient color filled triangle. More...
 
Rgba arctic::GetPixel (const Sprite &from_sprite, Si32 x, Si32 y)
 Returns color of a pixel of a sprite at coordinates specified. More...
 
Rgba arctic::GetPixel (Si32 x, Si32 y)
 Returns color of a pixel at coordinates specified. More...
 
void arctic::ReplaceColor (Sprite to_sprite, Rgba old_color, Rgba new_color)
 Sets the new color to all the pixels of the old color. More...
 
void arctic::SetPixel (const Sprite &to_sprite, Si32 x, Si32 y, Rgba color)
 Sets color of a pixel of a sprite at coordinates specified. More...
 
void arctic::SetPixel (Si32 x, Si32 y, Rgba color)
 Sets color of a pixel at coordinates specified. More...
 
void arctic::ShowFrame ()
 Show the current backbuffer and update the input state.
 

Detailed Description

Enumeration Type Documentation

◆ CloneTransform

Enum representing the transformation to apply when cloning a sprite.

Enumerator
kCloneUntransformed 

No transformation.

kCloneRotateCw90 

Rotate 90 degrees clockwise.

kCloneRotateCcw90 

Rotate 90 degrees counter-clockwise.

kCloneRotate180 

Rotate 180 degrees.

kCloneMirrorLr 

Mirror horizontally.

kCloneMirrorUd 

Mirror vertically.

◆ DrawBlendingMode

Enum representing the blending mode for drawing.

Enumerator
kDrawBlendingModeCopyRgba 

Copy RGBA.

kDrawBlendingModeAlphaBlend 

Alpha blend.

kDrawBlendingModeColorize 

Colorize.

kDrawBlendingModeAdd 

Add.

kDrawBlendingModeSolidColor 

Solid color.

kDrawBlendingModePremultipliedAlphaBlend 

Premultiplied alpha blend.

◆ DrawFilterMode

Enum representing the filter mode for drawing.

Enumerator
kFilterNearest 

Nearest neighbor filter.

kFilterBilinear 

Bilinear filter.

◆ TextOrigin

The origin point used for rendering.

Enumerator
kTextOriginBottom 

The bottom of the last text line.

kTextOriginFirstBase 

The base of the first text line.

kTextOriginLastBase 

The base of the last text line.

kTextOriginTop 

The top of the first text line.

kTextOriginCenter 

The center between the top of the first and the bottom of the last text line.

Function Documentation

◆ BlockEdgePos()

Vec2F arctic::BlockEdgePos ( Vec2F  lower_left_pos,
Vec2F  size,
float  corner_radius,
Vec2F  direction 
)

Calculate the position of a point on the edge of a block.

Parameters
[in]lower_left_posLower-left block corner position.
[in]sizeBlock size.
[in]corner_radiusExternal radius of block corners.
[in]directionDirection vector from the center of the block to the edge.
Returns
Position of the point on the edge of the block.

◆ Clear()

void arctic::Clear ( Rgba  color)

Clear the backbuffer with the color specified.

Parameters
[in]colorColor to clear the backbuffer with.
Here is the call graph for this function:

◆ DrawArrow() [1/2]

void arctic::DrawArrow ( Sprite to_sprite,
Vec2F  source_pos,
Vec2F  destination_pos,
float  body_width,
float  head_width,
float  head_length,
Rgba  color 
)

Draw an arrow shape.

Parameters
[in]to_spriteSprite to draw the arrow on.
[in]source_posTail position (source point).
[in]destination_posHead position (destination point).
[in]body_widthTail width.
[in]head_widthHead width.
[in]head_lengthHead length.
[in]colorFill color of the arrow.
Here is the call graph for this function:

◆ DrawArrow() [2/2]

void arctic::DrawArrow ( Sprite to_sprite,
Vec2F  source_pos,
Vec2F  destination_pos,
float  body_width,
float  head_width,
float  head_length,
Rgba  color,
float  border_size,
Rgba  border_color 
)

Draw an arrow shape. The shape has a border.

Parameters
[in]to_spriteSprite to draw the arrow on.
[in]source_posTail position (source point).
[in]destination_posHead position (destination point).
[in]body_widthTail width.
[in]head_widthHead width.
[in]head_lengthHead length.
[in]colorFill color of the arrow.
[in]border_sizeBorder width.
[in]border_colorBorder color.

◆ DrawBlock() [1/2]

void arctic::DrawBlock ( Sprite to_sprite,
Vec2F  lower_left_pos,
Vec2F  size,
float  corner_radius,
Rgba  color 
)

Draw a rounded corner rectangular block shape.

Parameters
[in]to_spriteSprite to draw the block on.
[in]lower_left_posLower-left block corner position (as if it was not rounded).
[in]sizeBlock size.
[in]corner_radiusExternal radius of block corners.
[in]colorFill color of the block.
Here is the call graph for this function:

◆ DrawBlock() [2/2]

void arctic::DrawBlock ( Sprite to_sprite,
Vec2F  lower_left_pos,
Vec2F  size,
float  corner_radius,
Rgba  color,
float  border_size,
Rgba  border_color 
)

Draw a rounded corner rectangular block shape. The shape has a border.

Parameters
[in]to_spriteSprite to draw the block on.
[in]lower_left_posLower-left block corner position (as if it was not rounded).
[in]sizeBlock size.
[in]corner_radiusExternal radius of block corners.
[in]colorFill color of the block.
[in]border_sizeBorder width.
[in]border_colorBorder color.
Here is the call graph for this function:

◆ DrawCircle() [1/2]

void arctic::DrawCircle ( Sprite  to_sprite,
Vec2Si32  c,
Si32  r,
Rgba  color 
)

Draws a solid color filled circle to a sprite.

Parameters
[in]to_spriteSprite to draw the circle on.
[in]cCenter of the circle.
[in]rRadius of the circle.
[in]colorColor of the circle.
Here is the call graph for this function:

◆ DrawCircle() [2/2]

void arctic::DrawCircle ( Vec2Si32  c,
Si32  r,
Rgba  color 
)

Draws a solid color filled circle.

Parameters
[in]cCenter of the circle.
[in]rRadius of the circle.
[in]colorColor of the circle.
Here is the call graph for this function:

◆ DrawLine() [1/4]

void arctic::DrawLine ( Sprite  to_sprite,
Vec2Si32  a,
Vec2Si32  b,
Rgba  color 
)

Draws a solid color line from point a to point b to a sprite.

Parameters
[in]to_spriteSprite to draw the line on.
[in]aStarting point of the line.
[in]bEnding point of the line.
[in]colorColor of the line.
Here is the call graph for this function:

◆ DrawLine() [2/4]

void arctic::DrawLine ( Sprite  to_sprite,
Vec2Si32  a,
Vec2Si32  b,
Rgba  color_a,
Rgba  color_b 
)

Draws a gradient color line from point a to point b to a sprite.

Parameters
[in]to_spriteSprite to draw the line on.
[in]aStarting point of the line.
[in]bEnding point of the line.
[in]color_aColor at the starting point.
[in]color_bColor at the ending point.
Here is the caller graph for this function:

◆ DrawLine() [3/4]

void arctic::DrawLine ( Vec2Si32  a,
Vec2Si32  b,
Rgba  color 
)

Draws a solid color line from point a to point b.

Parameters
[in]aStarting point of the line.
[in]bEnding point of the line.
[in]colorColor of the line.
Here is the call graph for this function:

◆ DrawLine() [4/4]

void arctic::DrawLine ( Vec2Si32  a,
Vec2Si32  b,
Rgba  color_a,
Rgba  color_b 
)

Draws a gradient color line from point a to point b.

Parameters
[in]aStarting point of the line.
[in]bEnding point of the line.
[in]color_aColor at the starting point.
[in]color_bColor at the ending point.
Here is the call graph for this function:

◆ DrawOval() [1/3]

void arctic::DrawOval ( Sprite  to_sprite,
Rgba  color,
Vec2Si32  ll,
Vec2Si32  ur 
)

Draws a solid color filled oval to a sprite.

Parameters
[in]to_spriteSprite to draw the oval on.
[in]colorColor of the oval.
[in]llLower-left corner of the bounding box.
[in]urUpper-right corner of the bounding box.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DrawOval() [2/3]

void arctic::DrawOval ( Sprite  to_sprite,
Vec2Si32  c,
Vec2Si32  r,
Rgba  color 
)

Draws a solid color filled oval to a sprite.

Parameters
[in]to_spriteSprite to draw the oval on.
[in]cCenter of the oval.
[in]rRadii of the oval (x and y).
[in]colorColor of the oval.
Here is the call graph for this function:

◆ DrawOval() [3/3]

void arctic::DrawOval ( Vec2Si32  c,
Vec2Si32  r,
Rgba  color 
)

Draws a solid color filled oval.

Parameters
[in]cCenter of the oval.
[in]rRadii of the oval (x and y).
[in]colorColor of the oval.
Here is the call graph for this function:

◆ DrawRectangle() [1/2]

void arctic::DrawRectangle ( Sprite  to_sprite,
Vec2Si32  ll,
Vec2Si32  ur,
Rgba  color 
)

Draws a solid color filled rectangle to a sprite.

Parameters
[in]to_spriteSprite to draw the rectangle on.
[in]llLower-left corner of the rectangle.
[in]urUpper-right corner of the rectangle.
[in]colorColor of the rectangle.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DrawRectangle() [2/2]

void arctic::DrawRectangle ( Vec2Si32  ll,
Vec2Si32  ur,
Rgba  color 
)

Draws a solid color filled rectangle.

Parameters
[in]llLower-left corner of the rectangle.
[in]urUpper-right corner of the rectangle.
[in]colorColor of the rectangle.
Here is the call graph for this function:

◆ DrawTriangle() [1/5]

void arctic::DrawTriangle ( Sprite  to_sprite,
Vec2F  a,
Vec2F  b,
Vec2F  c,
Vec2F  ta,
Vec2F  tb,
Vec2F  tc,
Sprite  texture,
DrawBlendingMode  blending_mode,
DrawFilterMode  filter_mode,
Rgba  in_color 
)

Draws a textured triangle to a sprite.

Parameters
[in]to_spriteSprite to draw the triangle on.
[in]aFirst vertex of the triangle.
[in]bSecond vertex of the triangle.
[in]cThird vertex of the triangle.
[in]taTexture coordinate for the first vertex.
[in]tbTexture coordinate for the second vertex.
[in]tcTexture coordinate for the third vertex.
[in]textureTexture to apply to the triangle.
[in]blending_modeBlending mode for drawing the triangle.
[in]filter_modeFilter mode for the texture.
[in]in_colorColor to multiply the texture with.

◆ DrawTriangle() [2/5]

void arctic::DrawTriangle ( Sprite  to_sprite,
Vec2Si32  a,
Vec2Si32  b,
Vec2Si32  c,
Rgba  color 
)

Draws a solid color filled triangle to a sprite.

Parameters
[in]to_spriteSprite to draw the triangle on.
[in]aFirst vertex of the triangle.
[in]bSecond vertex of the triangle.
[in]cThird vertex of the triangle.
[in]colorColor of the triangle.
Here is the call graph for this function:

◆ DrawTriangle() [3/5]

void arctic::DrawTriangle ( Sprite  to_sprite,
Vec2Si32  a,
Vec2Si32  b,
Vec2Si32  c,
Rgba  color_a,
Rgba  color_b,
Rgba  color_c 
)

Draws a gradient color filled triangle to a sprite.

Parameters
[in]to_spriteSprite to draw the triangle on.
[in]aFirst vertex of the triangle.
[in]bSecond vertex of the triangle.
[in]cThird vertex of the triangle.
[in]color_aColor at the first vertex.
[in]color_bColor at the second vertex.
[in]color_cColor at the third vertex.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DrawTriangle() [4/5]

void arctic::DrawTriangle ( Vec2Si32  a,
Vec2Si32  b,
Vec2Si32  c,
Rgba  color 
)

Draws a solid color filled triangle.

Parameters
[in]aFirst vertex of the triangle.
[in]bSecond vertex of the triangle.
[in]cThird vertex of the triangle.
[in]colorColor of the triangle.
Here is the call graph for this function:

◆ DrawTriangle() [5/5]

void arctic::DrawTriangle ( Vec2Si32  a,
Vec2Si32  b,
Vec2Si32  c,
Rgba  color_a,
Rgba  color_b,
Rgba  color_c 
)

Draws a gradient color filled triangle.

Parameters
[in]aFirst vertex of the triangle.
[in]bSecond vertex of the triangle.
[in]cThird vertex of the triangle.
[in]color_aColor at the first vertex.
[in]color_bColor at the second vertex.
[in]color_cColor at the third vertex.
Here is the call graph for this function:

◆ GetPixel() [1/2]

Rgba arctic::GetPixel ( const Sprite from_sprite,
Si32  x,
Si32  y 
)

Returns color of a pixel of a sprite at coordinates specified.

Parameters
[in]from_spriteSprite to get the pixel from.
[in]xX-coordinate of the pixel.
[in]yY-coordinate of the pixel.
Returns
Color of the pixel at the specified coordinates in the sprite.
Here is the call graph for this function:

◆ GetPixel() [2/2]

Rgba arctic::GetPixel ( Si32  x,
Si32  y 
)

Returns color of a pixel at coordinates specified.

Parameters
[in]xX-coordinate of the pixel.
[in]yY-coordinate of the pixel.
Returns
Color of the pixel at the specified coordinates.
Here is the call graph for this function:

◆ ReplaceColor()

void arctic::ReplaceColor ( Sprite  to_sprite,
Rgba  old_color,
Rgba  new_color 
)

Sets the new color to all the pixels of the old color.

Parameters
[in]to_spriteSprite to replace colors in.
[in]old_colorColor to be replaced.
[in]new_colorColor to replace with.
Here is the call graph for this function:

◆ SetPixel() [1/2]

void arctic::SetPixel ( const Sprite to_sprite,
Si32  x,
Si32  y,
Rgba  color 
)

Sets color of a pixel of a sprite at coordinates specified.

Parameters
[in]to_spriteSprite to set the pixel in.
[in]xX-coordinate of the pixel.
[in]yY-coordinate of the pixel.
[in]colorColor to set the pixel to.
Here is the call graph for this function:

◆ SetPixel() [2/2]

void arctic::SetPixel ( Si32  x,
Si32  y,
Rgba  color 
)

Sets color of a pixel at coordinates specified.

Parameters
[in]xX-coordinate of the pixel.
[in]yY-coordinate of the pixel.
[in]colorColor to set the pixel to.
Here is the call graph for this function: