25#ifndef SFML_WINDOW_HPP
26#define SFML_WINDOW_HPP
31#include <SFML/Window/Event.hpp>
32#include <SFML/Window/Input.hpp>
33#include <SFML/Window/VideoMode.hpp>
34#include <SFML/Window/WindowHandle.hpp>
35#include <SFML/Window/WindowListener.hpp>
36#include <SFML/Window/WindowSettings.hpp>
37#include <SFML/Window/WindowStyle.hpp>
38#include <SFML/System/Clock.hpp>
39#include <SFML/System/NonCopyable.hpp>
205 void SetSize(
unsigned int Width,
unsigned int Height);
213 void Show(
bool State);
232 void SetIcon(
unsigned int Width,
unsigned int Height,
const Uint8* Pixels);
243 bool SetActive(
bool Active =
true)
const;
290 virtual void OnCreate();
298 virtual void OnEvent(
const Event& EventReceived);
306 void Initialize(priv::WindowImpl* Impl);
311 priv::WindowImpl* myWindow;
312 std::queue<Event> myEvents;
316 float myLastFrameTime;
318 unsigned int myFramerateLimit;
Clock is an utility class for manipulating time.
Event defines a system event and its parameters.
VideoMode defines a video mode (width, height, bpp, frequency) and provides static functions for gett...
Base class for classes that want to receive events from a window (for internal use only).
const Input & GetInput() const
Get the input manager of the window.
unsigned int GetWidth() const
Get the width of the rendering region of the window.
void SetCursorPosition(unsigned int Left, unsigned int Top)
Change the position of the mouse cursor.
void SetIcon(unsigned int Width, unsigned int Height, const Uint8 *Pixels)
Change the window's icon.
void SetPosition(int Left, int Top)
Change the position of the window on screen.
void EnableKeyRepeat(bool Enabled)
Enable or disable automatic key-repeat.
float GetFrameTime() const
Get time elapsed since last frame.
Window()
Default constructor.
void SetFramerateLimit(unsigned int Limit)
Limit the framerate to a maximum fixed frequency.
void ShowMouseCursor(bool Show)
Show or hide the mouse cursor.
bool GetEvent(Event &EventReceived)
Get the event on top of events stack, if any, and pop it.
void Show(bool State)
Show or hide the window.
bool SetActive(bool Active=true) const
Activate of deactivate the window as the current target for rendering.
void Create(VideoMode Mode, const std::string &Title, unsigned long WindowStyle=Style::Resize|Style::Close, const WindowSettings &Params=WindowSettings())
Create (or recreate) the window.
void Close()
Close (destroy) the window.
unsigned int GetHeight() const
Get the height of the rendering region of the window.
void UseVerticalSync(bool Enabled)
Enable / disable vertical synchronization.
void SetJoystickThreshold(float Threshold)
Change the joystick threshold, ie.
void SetSize(unsigned int Width, unsigned int Height)
Change the size of the rendering region of the window.
bool IsOpened() const
Tell whether or not the window is opened (ie.
void Display()
Display the window on screen.
const WindowSettings & GetSettings() const
Get the creation settings of the window.
@ Resize
Titlebar + resizable border + maximize button.
@ Close
Titlebar + close button.
NonCopyable()
The default constructor won't be generated, so provide it.
Structure defining the creation settings of windows.