Created
September 29, 2017 19:25
-
-
Save wallabra/c5f36d49c33dbe2c4ec87b74ab614158 to your computer and use it in GitHub Desktop.
Another part
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef RENDERER_H | |
#define RENDERER_H | |
#include <SFML/Graphics.hpp> | |
#include <vector> | |
#include <string> | |
#include <functional> | |
#include "Vector.hpp" | |
using std::function; | |
using std::vector; | |
using std::string; | |
class Renderer | |
{ | |
public: | |
virtual bool render(int resX, int resY, Vector* colors) = 0; | |
virtual void drawWindow() = 0; | |
protected: | |
private: | |
}; | |
class SFMLRenderer: public Renderer | |
{ | |
public: | |
sf::RenderWindow window; | |
sf::Sprite raytraced; | |
string title; | |
bool bDrawDemanded; | |
SFMLRenderer(string _title); | |
bool render(int resX, int resY, Vector* colors); | |
void drawWindow(function<bool(SFMLRenderer&, double)> onDraw); | |
void drawDemanded() { bDrawDemanded = true; } | |
}; | |
#endif // RENDERER_H |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment