My Project
Public Member Functions | List of all members
rtype::IGraphicalLib Class Referenceabstract

IGraphicalLib class. More...

#include <IGraphicalLib.hpp>

Inheritance diagram for rtype::IGraphicalLib:
rtype::GraphicalLib

Public Member Functions

virtual ~IGraphicalLib ()=default
 Destroy the IGraphicalLib object.
 
virtual auto initWindow (const int screenWidth, const int screenHeight, std::string title, const int framerate) -> void=0
 A method to initialize a window object. More...
 
virtual auto closeWindow () -> void=0
 A method to close the window.
 
virtual auto clearScreen () -> void=0
 A method to clear the window.
 
virtual auto startDrawingWindow () -> void=0
 Start drawing in the window.
 
virtual auto endDrawingWindow () -> void=0
 Stop drawing in the window.
 
virtual auto windowShouldClose () -> bool=0
 Check if window should close. More...
 
virtual auto 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) -> void=0
 Draw a sprite. More...
 
virtual auto checkMouseCollision (Position const &position, float const &x, float const &y, float const &height, float const &width) -> bool=0
 Check the mouse collision. More...
 
virtual auto IsLeftMouseButtonPressed () -> bool=0
 Check if the left mouse button is pressed. More...
 
virtual auto IsLeftMouseButtonReleased () -> bool=0
 Check if the left mouse button is released. More...
 
virtual auto getMousePosition () -> Position=0
 Get the Mouse Position object. More...
 
virtual auto drawText (std::string const &text, Position const &pos, std::size_t const &fontSize, std::array< float, 4 > const &color) -> void=0
 Draw a text. More...
 
virtual auto createColor (std::array< float, 4 > const &array) -> Color=0
 Create a Color object. More...
 
virtual auto initAudio () -> void=0
 Init the audio device. More...
 
virtual auto closeAudio () -> void=0
 Close the audio device. More...
 
virtual auto playASound (MySound &sound) -> void=0
 Play a sound. More...
 
virtual auto playASoundMulti (MySound &sound) -> void=0
 Play a sound with a multichannel buffer pool. More...
 
virtual auto playAMusic (MyMusic &music) -> void=0
 Play a music. More...
 
virtual auto updateAMusic (MyMusic &music) -> void=0
 Update the music. More...
 
virtual auto getMusicVolume (MyMusic &music) -> float=0
 
virtual auto setMusicVolume (MyMusic &music, float volume) -> void=0
 
virtual auto hasBeenPressed (int key) -> bool=0
 Check if a key has been pressed. More...
 
virtual auto isBeingPressed (int key) -> bool=0
 Check if a key is being pressed. More...
 
virtual auto hasBeenReleased (int key) -> bool=0
 Check if a key has been released. More...
 
virtual auto isNotBeingPressed (int key) -> bool=0
 Check if a key is not being pressed. More...
 
virtual auto setExitKey (int key) -> void=0
 Set the Exit Key object. More...
 
virtual auto getPressedKeycode () -> int=0
 Get the Pressed Keycode object. More...
 
virtual auto getPressedCharcode () -> int=0
 Get the Pressed Charcode object. More...
 

Detailed Description

IGraphicalLib class.

Member Function Documentation

◆ checkMouseCollision()

virtual auto rtype::IGraphicalLib::checkMouseCollision ( Position const &  position,
float const &  x,
float const &  y,
float const &  height,
float const &  width 
) -> bool
pure virtual

Check the mouse collision.

Parameters
positionPosition of the mouse
xX position of the rectangle
yY position of the rectangle
heightHeight of the rectangle
widthWidth of the rectangle
Returns
true If there is a collision
false If there is no collision

Implemented in rtype::GraphicalLib.

◆ closeAudio()

virtual auto rtype::IGraphicalLib::closeAudio ( ) -> void
pure virtual

Close the audio device.

Implemented in rtype::GraphicalLib.

◆ createColor()

virtual auto rtype::IGraphicalLib::createColor ( std::array< float, 4 > const &  array) -> Color
pure virtual

Create a Color object.

Parameters
arrayArray containing RGBA values
Returns
Color The color

Implemented in rtype::GraphicalLib.

◆ drawSprite()

virtual auto rtype::IGraphicalLib::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 
) -> void
pure virtual

Draw a sprite.

Parameters
textureTexture to draw
rectSourceArray containing Rect source data with height, width, x and y
rectDestArray containing Rect destination data with height, width, x and y
originPosition of origin
rotationRotation of the sprite
scaleScale of the sprite

Implemented in rtype::GraphicalLib.

◆ drawText()

