SFML - Simple and Fast Multimedia Library

SFML 2.6.2

- Main Page
- Related Pages
- Topics
- Namespaces
- Classes
- Files

- File List
- File Members

Loading...
Searching...
No Matches
Window/Window.hpp
Go to the documentation of this file.
1
2//
3// SFML - Simple and Fast Multimedia Library
4// Copyright (C) 2007-2023 Laurent Gomila (laurent@sfml-dev.org)
5//
6// This software is provided 'as-is', without any express or implied warranty.
7// In no event will the authors be held liable for any damages arising from the use of this software.
8//
9// Permission is granted to anyone to use this software for any purpose,
10// including commercial applications, and to alter it and redistribute it freely,
11// subject to the following restrictions:
12//
13// 1. The origin of this software must not be misrepresented;
14// you must not claim that you wrote the original software.
15// If you use this software in a product, an acknowledgment
16// in the product documentation would be appreciated but is not required.
17//
18// 2. Altered source versions must be plainly marked as such,
19// and must not be misrepresented as being the original software.
20//
21// 3. This notice may not be removed or altered from any source distribution.
22//
24
25#ifndef SFML_WINDOW_HPP
26#define SFML_WINDOW_HPP
27
29// Headers
31#include <SFML/Window/ContextSettings.hpp>
32#include <SFML/Window/GlResource.hpp>
33#include <SFML/Window/WindowBase.hpp>
34
35
36namespace sf
37{
38namespace priv
39{
40 class GlContext;
41}
42
43class Event;
44
49 class SFML_WINDOW_API Window : public WindowBase, GlResource
50{
51public:
52
60 Window();
61
81 Window(VideoMode mode, const String& title, Uint32 style = Style::Default, const ContextSettings& settings = ContextSettings());
82
97 explicit Window(WindowHandle handle, const ContextSettings& settings = ContextSettings());
98
105 virtual ~Window();
106
119 virtual void create(VideoMode mode, const String& title, Uint32 style = Style::Default);
120
138 virtual void create(VideoMode mode, const String& title, Uint32 style, const ContextSettings& settings);
139
150 virtual void create(WindowHandle handle);
151
167 virtual void create(WindowHandle handle, const ContextSettings& settings);
168
179 virtual void close();
180
192 const ContextSettings& getSettings() const;
193
207 void setVerticalSyncEnabled(bool enabled);
208
224 void setFramerateLimit(unsigned int limit);
225
242 bool setActive(bool active = true) const;
243
252 void display();
253
254private:
255
268 bool filterEvent(const Event& event);
269
274 void initialize();
275
277 // Member data
279 priv::GlContext* m_context;
280 Clock m_clock;
281 Time m_frameTimeLimit;
282};
283
284} // namespace sf
285
286
287#endif // SFML_WINDOW_HPP
288
289
ContextSettings.hpp
GlResource.hpp
WindowBase.hpp
SFML_WINDOW_API
#define SFML_WINDOW_API
Definition Window/Export.hpp:43
sf::Clock
Utility class that measures the elapsed time.
Definition Clock.hpp:42
sf::Event
Defines a system event and its parameters.
Definition Event.hpp:45
sf::GlResource
Base class for classes that require an OpenGL context.
Definition GlResource.hpp:47
sf::String
Utility string class that automatically handles conversions between types and encodings.
Definition String.hpp:46
sf::Time
Represents a time value.
Definition Time.hpp:41
sf::VideoMode
VideoMode defines a video mode (width, height, bpp)
Definition VideoMode.hpp:42
sf::WindowBase
Window that serves as a base for other windows.
Definition WindowBase.hpp:57
sf::Window
Window that serves as a target for OpenGL rendering.
Definition Window/Window.hpp:50
sf::Window::getSettings
const ContextSettings & getSettings() const
Get the settings of the OpenGL context of the window.
sf::Window::create
virtual void create(WindowHandle handle, const ContextSettings &settings)
Create (or recreate) the window from an existing control.
sf::Window::Window
Window(VideoMode mode, const String &title, Uint32 style=Style::Default, const ContextSettings &settings=ContextSettings())
Construct a new window.
sf::Window::Window
Window()
Default constructor.
sf::Window::setVerticalSyncEnabled
void setVerticalSyncEnabled(bool enabled)
Enable or disable vertical synchronization.
sf::Window::create
virtual void create(WindowHandle handle)
Create (or recreate) the window from an existing control.
sf::Window::create
virtual void create(VideoMode mode, const String &title, Uint32 style, const ContextSettings &settings)
Create (or recreate) the window.
sf::Window::Window
Window(WindowHandle handle, const ContextSettings &settings=ContextSettings())
Construct the window from an existing control.
sf::Window::close
virtual void close()
Close the window and destroy all the attached resources.
sf::Window::setActive
bool setActive(bool active=true) const
Activate or deactivate the window as the current target for OpenGL rendering.
sf::Window::~Window
virtual ~Window()
Destructor.
sf::Window::create
virtual void create(VideoMode mode, const String &title, Uint32 style=Style::Default)
Create (or recreate) the window.
sf::Window::display
void display()
Display on screen what has been rendered to the window so far.
sf::Window::setFramerateLimit
void setFramerateLimit(unsigned int limit)
Limit the framerate to a maximum fixed frequency.
sf::WindowHandle
platform specific WindowHandle
Define a low-level window handle type, specific to each platform.
Definition WindowHandle.hpp:68
sf
Definition AlResource.hpp:35
sf::Uint32
unsigned int Uint32
Definition Config.hpp:227
sf::ContextSettings
Structure defining the settings of the OpenGL context attached to a window.
Definition ContextSettings.hpp:38