33#include "GraphicsApi.h"
41#ifndef DOXYGEN_SHOULD_SKIP_THIS
58#ifndef DOXYGEN_SHOULD_SKIP_THIS
63 static constexpr bool value =
true;
212 return m_isFullscreen;
485 void makeMainContextCurrent();
486 void makeSharedContextCurrent();
487 void makeNoContextCurrent();
490 static std::vector<Event> g_pendingEvents;
492 bool pickEventForWindow(uint32_t windowId,
Event& event);
498 SDL_Window *m_window;
501 void *m_sharedContext;
512#ifndef DOXYGEN_SHOULD_SKIP_THIS
Utility class that measures the elapsed time.
Definition: Clock.h:61
A mouse cursor.
Definition: Cursor.h:63
Bitfield relying on an enumeration.
Definition: Flags.h:46
A class to represent the library.
Definition: Library.h:44
A window that can serve as a target for 2D drawing.
Definition: RenderWindow.h:80
A shared OpenGL context with the main thread.
Definition: SharedGraphics.h:42
Represents a time value.
Definition: Time.h:65
An OS window.
Definition: Window.h:82
void maximize()
Maximize the window.
void setFramerateLimit(unsigned int limit)
Limit the framerate to a maximum fixed frequency.
bool isVisible() const
Check if the window is visible.
void setVisible(bool visible=true)
Show or hide the window.
void setTitle(const std::string &title)
Change the title of the window.
void setDecorated(bool decorated=true)
Show or hide the decoration of the window.
bool isFocused() const
Check if the window is focused.
Window(const Window &)=delete
Deleted copy constructor.
void hide()
Hide a window.
void setFullscreen(bool full=true)
Change the window state to fullscreen or not.
void show()
Show a window.
void close()
Request for closing.
void setResizable(bool resizable=true)
Set the window resizable or not.
void setSize(Vector2i size)
Change the size of the rendering region of the window.
void setMouseCursorVisible(bool visible)
Show or hide the mouse cursor.
Vector2i getFramebufferSize() const
Get the size of the underlying framebuffer.
void setMouseCursor(const Cursor &cursor)
Set the displayed cursor to a native system cursor.
Vector2i getSize() const
Get the size of the rendering region of the window.
void minimize()
Minimize the window.
bool isResizable() const
Check if the window is resizable.
bool isDecorated() const
Check if the window is decorated.
Window & operator=(const Window &)=delete
Deleted copy assignment.
bool pollEvent(Event &event)
Pop the event on top of the event queue, if any, and return it.
void setMouseCursorGrabbed(bool grabbed)
Grab or release the mouse cursor.
Vector2i getPosition() const
Get the position of the window.
bool waitEvent(Event &event)
Wait for an event and return it.
Window(const std::string &title, Vector2i size, Flags< WindowHints > hints=All)
Create a new window.
bool isMaximized() const
Check if the window is maximized.
void setPosition(Vector2i position)
Change the position of the window on screen.
void toggleFullscreen()
Toggle the fullscreen state.
bool isMinimized() const
Check if the window is minimized.
bool isFullscreen() const
Check if the window is fullscreen or not.
Definition: Window.h:211
bool isVerticalSyncEnabled() const
Check if the vertical synchronization is enabled.
bool isOpen()
Tell whether or not closing has been requested.
void restore()
Restore the window.
void setVerticalSyncEnabled(bool enabled)
Enable or disable vertical synchronization.
void display()
Display on screen what has been rendered to the window so far.
uint32_t getWindowId() const
Get the window id.
Definition: Window.h:332
@ Visible
The cell is visible (computed by FoV)
constexpr AllType All
Constant to represent "all".
Definition: Types.h:61
WindowHints
Hints for window creation.
Definition: Window.h:52
@ Decorated
Is the window decorated?
@ Resizable
Is the window resizable?
@ Event
An event is pending on the sockets.
ValueActivity value(float origin, float target, float &value, Time duration, Easing easing=Ease::linear)
Create a gf::ValueActivity.
Definition: Activities.h:526
The namespace for gf classes.
Defines a system event and its parameters.
Definition: Event.h:224