FreeRTOS Emulator with SDL2 Based Graphics and Input Library  1.0
A POSIX wrapper to run FreeRTOS on an x86 machine with some basic input and output libraries aimed at making teaching FreeRTOS simpler.
draw.h File Reference

Example draw functions for drawing user objects. More...

#include "FreeRTOS.h"
#include "task.h"
#include "gfx_draw.h"
#include "gfx_ball.h"

Go to the source code of this file.

Macros

#define FPS_FONT   "IBMPlexSans-Bold.ttf"
 

Functions

void vCreateWalls (wall_t **left_wall, wall_t **right_wall, wall_t **top_wall, wall_t **bottom_wall)
 Creates the four demo walls used. More...
 
void vDrawWalls (wall_t *left_wall, wall_t *right_wall, wall_t *top_wall, wall_t *bottom_wall)
 Draws the demo walls. More...
 
void vDrawBall (ball_t *ball)
 Draws a ball. More...
 
void vDrawClearScreen (void)
 Clears the screen to be white. More...
 
void vDrawMouseBallAndBoundingBox (unsigned char ball_color_inverted)
 Draws the ball moved by the mouse and its bounding box. More...
 
void vDrawFPS (void)
 Draws the FPS value on the screen. More...
 
void vDrawStaticItems (void)
 Draws the help text and FreeRTOS logo on the screen. More...
 
void vDrawButtonText (void)
 Draws the status information of the button presses on the screen. More...
 
void vDrawSpriteStatic ()
 Draws the static sprite to the bottom right corner of the screen. More...
 
void vDrawSpriteResetDownwardSequence ()
 Resets the downward animation sequence for example purposes. More...
 
void vDrawSpriteAnimations (TickType_t xLastFrameTime)
 Draws the sprite annimation to the bottom right corner of the screen. More...
 
void vDrawInitResources (void)
 Loads images, sprite sheets and creates the annimation sequences needed. More...
 

Variables

gfx_image_handle_t logo_image
 

Detailed Description

Example draw functions for drawing user objects.

Author
Alex Hoffman
Date
23 January 2023
----------------------------------------------------------------------
Copyright (C) Alexander Hoffman, 2023
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
----------------------------------------------------------------------

Macro Definition Documentation

◆ FPS_FONT

#define FPS_FONT   "IBMPlexSans-Bold.ttf"

Function Documentation

◆ vCreateWalls()

void vCreateWalls ( wall_t **  left_wall,
wall_t **  right_wall,
wall_t **  top_wall,
wall_t **  bottom_wall 
)

Creates the four demo walls used.

Parameters
left_wallDouble pointer to the wall handle for the left wall
right_wallDouble pointer to the wall handle for the right wall
top_wallDouble pointer to the wall handle for the top wall
bottom_wallDouble pointer to the wall handle for the bottom wall

◆ vDrawBall()

void vDrawBall ( ball_t ball)

Draws a ball.

Parameters
ballPointer to ball handle to be drawn

◆ vDrawButtonText()

void vDrawButtonText ( void  )

Draws the status information of the button presses on the screen.

◆ vDrawClearScreen()

void vDrawClearScreen ( void  )

Clears the screen to be white.

◆ vDrawFPS()

void vDrawFPS ( void  )

Draws the FPS value on the screen.

◆ vDrawInitResources()

void vDrawInitResources ( void  )

Loads images, sprite sheets and creates the annimation sequences needed.

◆ vDrawMouseBallAndBoundingBox()

void vDrawMouseBallAndBoundingBox ( unsigned char  ball_color_inverted)

Draws the ball moved by the mouse and its bounding box.

Parameters
ball_color_inverted

◆ vDrawSpriteAnimations()

void vDrawSpriteAnimations ( TickType_t  xLastFrameTime)

Draws the sprite annimation to the bottom right corner of the screen.

Parameters
xLastFrameTimeTicks since last frame

◆ vDrawSpriteResetDownwardSequence()

void vDrawSpriteResetDownwardSequence ( )

Resets the downward animation sequence for example purposes.

◆ vDrawSpriteStatic()

void vDrawSpriteStatic ( )

Draws the static sprite to the bottom right corner of the screen.

◆ vDrawStaticItems()

void vDrawStaticItems ( void  )

Draws the help text and FreeRTOS logo on the screen.

◆ vDrawWalls()

void vDrawWalls ( wall_t left_wall,
wall_t right_wall,
wall_t top_wall,
wall_t bottom_wall 
)

Draws the demo walls.

Parameters
left_wallPointer to the wall handle for the left wall
right_wallPointer to the wall handle for the right wall
top_wallPointer to the wall handle for the top wall
bottom_wallPointer to the wall handle for the bottom wall

Variable Documentation

◆ logo_image

gfx_image_handle_t logo_image
extern