载入中...
搜索中...
未找到
eve::window::sdl::Window类 参考final

SDL2 desktop/mobile implementation of eve::window::Window. 更多...

#include <Window.h>

类 eve::window::sdl::Window 继承关系图:
eve::window::Window eve::Module

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.h 第 16 行定义.

构造及析构函数说明

◆ Window()

eve::window::sdl::Window::Window ( )

Constructs an unopened window module; call setWindowSettings to create.

在文件 Window.cpp 第 52 行定义.

引用了 eve::window::sdl::bindWindowEventSinkOwner().

◆ ~Window()

eve::window::sdl::Window::~Window ( )
virtual

Destroys the SDL_Window if still open.

重载 eve::window::Window .

在文件 Window.cpp 第 64 行定义.

引用了 eve::window::sdl::bindWindowEventSinkOwner().

成员函数说明

◆ close()

void eve::window::sdl::Window::close ( )
overridevirtual

Closes and destroys the underlying window.

实现了 eve::window::Window.

在文件 Window.cpp 第 562 行定义.

引用了 close().

被这些函数引用 close() , 以及 setWindowSettings().

◆ DPIToWindowCoords()

void eve::window::sdl::Window::DPIToWindowCoords ( double *  x,
double *  y 
) const
overridevirtual

Converts UI-DPI coordinates to window logical coordinates.

实现了 eve::window::Window.

在文件 Window.cpp 第 386 行定义.

引用了 getDPIScale(), s, x , 以及 y.

◆ fromPixels()

double eve::window::sdl::Window::fromPixels ( double  x) const
overridevirtual

Scales a UI-pixel length back to logical units.

实现了 eve::window::Window.

在文件 Window.cpp 第 395 行定义.

引用了 getNativeDPIScale(), s , 以及 x.

被这些函数引用 fromPixelsXY().

◆ fromPixelsXY()

void eve::window::sdl::Window::fromPixelsXY ( double  px,
double  py,
double &  wx,
double &  wy 
) const
overridevirtual

Converts a framebuffer pixel XY pair to logical coordinates.

实现了 eve::window::Window.

在文件 Window.cpp 第 405 行定义.

引用了 fromPixels(), px, py, wx , 以及 wy.

◆ getDesktopDimensions()

void eve::window::sdl::Window::getDesktopDimensions ( int  display,
int &  outWidth,
int &  outHeight 
) const
overridevirtual

Desktop resolution of a display.

实现了 eve::window::Window.

在文件 Window.cpp 第 448 行定义.

引用了 getDisplayCount().

◆ getDisplayCount()

int eve::window::sdl::Window::getDisplayCount ( ) const
overridevirtual

Number of displays attached to the system.

实现了 eve::window::Window.

在文件 Window.cpp 第 410 行定义.

引用了 n.

被这些函数引用 getDesktopDimensions(), getDisplayName(), getDisplayOrientation(), getFullscreenSizes() , 以及 setWindowSettings().

◆ getDisplayName()

std::string eve::window::sdl::Window::getDisplayName ( int  display) const
overridevirtual

Human-readable display name for a display index.

实现了 eve::window::Window.

在文件 Window.cpp 第 415 行定义.

引用了 getDisplayCount() , 以及 n.

◆ getDisplayOrientation()

std::string eve::window::sdl::Window::getDisplayOrientation ( int  display) const
overridevirtual

Display orientation string (e.g. "landscape").

实现了 eve::window::Window.

在文件 Window.cpp 第 421 行定义.

引用了 getDisplayCount().

◆ getDPIScale()

double eve::window::sdl::Window::getDPIScale ( ) const
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()

std::vector< Window::WindowSize > eve::window::sdl::Window::getFullscreenSizes ( int  display) const
overridevirtual

Fullscreen sizes supported by a display.

实现了 eve::window::Window.

在文件 Window.cpp 第 432 行定义.

引用了 getDisplayCount(), s , 以及 eve::window::Window::WindowSize::width.

◆ getHandle()

void * eve::window::sdl::Window::getHandle ( ) const
inlineoverridevirtual

Native window handle (SDL_Window* on SDL backend).

实现了 eve::window::Window.

在文件 Window.h 第 101 行定义.

◆ getHeight()

int eve::window::sdl::Window::getHeight ( ) const
overridevirtual

