#include <Window.h>
Public 成员函数 | |
| Window () | |
| ~Window () | |
| void | setSize (int width, int height) override |
| Requests a new logical window size. | |
| int | getWidth () const override |
| int | getHeight () const override |
| bool | setWindowSettings (WindowSettings settings) override |
| Applies a full WindowSettings struct (recreates the window when needed). | |
| WindowSettings | getWindowSettings () override |
| void | close () override |
| Closes and destroys the underlying window. | |
| bool | setFullscreenDesktop (bool fullscreen) override |
| Switches between desktop fullscreen and windowed mode. | |
| bool | setFullscreenExclusive (bool fullscreen) override |
| Switches between exclusive fullscreen and windowed mode. | |
| bool | isOpen () const override |
| void | setWindowTitle (const std::string &title) override |
| Sets the window title shown in the OS title bar. | |
| const std::string & | getWindowTitle () const override |
| void | setPosition (int x, int y, int display) override |
| Moves the window to a position in logical units on the given display. | |
| void | getPosition (int &x, int &y, int &display) override |
| Reads the current window position and display index. | |
| void | minimize () override |
| Minimizes / maximizes / restores the window. | |
| void | maximize () override |
| void | restore () override |
| bool | isMaximized () const override |
| bool | isMinimized () const override |
| bool | hasFocus () const override |
| True when the window has keyboard focus. | |
| bool | hasMouseFocus () const override |
| True when the window has mouse focus. | |
| bool | isVisible () const override |
| void | setVSync (int vsync) override |
| Enables/disables vertical sync (0 = off, 1 = on). | |
| int | getVSync () const override |
| int | getPixelWidth () const override |
| Framebuffer (pixel) dimensions of the window. | |
| int | getPixelHeight () const override |
| double | getDPIScale () const override |
| Current UI/logical DPI scale (1.0 on non-retina displays). | |
| double | getNativeDPIScale () const override |
| Native DPI scale reported by the OS for this window. | |
| void | windowToPixelCoords (double *x, double *y) const override |
| Converts window logical coordinates to framebuffer pixel coordinates. | |
| void | pixelToWindowCoords (double *x, double *y) const override |
| Converts framebuffer pixel coordinates to window logical coordinates. | |
| void | windowToDPICoords (double *x, double *y) const override |
| Converts window logical coordinates to UI-DPI coordinates. | |
| void | DPIToWindowCoords (double *x, double *y) const override |
| Converts UI-DPI coordinates to window logical coordinates. | |
| double | toPixels (double x) const override |
| Scales a logical length to UI pixels (and back). | |
| double | fromPixels (double x) const override |
| void | toPixelsXY (double wx, double wy, double &px, double &py) const override |
| Vector variants of the coordinate conversions above. | |
| void | fromPixelsXY (double px, double py, double &wx, double &wy) const override |
| void * | getHandle () const override |
| Native window handle (SDL_Window* on SDL backend). | |
| int | getDisplayCount () const override |
| Number of displays attached to the system. | |
| std::string | getDisplayName (int display) const override |
| Human-readable display name for a display index. | |
| std::string | getDisplayOrientation (int display) const override |
| Display orientation string (e.g. "landscape"). | |
| std::vector< WindowSize > | getFullscreenSizes (int display) const override |
| Fullscreen sizes supported by a display. | |
| void | getDesktopDimensions (int display, int &width, int &height) const override |
| Desktop resolution of a display. | |
| bool | showMessageBox (const std::string &title, const std::string &message, const std::string &type, bool attachToWindow) override |
| Shows a modal message box ("info", "warning", or "error"). | |
| int | showMessageBoxData (const MessageBoxData &data) override |
| Shows a configurable message box; returns the pressed button index. | |
| void | requestAttention (bool continuous) override |
| Requests OS attention (flashing taskbar); continuous repeats until focused. | |
| bool | setIconRGBA (const uint8_t *rgba, int width, int height) override |
| Sets the window icon from tightly packed RGBA8 pixels (w*h*4 bytes). | |
| void | updateSettings (const WindowSettings &newsettings, bool updateGraphicsViewport) |
| Used by event backend on resize to refresh drawable size / viewport. | |
Public 成员函数 继承自 eve::window::Window | |
| Module_REG (Window) | |
Public 成员函数 继承自 eve::Module | |
| virtual | ~Module () |
| virtual std::string | getName () const =0 |
详细描述
构造及析构函数说明
◆ Window()
| eve::window::sdl::Window::Window | ( | ) |
在文件 Window.cpp 第 51 行定义.
◆ ~Window()
|
virtual |
重载 eve::window::Window .
在文件 Window.cpp 第 56 行定义.
成员函数说明
◆ close()
|
overridevirtual |
Closes and destroys the underlying window.
实现了 eve::window::Window.
在文件 Window.cpp 第 552 行定义.
引用了 close().
被这些函数引用 close() , 以及 setWindowSettings().
◆ DPIToWindowCoords()
|
overridevirtual |
Converts UI-DPI coordinates to window logical coordinates.
实现了 eve::window::Window.
在文件 Window.cpp 第 375 行定义.
引用了 getDPIScale(), s, x , 以及 y.
◆ fromPixels()
|
overridevirtual |
实现了 eve::window::Window.
在文件 Window.cpp 第 384 行定义.
引用了 getNativeDPIScale(), s , 以及 x.
被这些函数引用 fromPixelsXY().
◆ fromPixelsXY()
|
overridevirtual |
◆ getDesktopDimensions()
|
overridevirtual |
Desktop resolution of a display.
实现了 eve::window::Window.
在文件 Window.cpp 第 437 行定义.
引用了 getDisplayCount(), height , 以及 width.
◆ getDisplayCount()
|
overridevirtual |
Number of displays attached to the system.
实现了 eve::window::Window.
在文件 Window.cpp 第 399 行定义.
引用了 n.
被这些函数引用 getDesktopDimensions(), getDisplayName(), getDisplayOrientation(), getFullscreenSizes() , 以及 setWindowSettings().
◆ getDisplayName()
|
overridevirtual |
Human-readable display name for a display index.
实现了 eve::window::Window.
在文件 Window.cpp 第 404 行定义.
引用了 getDisplayCount() , 以及 n.
◆ getDisplayOrientation()
|
overridevirtual |
Display orientation string (e.g. "landscape").
实现了 eve::window::Window.
在文件 Window.cpp 第 410 行定义.
引用了 getDisplayCount().
◆ getDPIScale()
|
overridevirtual |
Current UI/logical DPI scale (1.0 on non-retina displays).
实现了 eve::window::Window.
在文件 Window.cpp 第 346 行定义.
引用了 eve::window::WindowSettings::dpi_scale, getNativeDPIScale() , 以及 eve::window::WindowSettings::use_dpi_scale.
被这些函数引用 DPIToWindowCoords() , 以及 windowToDPICoords().
◆ getFullscreenSizes()
|
overridevirtual |
Fullscreen sizes supported by a display.
实现了 eve::window::Window.
在文件 Window.cpp 第 421 行定义.
引用了 getDisplayCount(), s , 以及 eve::window::Window::WindowSize::width.
◆ getHandle()
|
inlineoverridevirtual |
◆ getHeight()
|
overridevirtual |
◆ getNativeDPIScale()
|
overridevirtual |
Native DPI scale reported by the OS for this window.
实现了 eve::window::Window.
在文件 Window.cpp 第 341 行定义.
被这些函数引用 fromPixels(), getDPIScale(), pixelToWindowCoords(), toPixels() , 以及 windowToPixelCoords().
◆ getPixelHeight()
|
overridevirtual |
实现了 eve::window::Window.
在文件 Window.cpp 第 339 行定义.
◆ getPixelWidth()
|
overridevirtual |
◆ getPosition()
|
overridevirtual |
Reads the current window position and display index.
实现了 eve::window::Window.
在文件 Window.cpp 第 293 行定义.
引用了 eve::window::WindowSettings::display, x, eve::window::WindowSettings::x, y , 以及 eve::window::WindowSettings::y.
◆ getVSync()
|
overridevirtual |
◆ getWidth()
|
overridevirtual |
◆ getWindowSettings()
|
overridevirtual |
实现了 eve::window::Window.
在文件 Window.cpp 第 204 行定义.
◆ getWindowTitle()
|
overridevirtual |
实现了 eve::window::Window.
在文件 Window.cpp 第 278 行定义.
◆ hasFocus()
|
overridevirtual |
◆ hasMouseFocus()
|
overridevirtual |
◆ isMaximized()
|
overridevirtual |
实现了 eve::window::Window.
在文件 Window.cpp 第 314 行定义.
◆ isMinimized()
|
overridevirtual |
实现了 eve::window::Window.
在文件 Window.cpp 第 317 行定义.
◆ isOpen()
|
overridevirtual |
实现了 eve::window::Window.
在文件 Window.cpp 第 271 行定义.
◆ isVisible()
|
overridevirtual |
实现了 eve::window::Window.
在文件 Window.cpp 第 326 行定义.
◆ maximize()
|
overridevirtual |
实现了 eve::window::Window.
在文件 Window.cpp 第 311 行定义.
◆ minimize()
|
overridevirtual |
◆ pixelToWindowCoords()
|
overridevirtual |
Converts framebuffer pixel coordinates to window logical coordinates.
实现了 eve::window::Window.
在文件 Window.cpp 第 359 行定义.
引用了 getNativeDPIScale(), s, x , 以及 y.
◆ requestAttention()
|
overridevirtual |
Requests OS attention (flashing taskbar); continuous repeats until focused.
实现了 eve::window::Window.
在文件 Window.cpp 第 476 行定义.
◆ restore()
|
overridevirtual |
实现了 eve::window::Window.
在文件 Window.cpp 第 312 行定义.
◆ setFullscreenDesktop()
|
overridevirtual |
Switches between desktop fullscreen and windowed mode.
实现了 eve::window::Window.
在文件 Window.cpp 第 206 行定义.
◆ setFullscreenExclusive()
|
overridevirtual |
Switches between exclusive fullscreen and windowed mode.
实现了 eve::window::Window.
在文件 Window.cpp 第 210 行定义.
◆ setIconRGBA()
|
overridevirtual |
Sets the window icon from tightly packed RGBA8 pixels (w*h*4 bytes).
实现了 eve::window::Window.
在文件 Window.cpp 第 487 行定义.
被这些函数引用 setWindowSettings().
◆ setPosition()
|
overridevirtual |
Moves the window to a position in logical units on the given display.
实现了 eve::window::Window.
在文件 Window.cpp 第 280 行定义.
引用了 eve::window::WindowSettings::display, eve::window::WindowSettings::use_position, x, eve::window::WindowSettings::x, y , 以及 eve::window::WindowSettings::y.
◆ setSize()
|
overridevirtual |
Requests a new logical window size.
实现了 eve::window::Window.
在文件 Window.cpp 第 58 行定义.
引用了 f, height, setWindowSettings(), width , 以及 eve::window::WindowSettings::width.
◆ setVSync()
|
overridevirtual |
Enables/disables vertical sync (0 = off, 1 = on).
实现了 eve::window::Window.
在文件 Window.cpp 第 331 行定义.
◆ setWindowSettings()
|
overridevirtual |
Applies a full WindowSettings struct (recreates the window when needed).
实现了 eve::window::Window.
在文件 Window.cpp 第 70 行定义.
引用了 close(), f, getDisplayCount(), eve::cap::query(), setIconRGBA(), updateSettings(), x , 以及 y.
被这些函数引用 setSize().
◆ setWindowTitle()
|
overridevirtual |
◆ showMessageBox()
|
overridevirtual |
Shows a modal message box ("info", "warning", or "error").
实现了 eve::window::Window.
在文件 Window.cpp 第 447 行定义.
◆ showMessageBoxData()
|
overridevirtual |
Shows a configurable message box; returns the pressed button index.
实现了 eve::window::Window.
在文件 Window.cpp 第 453 行定义.
引用了 data.
◆ toPixels()
|
overridevirtual |
Scales a logical length to UI pixels (and back).
实现了 eve::window::Window.
在文件 Window.cpp 第 382 行定义.
引用了 getNativeDPIScale() , 以及 x.
被这些函数引用 toPixelsXY().
◆ toPixelsXY()
|
overridevirtual |
Vector variants of the coordinate conversions above.
实现了 eve::window::Window.
在文件 Window.cpp 第 389 行定义.
引用了 px , 以及 toPixels().
◆ updateSettings()
| void eve::window::sdl::Window::updateSettings | ( | const WindowSettings & | newsettings, |
| bool | updateGraphicsViewport | ||
| ) |
Used by event backend on resize to refresh drawable size / viewport.
在文件 Window.cpp 第 573 行定义.
引用了 eve::cap::query().
被这些函数引用 setWindowSettings().
◆ windowToDPICoords()
|
overridevirtual |
Converts window logical coordinates to UI-DPI coordinates.
实现了 eve::window::Window.
在文件 Window.cpp 第 367 行定义.
引用了 getDPIScale(), s, x , 以及 y.
◆ windowToPixelCoords()
|
overridevirtual |
Converts window logical coordinates to framebuffer pixel coordinates.
实现了 eve::window::Window.
在文件 Window.cpp 第 352 行定义.
引用了 getNativeDPIScale(), s, x , 以及 y.
该类的文档由以下文件生成:
- src/modules/window/sdl/Window.h
- src/modules/window/sdl/Window.cpp
Public 成员函数 继承自