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