mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2025-12-16 12:21:48 +01:00
88 lines
1.7 KiB
C++
88 lines
1.7 KiB
C++
#pragma once
|
|
#include <string>
|
|
|
|
struct Window
|
|
{
|
|
explicit Window( const std::string& title = "Title", float width = 320.0f,
|
|
float height = 180.0f, bool isVSyncOn = true );
|
|
|
|
std::string title;
|
|
float width;
|
|
float height;
|
|
bool isVSyncOn;
|
|
};
|
|
|
|
struct Point2f
|
|
{
|
|
Point2f( );
|
|
explicit Point2f( float x, float y );
|
|
//Point2f(int x, int y); //Stupid fix for it giving an error
|
|
|
|
//operator
|
|
Point2f operator+( const Point2f& other ) const;
|
|
Point2f operator+=( const Point2f& other ) const;
|
|
Point2f operator*( float other ) const;
|
|
Point2f operator*( int other ) const;
|
|
Point2f operator*( const Point2f& other ) const;
|
|
Point2f operator/( float other ) const;
|
|
Point2f operator-( const Point2f& other ) const;
|
|
|
|
float x;
|
|
float y;
|
|
};
|
|
|
|
Point2f operator/(float right, const Point2f& left);
|
|
Point2f operator*(float right, const Point2f& left);
|
|
|
|
struct Rectf
|
|
{
|
|
Rectf( );
|
|
explicit Rectf( float left, float bottom, float width, float height );
|
|
//explicit Rectf( int left, int bottom, int width, int height ); //Stupid fix for it giving an error (same as Point2f)
|
|
|
|
Point2f BottomLeft() const { return Point2f{ left, bottom }; }
|
|
|
|
float left;
|
|
float bottom;
|
|
float width;
|
|
float height;
|
|
|
|
};
|
|
|
|
|
|
struct Color4f
|
|
{
|
|
Color4f( );
|
|
explicit Color4f( float r, float g, float b, float a );
|
|
|
|
float r;
|
|
float g;
|
|
float b;
|
|
float a;
|
|
};
|
|
|
|
struct Circlef
|
|
{
|
|
Circlef( );
|
|
explicit Circlef( const Point2f& center, float radius );
|
|
explicit Circlef( float centerX, float centerY, float radius );
|
|
|
|
Point2f center;
|
|
float radius;
|
|
};
|
|
|
|
|
|
struct Ellipsef
|
|
{
|
|
Ellipsef( );
|
|
explicit Ellipsef( const Point2f& center, float radiusX, float radiusY );
|
|
explicit Ellipsef( float centerX, float centerY, float radiusX, float radiusY );
|
|
|
|
Point2f center;
|
|
float radiusX;
|
|
float radiusY;
|
|
};
|
|
|
|
|
|
|