libyggdrasil  v1.0.0
display.cpp File Reference

Display abstraction implementation for Midgard. More...

#include <yggdrasil.h>
#include <cpp/common/attributes.hpp>
#include <cpp/common/types.hpp>
#include <cpp/common/utils.hpp>
#include <c/midgard/driver/display.h>
#include <math.h>
Include dependency graph for display.cpp:

Functions

C_LINKAGE bool yggdrasil_Display_Init (enum DisplayOrientation orientation)
 
bool yggdrasil_Display_Deinit ()
 
C_LINKAGE void yggdrasil_Display_Reset (void)
 
C_LINKAGE void yggdrasil_Display_TurnOn (void)
 
C_LINKAGE void yggdrasil_Display_TurnOff (void)
 
C_LINKAGE u16 yggdrasil_Display_getWidth (void)
 
C_LINKAGE u16 yggdrasil_Display_getHeight (void)
 
C_LINKAGE void yggdrasil_Display_SetPalette (palette_t *palette)
 
C_LINKAGE palette_t yggdrasil_Display_GetDefaultPalette (void)
 
C_LINKAGE void * yggdrasil_Display_GetFrameBufferAddress (void)
 
C_LINKAGE void yggdrasil_Display_Clear (u8 colorIndex)
 Clear the display to a color. More...
 
C_LINKAGE void yggdrasil_Display_DrawRectangle (u16 x1, u16 y1, u16 x2, u16 y2, u8 colorIndex)
 Draw a rectangle. More...
 
C_LINKAGE void yggdrasil_Display_FillRectangle (u16 x1, u16 y1, u16 x2, u16 y2, u8 colorIndex)
 Draw a filled rectangle. More...
 
C_LINKAGE void yggdrasil_Display_DrawPixel (u16 x, u16 y, u8 colorIndex)
 Draw a single pixel. More...
 
C_LINKAGE void yggdrasil_Display_DrawLine (u16 x1, u16 y1, u16 x2, u16 y2, u8 colorIndex)
 Draw a line. More...
 
C_LINKAGE void yggdrasil_Display_DrawCircle (i16 centerX, i16 centerY, u16 radius, u8 colorIndex)
 Draw a cricle. More...
 
C_LINKAGE void yggdrasil_Display_FillCircle (i16 centerX, i16 centerY, u16 radius, u8 colorIndex)
 Draw a filled cricle. More...
 
C_LINKAGE void yggdrasil_Display_DrawCharacter (u16 x, u16 y, char c, u8 colorIndex, Font *font)
 Draw a single character. More...
 
C_LINKAGE void yggdrasil_Display_DrawString (u16 x, u16 y, const char *string, u8 colorIndex, Font *font)
 Draw a string. More...
 

Detailed Description

Display abstraction implementation for Midgard.

Author
Fabian Weber, Nikolaij Saegesser

Function Documentation

◆ yggdrasil_Display_Clear()

C_LINKAGE void yggdrasil_Display_Clear ( u8  colorIndex)

Clear the display to a color.

Parameters
colorIndexIndex for the color

◆ yggdrasil_Display_Deinit()

bool yggdrasil_Display_Deinit ( void  )

◆ yggdrasil_Display_DrawCharacter()

C_LINKAGE void yggdrasil_Display_DrawCharacter ( u16  x,
u16  y,
char  c,
u8  colorIndex,
Font *  font 
)

Draw a single character.

Parameters
xX coordinate
yY coordinate
cCharachter
colorIndexIndex for the color
fontFont

◆ yggdrasil_Display_DrawCircle()

C_LINKAGE void yggdrasil_Display_DrawCircle ( i16  centerX,
i16  centerY,
u16  radius,
u8  colorIndex 
)

Draw a cricle.

Parameters
centerXX Position of the center
centerYY Position of the center
radiusRadius
colorIndexIndex for the color

◆ yggdrasil_Display_DrawLine()

C_LINKAGE void yggdrasil_Display_DrawLine ( u16  x1,
u16  y1,
u16  x2,
u16  y2,
u8  colorIndex 
)

Draw a line.

Parameters
x1X Start coordinate
y1Y Start coordinate
x2X End coordinate
y2Y End coordinate
colorIndexIndex for the color

◆ yggdrasil_Display_DrawPixel()

C_LINKAGE void yggdrasil_Display_DrawPixel ( u16  x,
u16  y,
u8  colorIndex 
)

Draw a single pixel.

Parameters
xX coordinate
yY coordinate
colorIndexIndex for the color

◆ yggdrasil_Display_DrawRectangle()

C_LINKAGE void yggdrasil_Display_DrawRectangle ( u16  x1,
u16  y1,
u16  x2,
u16  y2,
u8  colorIndex 
)

Draw a rectangle.

Parameters
x1X Start coordinate
y1Y Start coordinate
x2X End coordinate
y2Y End coordinate
colorIndexIndex for the color

◆ yggdrasil_Display_DrawString()

C_LINKAGE void yggdrasil_Display_DrawString ( u16  x,
u16  y,
const char *  string,
u8  colorIndex,
Font *  font 
)

Draw a string.

Parameters
xX coordinate
yY coordinate
stringString view
colorIndexIndex for the color
fontFont

◆ yggdrasil_Display_FillCircle()

C_LINKAGE void yggdrasil_Display_FillCircle ( i16  centerX,
i16  centerY,
u16  radius,
u8  colorIndex 
)

Draw a filled cricle.

Parameters
centerXX Position of the center
centerYY Position of the center
radiusRadius
colorIndexIndex for the color

◆ yggdrasil_Display_FillRectangle()

C_LINKAGE void yggdrasil_Display_FillRectangle ( u16  x1,
u16  y1,
u16  x2,
u16  y2,
u8  colorIndex 
)

Draw a filled rectangle.

Parameters
x1X Start coordinate
y1Y Start coordinate
x2X End coordinate
y2Y End coordinate
colorIndexIndex for the color

◆ yggdrasil_Display_GetDefaultPalette()

C_LINKAGE palette_t yggdrasil_Display_GetDefaultPalette ( void  )

◆ yggdrasil_Display_GetFrameBufferAddress()

C_LINKAGE void* yggdrasil_Display_GetFrameBufferAddress ( void  )

◆ yggdrasil_Display_getHeight()

C_LINKAGE u16 yggdrasil_Display_getHeight ( void  )

◆ yggdrasil_Display_getWidth()

C_LINKAGE u16 yggdrasil_Display_getWidth ( void  )

◆ yggdrasil_Display_Init()

C_LINKAGE bool yggdrasil_Display_Init ( enum DisplayOrientation  orientation)

◆ yggdrasil_Display_Reset()

C_LINKAGE void yggdrasil_Display_Reset ( void  )

◆ yggdrasil_Display_SetPalette()

C_LINKAGE void yggdrasil_Display_SetPalette ( palette_t palette)

◆ yggdrasil_Display_TurnOff()

C_LINKAGE void yggdrasil_Display_TurnOff ( void  )

◆ yggdrasil_Display_TurnOn()

C_LINKAGE void yggdrasil_Display_TurnOn ( void  )