25 #ifndef SFML_WINDOW_HPP
26 #define SFML_WINDOW_HPP
31 #include <SFML/Window/ContextSettings.hpp>
32 #include <SFML/Window/Cursor.hpp>
33 #include <SFML/Window/Export.hpp>
34 #include <SFML/Window/GlResource.hpp>
35 #include <SFML/Window/VideoMode.hpp>
36 #include <SFML/Window/WindowHandle.hpp>
37 #include <SFML/Window/WindowStyle.hpp>
38 #include <SFML/System/Clock.hpp>
39 #include <SFML/System/NonCopyable.hpp>
40 #include <SFML/System/String.hpp>
41 #include <SFML/System/Vector2.hpp>
315 void setIcon(
unsigned int width,
unsigned int height,
const Uint8* pixels);
534 bool filterEvent(
const Event& event);
545 priv::WindowImpl* m_impl;
546 priv::GlContext* m_context;
548 Time m_frameTimeLimit;
Utility class that measures the elapsed time.
Cursor defines the appearance of a system cursor.
Defines a system event and its parameters.
Base class for classes that require an OpenGL context.
Utility class that makes any derived class non-copyable.
Utility string class that automatically handles conversions between types and encodings.
Utility template class for manipulating 2-dimensional vectors.
VideoMode defines a video mode (width, height, bpp)
Window that serves as a target for OpenGL rendering.
virtual void onCreate()
Function called after the window has been created.
virtual void onResize()
Function called after the window has been resized.
void setVisible(bool visible)
Show or hide the window.
Window(VideoMode mode, const String &title, Uint32 style=Style::Default, const ContextSettings &settings=ContextSettings())
Construct a new window.
void create(VideoMode mode, const String &title, Uint32 style=Style::Default, const ContextSettings &settings=ContextSettings())
Create (or recreate) the window.
bool pollEvent(Event &event)
Pop the event on top of the event queue, if any, and return it.
Vector2u getSize() const
Get the size of the rendering region of the window.
void setTitle(const String &title)
Change the title of the window.
Vector2i getPosition() const
Get the position of the window.
Window()
Default constructor.
void requestFocus()
Request the current window to be made the active foreground window.
void setVerticalSyncEnabled(bool enabled)
Enable or disable vertical synchronization.
void setMouseCursorGrabbed(bool grabbed)
Grab or release the mouse cursor.
void setIcon(unsigned int width, unsigned int height, const Uint8 *pixels)
Change the window's icon.
void setPosition(const Vector2i &position)
Change the position of the window on screen.
Window(WindowHandle handle, const ContextSettings &settings=ContextSettings())
Construct the window from an existing control.
void close()
Close the window and destroy all the attached resources.
void setJoystickThreshold(float threshold)
Change the joystick threshold.
bool setActive(bool active=true) const
Activate or deactivate the window as the current target for OpenGL rendering.
void setMouseCursor(const Cursor &cursor)
Set the displayed cursor to a native system cursor.
void setMouseCursorVisible(bool visible)
Show or hide the mouse cursor.
bool waitEvent(Event &event)
Wait for an event and return it.
void setSize(const Vector2u &size)
Change the size of the rendering region of the window.
virtual ~Window()
Destructor.
void create(WindowHandle handle, const ContextSettings &settings=ContextSettings())
Create (or recreate) the window from an existing control.
WindowHandle getSystemHandle() const
Get the OS-specific handle of the window.
bool hasFocus() const
Check whether the window has the input focus.
void display()
Display on screen what has been rendered to the window so far.
const ContextSettings & getSettings() const
Get the settings of the OpenGL context of the window.
bool isOpen() const
Tell whether or not the window is open.
void setKeyRepeatEnabled(bool enabled)
Enable or disable automatic key-repeat.
void setFramerateLimit(unsigned int limit)
Limit the framerate to a maximum fixed frequency.
platform specific WindowHandle
Define a low-level window handle type, specific to each platform.
@ Default
Default window style.
Structure defining the settings of the OpenGL context attached to a window.