Henry Triff / Mbed 2 deprecated ELEC2645_Project_el18ht

Dependencies:   mbed

Graphics/Graphics.h

Committer:
HenryWTriff
Date:
2020-02-11
Revision:
2:d08b6a1eaf2b
Child:
3:ceed6d026b8b

File content as of revision 2:d08b6a1eaf2b:

#ifndef GRAPHICS_H
#define GRAPHICS_H

#include "mbed.h"
#include "Gamepad.h"
#include "N5110.h"
#include "Graphics.h"

//STRUCTS
struct Point_2D {
    float x;
    float y;
};
struct Line_2D {
    Point_2D from;
    Point_2D to;
};

class Graphics
{
    public:
    //SCREEN SETTINGS
    void Change_Contrast(N5110 &LCD, Gamepad &Device);
    //GRAPHICS
    void Draw_Map(int game_fps, Point_2D translation, int angle, float squish, Line_2D *Track_Lines, N5110 &LCD);
    
    private:
    //TRANSFORM
    Point_2D Rotate_Point(Point_2D point, float angle);
    Point_2D Translate_Point(Point_2D point, int translate_x, int translate_y);
    Point_2D Squish_Point(Point_2D point, float squish);
    //MATH
    int Round(float number);
    float Gradient(Point_2D from, Point_2D to);
    bool Gradient_Check_Infinate(Point_2D from, Point_2D to);
    //DRAW
    void Graphics_Draw_Line(Point_2D from, Point_2D to, bool solid, N5110 &LCD);
    
    
};

#endif