Current logical window height.

实现了 eve::window::Window.

在文件 Window.cpp 第 79 行定义.

引用了 eve::window::WindowSettings::height.

◆ getNativeDPIScale()

double eve::window::sdl::Window::getNativeDPIScale ( ) const
overridevirtual

Native DPI scale reported by the OS for this window.

实现了 eve::window::Window.

在文件 Window.cpp 第 352 行定义.

被这些函数引用 fromPixels(), getDPIScale(), pixelToWindowCoords(), toPixels() , 以及 windowToPixelCoords().

◆ getPixelHeight()

int eve::window::sdl::Window::getPixelHeight ( ) const
overridevirtual

Framebuffer (pixel) height of the window.

实现了 eve::window::Window.

在文件 Window.cpp 第 350 行定义.

◆ getPixelWidth()

int eve::window::sdl::Window::getPixelWidth ( ) const
overridevirtual

Framebuffer (pixel) width of the window.

实现了 eve::window::Window.

在文件 Window.cpp 第 348 行定义.

◆ getPosition()

void eve::window::sdl::Window::getPosition ( int &  x,
int &  y,
int &  display 
)
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()

int eve::window::sdl::Window::getVSync ( ) const
overridevirtual

Current vsync setting (0 = off, 1 = on).

实现了 eve::window::Window.

在文件 Window.cpp 第 346 行定义.

引用了 eve::window::WindowSettings::vsync.

◆ getWidth()

int eve::window::sdl::Window::getWidth ( ) const
overridevirtual

Current logical window width.

实现了 eve::window::Window.

在文件 Window.cpp 第 77 行定义.

引用了 eve::window::WindowSettings::width.

◆ getWindowSettings()

WindowSettings eve::window::sdl::Window::getWindowSettings ( )
overridevirtual

Returns the settings last applied to this window.

实现了 eve::window::Window.

在文件 Window.cpp 第 215 行定义.

◆ getWindowTitle()

const std::string & eve::window::sdl::Window::getWindowTitle ( ) const
overridevirtual

Current title string.

实现了 eve::window::Window.

在文件 Window.cpp 第 289 行定义.

◆ hasFocus()

bool eve::window::sdl::Window::hasFocus ( ) const
overridevirtual

True when the window has keyboard focus.

实现了 eve::window::Window.

在文件 Window.cpp 第 331 行定义.

◆ hasMouseFocus()

bool eve::window::sdl::Window::hasMouseFocus ( ) const
overridevirtual

True when the window has mouse focus.

实现了 eve::window::Window.

在文件 Window.cpp 第 334 行定义.

◆ isMaximized()

bool eve::window::sdl::Window::isMaximized ( ) const
overridevirtual

True when the window is maximized.

实现了 eve::window::Window.

在文件 Window.cpp 第 325 行定义.

◆ isMinimized()

bool eve::window::sdl::Window::isMinimized ( ) const
overridevirtual

True when the window is minimized.

实现了 eve::window::Window.

在文件 Window.cpp 第 328 行定义.

◆ isOpen()

bool eve::window::sdl::Window::isOpen ( ) const
overridevirtual

True while the native window exists and has not been closed.

实现了 eve::window::Window.

在文件 Window.cpp 第 282 行定义.

◆ isVisible()

bool eve::window::sdl::Window::isVisible ( ) const
overridevirtual

True when the window is visible (not hidden).

实现了 eve::window::Window.

在文件 Window.cpp 第 337 行定义.

◆ maximize()

void eve::window::sdl::Window::maximize ( )
overridevirtual

Maximizes the window.

实现了 eve::window::Window.

在文件 Window.cpp 第 322 行定义.

◆ minimize()

void eve::window::sdl::Window::minimize ( )
overridevirtual

Minimizes the window.

实现了 eve::window::Window.

在文件 Window.cpp 第 321 行定义.

◆ pixelToWindowCoords()

void eve::window::sdl::Window::pixelToWindowCoords ( double *  x,
double *  y 
) const
overridevirtual

Converts framebuffer pixel coordinates to window logical coordinates.

实现了 eve::window::Window.

在文件 Window.cpp 第 370 行定义.

引用了 getNativeDPIScale(), s, x , 以及 y.

◆ requestAttention()

void eve::window::sdl::Window::requestAttention ( bool  continuous)
overridevirtual

