Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Renderer Class Reference
#include <Renderer.h>
Public Member Functions | |
| void | init () |
| Initialises the LCD and sets the field of view. | |
| void | drawHorizon (float angle) |
| Draws the games horizon line. | |
| void | drawFace (Face *face, float angle) |
| Draw an individual face. | |
| void | rasterizeFace (float(&points)[4][3], Face *face) |
| Draw an individual face. | |
| void | drawFillLines (float(&points)[4][3], int diffX2, int stepBottomY, int stepTopX, int stepTopY) |
| Draw an individual face. | |
| void | drawFaceOutline (float(&points)[4][3]) |
| Draw the outline of the face. | |
| void | drawAllFaces (Face *faceArray, int noOfFaces, float angle) |
| Draw all faces within a face array. | |
| bool | checkOnScreen (float(&Points)[4][3]) |
| Checks whether any area of the face is on the screen. | |
| void | print (const char *text, int x, int y) |
| Prints a string at a desired location on the screen. | |
| void | printScore (int score, int x, int y) |
| Prints a score at a desired location on the screen. | |
| void | clear () |
| Clears the display. | |
| void | refresh () |
| Refreshes the display. | |
| void | turnOff () |
| Turns off the display. | |
| void | setContrast (float contrast) |
| Draws the screen after the user has collided with a cube. | |
| void | drawDeathButtons () |
| Draws the death menus buttons. | |
| void | drawHomeScreen (int selection) |
| Draws the games home screen. | |
| void | drawHomeButtons () |
| Draws the home menus buttons. | |
| void | drawSelectionCube (int x, int y, int z, int rotationSpeed) |
| Draws the cube which indicates the selected button on the menus. | |
| void | drawHelpScreen1 () |
| Draws the first help screen. | |
| void | drawHelpScreen2 () |
| Draws the second help screen. | |
| void | drawHelpScreen3 () |
| Draws the third help screen. | |
| void | drawHelpScreen4 () |
| Draws the third help screen. | |
Detailed Description
Face class.
A class used to instantiate a Renderer object, this class provides an interface from the game to the display. Each Face of all the Cube objects will be passed to the Renderer for it to be rasterised and its outlines drawn.
- Date:
- April, 2019
Definition at line 18 of file Renderer.h.
Member Function Documentation
| bool checkOnScreen | ( | float(&) | Points[4][3] ) |
Checks whether any area of the face is on the screen.
- Parameters:
-
The pointer to an array containing the verticies of the face
Definition at line 126 of file Renderer.cpp.
| void clear | ( | ) |
Clears the display.
Definition at line 155 of file Renderer.cpp.
| void drawAllFaces | ( | Face * | faceArray, |
| int | noOfFaces, | ||
| float | angle | ||
| ) |
Draw all faces within a face array.
- Parameters:
-
The pointer to an array of face objects The number of faces as an integer The angle of the faces as a float
Definition at line 108 of file Renderer.cpp.
| void drawDeathButtons | ( | ) |
Draws the death menus buttons.
Definition at line 192 of file Renderer.cpp.
| void drawFace | ( | Face * | face, |
| float | angle | ||
| ) |
Draw an individual face.
- Parameters:
-
The face object The angle of the face object as a float
Definition at line 31 of file Renderer.cpp.
| void drawFaceOutline | ( | float(&) | points[4][3] ) |
Draw the outline of the face.
- Parameters:
-
The pointer to an array containing the verticies of the face
Definition at line 93 of file Renderer.cpp.
| void drawFillLines | ( | float(&) | points[4][3], |
| int | diffX2, | ||
| int | stepBottomY, | ||
| int | stepTopX, | ||
| int | stepTopY | ||
| ) |
Draw an individual face.
- Parameters:
-
The pointer to an array containing the verticies of the face The integer difference between the top horizontal edge x coordinates The integer difference between right vertical edge y coordinates The integer difference between bottom horizontal edge x coordinates The integer difference between left horizontal edge y coordinates
Definition at line 72 of file Renderer.cpp.
| void drawHelpScreen1 | ( | ) |
Draws the first help screen.
Definition at line 250 of file Renderer.cpp.
| void drawHelpScreen2 | ( | ) |
Draws the second help screen.
Definition at line 258 of file Renderer.cpp.
| void drawHelpScreen3 | ( | ) |
Draws the third help screen.
Definition at line 266 of file Renderer.cpp.
| void drawHelpScreen4 | ( | ) |
Draws the third help screen.
Definition at line 274 of file Renderer.cpp.
| void drawHomeButtons | ( | ) |
Draws the home menus buttons.
Definition at line 222 of file Renderer.cpp.
| void drawHomeScreen | ( | int | selection ) |
Draws the games home screen.
- Parameters:
-
The selected option as an integer
Definition at line 201 of file Renderer.cpp.
| void drawHorizon | ( | float | angle ) |
Draws the games horizon line.
- Parameters:
-
The angle of the horizon determined by the joystick position
Definition at line 23 of file Renderer.cpp.
| void drawSelectionCube | ( | int | x, |
| int | y, | ||
| int | z, | ||
| int | rotationSpeed | ||
| ) |
Draws the cube which indicates the selected button on the menus.
- Parameters:
-
The x coordinate of where to draw the cube as an integer The y coordinate of where to draw the cube as an integer The z coordinate of where to draw the cube as an integer The rotation speed multiplier of the cube as an integer
Definition at line 236 of file Renderer.cpp.
| void init | ( | ) |
Initialises the LCD and sets the field of view.
Definition at line 9 of file Renderer.cpp.
| void print | ( | const char * | text, |
| int | x, | ||
| int | y | ||
| ) |
Prints a string at a desired location on the screen.
- Parameters:
-
The pointer to an array of characters of the string The x coordinate to draw the string as an integer The y coordinate to draw the string as an integer
Definition at line 144 of file Renderer.cpp.
| void printScore | ( | int | score, |
| int | x, | ||
| int | y | ||
| ) |
Prints a score at a desired location on the screen.
- Parameters:
-
The value of the score as an integer The x coordinate to draw the score as an integer The y coordinate to draw the score as an integer
Definition at line 148 of file Renderer.cpp.
| void rasterizeFace | ( | float(&) | points[4][3], |
| Face * | face | ||
| ) |
Draw an individual face.
- Parameters:
-
The face object The angle of the face object as a float
Definition at line 52 of file Renderer.cpp.
| void refresh | ( | ) |
Refreshes the display.
Definition at line 159 of file Renderer.cpp.
| void setContrast | ( | float | contrast ) |
Draws the screen after the user has collided with a cube.
- Parameters:
-
The selected option as an integer The high score as an integer
Definition at line 168 of file Renderer.cpp.
| void turnOff | ( | ) |
Turns off the display.
Definition at line 164 of file Renderer.cpp.
Generated on Fri Jul 15 2022 03:54:57 by
1.7.2