SDL2 desktop/mobile implementation of eve::window::Window. 更多...
#include <Window.h>
Public 成员函数 | |
| Window () | |
| Constructs an unopened window module; call setWindowSettings to create. | |
| ~Window () | |
| Destroys the SDL_Window if still open. | |
| void | setSize (int w, int h) override |
| Requests a new logical window size. | |
| int | getWidth () const override |
| Current logical window width. | |
| int | getHeight () const override |
| Current logical window height. | |
| bool | setWindowSettings (WindowSettings settings) override |
| Applies a full WindowSettings struct (recreates the window when needed). | |
| WindowSettings | getWindowSettings () override |
| Returns the settings last applied to this window. | |
| 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 |
| True while the native window exists and has not been closed. | |
| void | setWindowTitle (const std::string &title) override |
| Sets the window title shown in the OS title bar. | |
| const std::string & | getWindowTitle () const override |
| Current title string. | |
| 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 the window. | |
| void | maximize () override |
| Maximizes the window. | |
| void | restore () override |
| Restores from minimized/maximized state. | |
| bool | isMaximized () const override |
| True when the window is maximized. | |
| bool | isMinimized () const override |
| True when the window is minimized. | |
| 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 |
| True when the window is visible (not hidden). | |
| void | setVSync (int vsync) override |
| Enables/disables vertical sync (0 = off, 1 = on). | |
| int | getVSync () const override |
| Current vsync setting (0 = off, 1 = on). | |
| int | getPixelWidth () const override |
| Framebuffer (pixel) width of the window. | |
| int | getPixelHeight () const override |
| Framebuffer (pixel) height of the window. | |
| 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. | |
| double | fromPixels (double x) const override |
| Scales a UI-pixel length back to logical units. | |
| void | toPixelsXY (double wx, double wy, double &px, double &py) const override |
| Converts a logical XY pair to framebuffer pixels. | |
| void | fromPixelsXY (double px, double py, double &wx, double &wy) const override |
| Converts a framebuffer pixel XY pair to logical coordinates. | |
| 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 &outWidth, int &outHeight) const override |
| Desktop resolution of a display. | |
| bool | showMessageBox (const std::string &caption, 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 w, int h) 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 () |
| Module. | |
| virtual std::string | getName () const =0 |
| Returns the name. | |
详细描述
SDL2 desktop/mobile implementation of eve::window::Window.
构造及析构函数说明
◆ Window()
| eve::window::sdl::Window::Window | ( | ) |
Constructs an unopened window module; call setWindowSettings to create.
在文件 Window.cpp 第 52 行定义.
◆ ~Window()
|
virtual |
成员函数说明
◆ close()
|
overridevirtual |
Closes and destroys the underlying window.
实现了 eve::window::Window.
在文件 Window.cpp 第 562 行定义.
引用了 close().
被这些函数引用 close() , 以及 setWindowSettings().
◆ DPIToWindowCoords()
|
overridevirtual |
Converts UI-DPI coordinates to window logical coordinates.
实现了 eve::window::Window.
在文件 Window.cpp 第 386 行定义.
引用了 getDPIScale(), s, x , 以及 y.
◆ fromPixels()
|
overridevirtual |
Scales a UI-pixel length back to logical units.
实现了 eve::window::Window.
在文件 Window.cpp 第 395 行定义.
引用了 getNativeDPIScale(), s , 以及 x.
被这些函数引用 fromPixelsXY().
◆ fromPixelsXY()
|
overridevirtual |
Converts a framebuffer pixel XY pair to logical coordinates.
实现了 eve::window::Window.
在文件 Window.cpp 第 405 行定义.
引用了 fromPixels(), px, py, wx , 以及 wy.
◆ getDesktopDimensions()
|
overridevirtual |
Desktop resolution of a display.
实现了 eve::window::Window.
在文件 Window.cpp 第 448 行定义.
引用了 getDisplayCount().
◆ getDisplayCount()
|
overridevirtual |
Number of displays attached to the system.
实现了 eve::window::Window.
在文件 Window.cpp 第 410 行定义.
引用了 n.
被这些函数引用 getDesktopDimensions(), getDisplayName(), getDisplayOrientation(), getFullscreenSizes() , 以及 setWindowSettings().
◆ getDisplayName()
|
overridevirtual |
Human-readable display name for a display index.
实现了 eve::window::Window.
在文件 Window.cpp 第 415 行定义.
引用了 getDisplayCount() , 以及 n.
◆ getDisplayOrientation()
|
overridevirtual |
Display orientation string (e.g. "landscape").
实现了 eve::window::Window.
在文件 Window.cpp 第 421 行定义.
引用了 getDisplayCount().
◆ getDPIScale()
|
overridevirtual |
Current UI/logical DPI scale (1.0 on non-retina displays).
实现了 eve::window::Window.
在文件 Window.cpp 第 357 行定义.
引用了 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 第 432 行定义.
引用了 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 第 352 行定义.
被这些函数引用 fromPixels(), getDPIScale(), pixelToWindowCoords(), toPixels() , 以及 windowToPixelCoords().
◆ getPixelHeight()
|
overridevirtual |
◆ getPixelWidth()
|
overridevirtual |
◆ getPosition()
|
overridevirtual |
Reads the current window position and display index.
实现了 eve::window::Window.
在文件 Window.cpp 第 304 行定义.
引用了 bounds, eve::window::WindowSettings::display, wx, wy, x, eve::window::WindowSettings::x, y , 以及 eve::window::WindowSettings::y.
◆ getVSync()
|
overridevirtual |
◆ getWidth()
|
overridevirtual |
◆ getWindowSettings()
|
overridevirtual |
Returns the settings last applied to this window.
实现了 eve::window::Window.
在文件 Window.cpp 第 215 行定义.
◆ getWindowTitle()
|
overridevirtual |
◆ hasFocus()
|
overridevirtual |
◆ hasMouseFocus()
|
overridevirtual |
◆ isMaximized()
|
overridevirtual |
◆ isMinimized()
|
overridevirtual |
◆ isOpen()
|
overridevirtual |
True while the native window exists and has not been closed.
实现了 eve::window::Window.
在文件 Window.cpp 第 282 行定义.
◆ isVisible()
|
overridevirtual |
◆ maximize()
|
overridevirtual |
◆ minimize()
|
overridevirtual |
◆ pixelToWindowCoords()
|
overridevirtual |
Converts framebuffer pixel coordinates to window logical coordinates.
实现了 eve::window::Window.
在文件 Window.cpp 第 370 行定义.
引用了 getNativeDPIScale(), s, x , 以及 y.
◆ requestAttention()
|
overridevirtual |
Requests OS attention (flashing taskbar); continuous repeats until focused.
实现了 eve::window::Window.
在文件 Window.cpp 第 487 行定义.
◆ restore()
|
overridevirtual |
◆ setFullscreenDesktop()
|
overridevirtual |
Switches between desktop fullscreen and windowed mode.
实现了 eve::window::Window.
在文件 Window.cpp 第 217 行定义.
◆ setFullscreenExclusive()
|
overridevirtual |
Switches between exclusive fullscreen and windowed mode.
实现了 eve::window::Window.
在文件 Window.cpp 第 221 行定义.
◆ setIconRGBA()
|
overridevirtual |
Sets the window icon from tightly packed RGBA8 pixels (w*h*4 bytes).
实现了 eve::window::Window.
在文件 Window.cpp 第 498 行定义.
被这些函数引用 setWindowSettings().
◆ setPosition()
|
overridevirtual |
Moves the window to a position in logical units on the given display.
实现了 eve::window::Window.
在文件 Window.cpp 第 291 行定义.
引用了 bounds, count, 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 第 69 行定义.
引用了 f, h, setWindowSettings(), w , 以及 eve::window::WindowSettings::width.
◆ setVSync()
|
overridevirtual |
Enables/disables vertical sync (0 = off, 1 = on).
实现了 eve::window::Window.
在文件 Window.cpp 第 342 行定义.
◆ setWindowSettings()
|
overridevirtual |
Applies a full WindowSettings struct (recreates the window when needed).
实现了 eve::window::Window.
在文件 Window.cpp 第 81 行定义.
引用了 close(), f, getDisplayCount(), setIconRGBA(), updateSettings(), x , 以及 y.
被这些函数引用 setSize().
◆ setWindowTitle()
|
overridevirtual |
Sets the window title shown in the OS title bar.
实现了 eve::window::Window.
在文件 Window.cpp 第 284 行定义.
引用了 t.
◆ showMessageBox()
|
overridevirtual |
Shows a modal message box ("info", "warning", or "error").
实现了 eve::window::Window.
在文件 Window.cpp 第 458 行定义.
◆ showMessageBoxData()
|
overridevirtual |
Shows a configurable message box; returns the pressed button index.
实现了 eve::window::Window.
在文件 Window.cpp 第 464 行定义.
◆ toPixels()
|
overridevirtual |
Scales a logical length to UI pixels.
实现了 eve::window::Window.
在文件 Window.cpp 第 393 行定义.
引用了 getNativeDPIScale() , 以及 x.
被这些函数引用 toPixelsXY().
◆ toPixelsXY()
|
overridevirtual |
Converts a logical XY pair to framebuffer pixels.
实现了 eve::window::Window.
在文件 Window.cpp 第 400 行定义.
引用了 px, py, toPixels(), wx , 以及 wy.
◆ 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 第 583 行定义.
被这些函数引用 setWindowSettings().
◆ windowToDPICoords()
|
overridevirtual |
Converts window logical coordinates to UI-DPI coordinates.
实现了 eve::window::Window.
在文件 Window.cpp 第 378 行定义.
引用了 getDPIScale(), s, x , 以及 y.
◆ windowToPixelCoords()
|
overridevirtual |
Converts window logical coordinates to framebuffer pixel coordinates.
实现了 eve::window::Window.
在文件 Window.cpp 第 363 行定义.
引用了 getNativeDPIScale(), s, x , 以及 y.
该类的文档由以下文件生成:
- src/modules/window/sdl/Window.h
- src/modules/window/sdl/Window.cpp
Public 成员函数 继承自