Requests OS attention (flashing taskbar); continuous repeats until focused.

实现了 eve::window::Window.

在文件 Window.cpp 第 487 行定义.

◆ restore()

void eve::window::sdl::Window::restore ( )
overridevirtual

Restores from minimized/maximized state.

实现了 eve::window::Window.

在文件 Window.cpp 第 323 行定义.

◆ setFullscreenDesktop()

bool eve::window::sdl::Window::setFullscreenDesktop ( bool  fullscreen)
overridevirtual

Switches between desktop fullscreen and windowed mode.

实现了 eve::window::Window.

在文件 Window.cpp 第 217 行定义.

◆ setFullscreenExclusive()

bool eve::window::sdl::Window::setFullscreenExclusive ( bool  fullscreen)
overridevirtual

Switches between exclusive fullscreen and windowed mode.

实现了 eve::window::Window.

在文件 Window.cpp 第 221 行定义.

◆ setIconRGBA()

bool eve::window::sdl::Window::setIconRGBA ( const uint8_t *  rgba,
int  w,
int  h 
)
overridevirtual

Sets the window icon from tightly packed RGBA8 pixels (w*h*4 bytes).

实现了 eve::window::Window.

在文件 Window.cpp 第 498 行定义.

引用了 h , 以及 w.

被这些函数引用 setWindowSettings().

◆ setPosition()

void eve::window::sdl::Window::setPosition ( int  x,
int  y,
int  display 
)
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()

void eve::window::sdl::Window::setSize ( int  w,
int  h 
)
overridevirtual

Requests a new logical window size.

实现了 eve::window::Window.

在文件 Window.cpp 第 69 行定义.

引用了 f, h, setWindowSettings(), w , 以及 eve::window::WindowSettings::width.

◆ setVSync()

void eve::window::sdl::Window::setVSync ( int  vsync)
overridevirtual

Enables/disables vertical sync (0 = off, 1 = on).

实现了 eve::window::Window.

在文件 Window.cpp 第 342 行定义.

引用了 eve::window::WindowSettings::vsync.

◆ setWindowSettings()

bool eve::window::sdl::Window::setWindowSettings ( WindowSettings  settings)
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()

void eve::window::sdl::Window::setWindowTitle ( const std::string &  title)
overridevirtual

Sets the window title shown in the OS title bar.

实现了 eve::window::Window.

在文件 Window.cpp 第 284 行定义.

引用了 t.

◆ showMessageBox()

bool eve::window::sdl::Window::showMessageBox ( const std::string &  caption,
const std::string &  message,
const std::string &  type,
bool  attachToWindow 
)
overridevirtual

Shows a modal message box ("info", "warning", or "error").

实现了 eve::window::Window.

在文件 Window.cpp 第 458 行定义.

引用了 message, parent , 以及 type.

◆ showMessageBoxData()

int eve::window::sdl::Window::showMessageBoxData ( const MessageBoxData &  data)
overridevirtual

Shows a configurable message box; returns the pressed button index.

实现了 eve::window::Window.

在文件 Window.cpp 第 464 行定义.

◆ toPixels()

double eve::window::sdl::Window::toPixels ( double  x) const
overridevirtual

Scales a logical length to UI pixels.

实现了 eve::window::Window.

在文件 Window.cpp 第 393 行定义.

引用了 getNativeDPIScale() , 以及 x.

被这些函数引用 toPixelsXY().

◆ toPixelsXY()

void eve::window::sdl::Window::toPixelsXY ( double  wx,
double  wy,
double &  px,
double &  py 
) const
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()

void eve::window::sdl::Window::windowToDPICoords ( double *  x,
double *  y 
) const
overridevirtual

Converts window logical coordinates to UI-DPI coordinates.

实现了 eve::window::Window.

在文件 Window.cpp 第 378 行定义.

引用了 getDPIScale(), s, x , 以及 y.

◆ windowToPixelCoords()

void eve::window::sdl::Window::windowToPixelCoords ( double *  x,
double *  y 
) const
overridevirtual

Converts window logical coordinates to framebuffer pixel coordinates.

实现了 eve::window::Window.

在文件 Window.cpp 第 363 行定义.

引用了 getNativeDPIScale(), s, x , 以及 y.


该类的文档由以下文件生成: