Adding the SFML to the CMake libraries

This commit is contained in:
AnonymusRaccoon
2020-01-31 10:52:55 +01:00
parent a1c055920c
commit 15fb1c2cf1
4 changed files with 18 additions and 10 deletions
+9 -1
View File
@@ -78,5 +78,13 @@ add_executable(ComSquare
sources/Renderer/IRenderer.hpp sources/Renderer/IRenderer.hpp
sources/Renderer/SFRenderer.hpp sources/Renderer/SFRenderer.hpp
sources/Renderer/SFRenderer.cpp sources/Renderer/SFRenderer.cpp
sources/Exceptions/InvalidAcction.hpp sources/Exceptions/InvalidAction.hpp
) )
target_link_libraries(ComSquare
sfml-graphics
sfml-window
sfml-system
sfml-audio
sfml-network
)
+2 -2
View File
@@ -8,7 +8,7 @@
#include "Cartridge.hpp" #include "Cartridge.hpp"
#include "../Exceptions/InvalidAddress.hpp" #include "../Exceptions/InvalidAddress.hpp"
#include "../Exceptions/InvalidRom.hpp" #include "../Exceptions/InvalidRom.hpp"
#include "../Exceptions/InvalidAcction.hpp" #include "../Exceptions/InvalidAction.hpp"
namespace ComSquare::Cartridge namespace ComSquare::Cartridge
{ {
@@ -56,7 +56,7 @@ namespace ComSquare::Cartridge
{ {
(void)addr; (void)addr;
(void)data; (void)data;
throw InvalidAcction("Witting to the ROM is not allowed."); throw InvalidAction("Witting to the ROM is not allowed.");
} }
uint32_t Cartridge::_getHeaderAddress() uint32_t Cartridge::_getHeaderAddress()
@@ -2,8 +2,8 @@
// Created by anonymus-raccoon on 1/30/20. // Created by anonymus-raccoon on 1/30/20.
// //
#ifndef COMSQUARE_INVALIDACCTION_HPP #ifndef COMSQUARE_INVALIDACTION_HPP
#define COMSQUARE_INVALIDACCTION_HPP #define COMSQUARE_INVALIDACTION_HPP
#include <exception> #include <exception>
#include <string> #include <string>
@@ -11,12 +11,12 @@
namespace ComSquare namespace ComSquare
{ {
//! @brief Exception thrown when someone tries to load an invalid rom. //! @brief Exception thrown when someone tries to load an invalid rom.
class InvalidAcction : std::exception { class InvalidAction : std::exception {
private: private:
std::string _msg; std::string _msg;
public: public:
explicit InvalidAcction(const std::string &msg) : _msg(msg) {} explicit InvalidAction(const std::string &msg) : _msg(msg) {}
const char *what() const noexcept override { return this->_msg.c_str(); } const char *what() const noexcept override { return this->_msg.c_str(); }
}; };
} }
#endif //COMSQUARE_INVALIDACCTION_HPP #endif //COMSQUARE_INVALIDACTION_HPP
+2 -2
View File
@@ -27,8 +27,8 @@ namespace ComSquare::Renderer
//! @brief Update the screen by printing the buffer. //! @brief Update the screen by printing the buffer.
void drawScreen() override; void drawScreen() override;
//! @brief Add a pixel to the buffer to the coordinates x, y with the color rgba. //! @brief Add a pixel to the buffer to the coordinates x, y with the color rgba.
//! @param X : horizontal index. //! @param X horizontal index.
//! @param Y : vertical index. //! @param Y vertical index.
//! @param rgba : The color of the pixel. //! @param rgba : The color of the pixel.
void putPixel(int x, int y, uint8_t rgba) override ; void putPixel(int x, int y, uint8_t rgba) override ;
}; };