dc8d781393
* Add SFML support besides SDL. Choose with global macro USE_SDL / USE_SFML. + Small fixes to make it compile on MinGW (with Glad instead of GLEW -> option NO_GLEW) * Add SFML support besides SDL (Part 3). Cleaned up some macros. * Add SFML support besides SDL (Part 4). Small SFML fixes. Changed Spaces->Tabs * Add SFML support besides SDL (Part 5). Cleaning up more macros + small fixes. * Port to SFML. Removed all SDL code. * Small changes * Conversion functions to/from SFML types for Vector2/3 and Color. * Removed unused SDL files * Changes for SFML port * Changes for SFML port * Fixed line endings (probably?)
53 lines
1.1 KiB
C++
53 lines
1.1 KiB
C++
/*
|
|
* =====================================================================================
|
|
*
|
|
* Filename: Window.hpp
|
|
*
|
|
* Description:
|
|
*
|
|
* Created: 20/12/2014 00:16:51
|
|
*
|
|
* Author: Quentin Bazin, <quent42340@gmail.com>
|
|
*
|
|
* =====================================================================================
|
|
*/
|
|
#ifndef WINDOW_HPP_
|
|
#define WINDOW_HPP_
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
#include <SFML/Graphics/RenderWindow.hpp>
|
|
|
|
#include "IntTypes.hpp"
|
|
#include "RenderTarget.hpp"
|
|
|
|
class Window : public RenderTarget {
|
|
public:
|
|
void open(const std::string &caption, u16 width, u16 height);
|
|
|
|
void clear();
|
|
void display();
|
|
|
|
void setVerticalSyncEnabled(bool enabled);
|
|
|
|
u16 width() const { return m_width; }
|
|
u16 height() const { return m_height; }
|
|
|
|
void close() { m_isOpen = false; }
|
|
bool isOpen() const { return m_isOpen; }
|
|
|
|
sf::RenderWindow &window() { return m_window; }
|
|
const sf::RenderWindow &window() const { return m_window; }
|
|
|
|
private:
|
|
sf::RenderWindow m_window;
|
|
|
|
u16 m_width;
|
|
u16 m_height;
|
|
|
|
bool m_isOpen;
|
|
};
|
|
|
|
#endif // WINDOW_HPP_
|