ELEC2645 (2018/19) / Mbed 2 deprecated el17cd

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Renderer Class Reference

Renderer Class Reference

Face class. More...

#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.

Author:
Christopher Doel
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:
Thepointer 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:
Thepointer to an array of face objects
Thenumber of faces as an integer
Theangle 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:
Theface object
Theangle 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:
Thepointer 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:
Thepointer to an array containing the verticies of the face
Theinteger difference between the top horizontal edge x coordinates
Theinteger difference between right vertical edge y coordinates
Theinteger difference between bottom horizontal edge x coordinates
Theinteger 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:
Theselected option as an integer

Definition at line 201 of file Renderer.cpp.

void drawHorizon ( float  angle )

Draws the games horizon line.

Parameters:
Theangle 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:
Thex coordinate of where to draw the cube as an integer
They coordinate of where to draw the cube as an integer
Thez coordinate of where to draw the cube as an integer
Therotation 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:
Thepointer to an array of characters of the string
Thex coordinate to draw the string as an integer
They 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:
Thevalue of the score as an integer
Thex coordinate to draw the score as an integer
They 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:
Theface object
Theangle 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:
Theselected option as an integer
Thehigh 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.