Add first version of SFMLController and View class
This commit is contained in:
parent
ddaf5ba3ba
commit
ce3f721e16
9 changed files with 113 additions and 3 deletions
2
src/View/CMakeLists.txt
Normal file
2
src/View/CMakeLists.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
#Make Model lib
|
||||
add_library(View ./MainWindow.cpp)
|
25
src/View/MainWindow.cpp
Normal file
25
src/View/MainWindow.cpp
Normal file
|
@ -0,0 +1,25 @@
|
|||
#include "MainWindow.hpp"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
MainWindow::MainWindow(int width, int height, std::string title):
|
||||
RenderWindow(sf::VideoMode(width,height), title),
|
||||
skin()
|
||||
{
|
||||
|
||||
//Define skin:
|
||||
skin.push_back(sf::Color(250,248,239));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
MainWindow::~MainWindow(){
|
||||
}
|
||||
|
||||
void MainWindow::clearMW(){
|
||||
RenderWindow::clear(skin.at(0));
|
||||
}
|
20
src/View/MainWindow.hpp
Normal file
20
src/View/MainWindow.hpp
Normal file
|
@ -0,0 +1,20 @@
|
|||
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <SFML/Window.hpp>
|
||||
#include <SFML/Graphics.hpp>
|
||||
|
||||
|
||||
class MainWindow : public sf::RenderWindow{
|
||||
|
||||
private:
|
||||
std::vector<sf::Color> skin;
|
||||
public:
|
||||
MainWindow(int width, int height, std::string title);
|
||||
~MainWindow();
|
||||
|
||||
void clearMW();
|
||||
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue