8 #ifndef GRAPHICALLIB_HPP_
9 #define GRAPHICALLIB_HPP_
16 #include "IGraphicalLib.hpp"
48 void initWindow(
const int screenWidth,
const int screenHeight, std::string title,
const int framerate)
override;
90 void drawSprite(
MyTexture const &texture, std::array<float, 4>
const &rectSource, std::array<float, 4>
const &rectDest, std::pair<float, float>
const &origin,
float const &rotation,
float const &scale)
override;
102 bool checkMouseCollision(
Position const &position,
float const &x,
float const &y,
float const &height,
float const &width)
override;
129 Color
createColor(std::array<float, 4>
const &array)
override;
138 void drawText(std::string
const &text,
Position const &pos, std::size_t
const &fontSize, std::array<float, 4>
const &color)
override;
174 float getMusicVolume(
MyMusic &music)
override;
175 void setMusicVolume(
MyMusic &music,
float volume)
override;
3 dimension Position class (x, y, z)
Definition: Position.hpp:19
Position getMousePosition() override
Get the Mouse Position object.
Definition: GraphicalLib.cpp:68
GraphicalLib class.
Definition: GraphicalLib.hpp:27
void setExitKey(int key) override
Set the Exit Key object.
Definition: GraphicalLib.cpp:152
int getPressedCharcode() override
Get the Pressed Charcode object.
Definition: GraphicalLib.cpp:162
void playASound(MySound &sound) override
A method to play a sound.
Definition: GraphicalLib.cpp:101
bool IsLeftMouseButtonPressed() override
A method to check if the left mouse button is pressed.
Definition: GraphicalLib.cpp:58
bool checkMouseCollision(Position const &position, float const &x, float const &y, float const &height, float const &width) override
A method to check a collison between the mouse and a rectangle.
Definition: GraphicalLib.cpp:53
bool IsLeftMouseButtonReleased() override
A method to check if the left mouse button is released.
Definition: GraphicalLib.cpp:63
void drawText(std::string const &text, Position const &pos, std::size_t const &fontSize, std::array< float, 4 > const &color) override
A method to draw a text.
Definition: GraphicalLib.cpp:85
bool isBeingPressed(int key) override
Check if a key is being pressed.
Definition: GraphicalLib.cpp:137
bool hasBeenReleased(int key) override
Check if a key has been released.
Definition: GraphicalLib.cpp:142
GraphicalLib()
Construct a new Graphical Lib object.
Definition: GraphicalLib.cpp:10
void updateAMusic(MyMusic &music) override
A method to update the music.
Definition: GraphicalLib.cpp:116
void startDrawingWindow() override
Start drawing in the window.
Definition: GraphicalLib.cpp:34
Color createColor(std::array< float, 4 > const &array) override
Create a Color object.
Definition: GraphicalLib.cpp:74
void playAMusic(MyMusic &music) override
A method to load a sound.
Definition: GraphicalLib.cpp:111
void initWindow(const int screenWidth, const int screenHeight, std::string title, const int framerate) override
A method to initialize a window object.
Definition: GraphicalLib.cpp:18
MyTexture class.
Definition: MyTexture.hpp:19
bool isNotBeingPressed(int key) override
Check if a key is not being pressed.
Definition: GraphicalLib.cpp:147
Music class.
Definition: MyMusic.hpp:18
bool hasBeenPressed(int key) override
Check if a key has been pressed.
Definition: GraphicalLib.cpp:132
int getPressedKeycode() override
Get the Pressed Keycode object.
Definition: GraphicalLib.cpp:157
MySound class.
Definition: MySound.hpp:18
rtype namespace
Definition: GraphicalLib.hpp:22
void drawSprite(MyTexture const &texture, std::array< float, 4 > const &rectSource, std::array< float, 4 > const &rectDest, std::pair< float, float > const &origin, float const &rotation, float const &scale) override
A method to draw a sprite.
Definition: GraphicalLib.cpp:48
void endDrawingWindow() override
Stop drawing in the window.
Definition: GraphicalLib.cpp:38
void playASoundMulti(MySound &sound) override
Play a sound with a multichannel buffer pool.
Definition: GraphicalLib.cpp:106
void clearScreen() override
Clear the window.
Definition: GraphicalLib.cpp:29
void closeWindow() override
A method to close a window.
Definition: GraphicalLib.cpp:24
IGraphicalLib class.
Definition: IGraphicalLib.hpp:29
void initAudio() override
A method to init the audio devide.
Definition: GraphicalLib.cpp:91
~GraphicalLib()
Destroy the Graphical Lib object.
Definition: GraphicalLib.cpp:14
void closeAudio() override
A method to close the audio device.
Definition: GraphicalLib.cpp:96
bool windowShouldClose() override
Check if the window should close.
Definition: GraphicalLib.cpp:43