virtual auto rtype::IGraphicalLib::drawText ( std::string const &  text,
Position const &  pos,
std::size_t const &  fontSize,
std::array< float, 4 > const &  color 
) -> void
pure virtual

Draw a text.

Parameters
textText to draw
posPosition of the text
fontSizeFont size of the text
colorColor of the text

Implemented in rtype::GraphicalLib.

◆ getMousePosition()

virtual auto rtype::IGraphicalLib::getMousePosition ( ) -> Position
pure virtual

Get the Mouse Position object.

Returns
Position The mouse position

Implemented in rtype::GraphicalLib.

◆ getPressedCharcode()

virtual auto rtype::IGraphicalLib::getPressedCharcode ( ) -> int
pure virtual

Get the Pressed Charcode object.

Returns
int

Implemented in rtype::GraphicalLib.

◆ getPressedKeycode()

virtual auto rtype::IGraphicalLib::getPressedKeycode ( ) -> int
pure virtual

Get the Pressed Keycode object.

Returns
int

Implemented in rtype::GraphicalLib.

◆ hasBeenPressed()

virtual auto rtype::IGraphicalLib::hasBeenPressed ( int  key) -> bool
pure virtual

Check if a key has been pressed.

Parameters
key
Returns
true
false

Implemented in rtype::GraphicalLib.

◆ hasBeenReleased()

virtual auto rtype::IGraphicalLib::hasBeenReleased ( int  key) -> bool
pure virtual

Check if a key has been released.

Parameters
key
Returns
true
false

Implemented in rtype::GraphicalLib.

◆ initAudio()

virtual auto rtype::IGraphicalLib::initAudio ( ) -> void
pure virtual

Init the audio device.

Implemented in rtype::GraphicalLib.

◆ initWindow()

virtual auto rtype::IGraphicalLib::initWindow ( const int  screenWidth,
const int  screenHeight,
std::string  title,
const int  framerate 
) -> void
pure virtual

A method to initialize a window object.

Parameters
screenWidthwidth of the window
screenHeightheight of the window
titletitle of the window
framerateframerate of the window

Implemented in rtype::GraphicalLib.

◆ isBeingPressed()

virtual auto rtype::IGraphicalLib::isBeingPressed ( int  key) -> bool
pure virtual

Check if a key is being pressed.

Parameters
key
Returns
true
false

Implemented in rtype::GraphicalLib.

◆ IsLeftMouseButtonPressed()

virtual auto rtype::IGraphicalLib::IsLeftMouseButtonPressed ( ) -> bool
pure virtual

Check if the left mouse button is pressed.

Returns
true If the left mouse button is pressed
false If the left mouse button is not pressed

Implemented in rtype::GraphicalLib.

◆ IsLeftMouseButtonReleased()

virtual auto rtype::IGraphicalLib::IsLeftMouseButtonReleased ( ) -> bool
pure virtual

Check if the left mouse button is released.

Returns
true If the left mouse button is released
false If the left mouse button is not released

Implemented in rtype::GraphicalLib.

◆ isNotBeingPressed()

virtual auto rtype::IGraphicalLib::isNotBeingPressed ( int  key) -> bool
pure virtual

Check if a key is not being pressed.

Parameters
key
Returns
true
false

Implemented in rtype::GraphicalLib.

◆ playAMusic()

virtual auto rtype::IGraphicalLib::playAMusic ( MyMusic music) -> void
pure virtual

Play a music.

Parameters
musicMusic to play

Implemented in rtype::GraphicalLib.

◆ playASound()

virtual auto rtype::IGraphicalLib::playASound ( MySound sound) -> void
pure virtual

Play a sound.

Parameters
soundSound to play

Implemented in rtype::GraphicalLib.

◆ playASoundMulti()

virtual auto rtype::IGraphicalLib::playASoundMulti ( MySound sound) -> void
pure virtual

Play a sound with a multichannel buffer pool.

Parameters
soundSound to play

Implemented in rtype::GraphicalLib.

◆ setExitKey()

virtual auto rtype::IGraphicalLib::setExitKey ( int  key) -> void
pure virtual

Set the Exit Key object.

Parameters
key

Implemented in rtype::GraphicalLib.

◆ updateAMusic()

virtual auto rtype::IGraphicalLib::updateAMusic ( MyMusic music) -> void
pure virtual

Update the music.

Parameters
musicMusic to update

Implemented in rtype::GraphicalLib.

◆ windowShouldClose()

virtual auto rtype::IGraphicalLib::windowShouldClose ( ) -> bool
pure virtual

Check if window should close.

Returns
true If window should close
false If window shouldn't close

Implemented in rtype::GraphicalLib.


The documentation for this class was generated from the following file: