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

#include <Window.h>

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

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< WindowSizegetFullscreenSizes (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.h15 行定义.

构造及析构函数说明

◆ Window()

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

在文件 Window.cpp51 行定义.

◆ ~Window()

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

重载 eve::window::Window .

在文件 Window.cpp56 行定义.

成员函数说明

◆ close()

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

Closes and destroys the underlying window.

实现了 eve::window::Window.

在文件 Window.cpp552 行定义.

引用了 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.cpp375 行定义.

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

◆ fromPixels()

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

实现了 eve::window::Window.

在文件 Window.cpp384 行定义.

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

被这些函数引用 fromPixelsXY().

◆ fromPixelsXY()

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

实现了 eve::window::Window.

在文件 Window.cpp394 行定义.

引用了 fromPixels() , 以及 px.

◆ getDesktopDimensions()

void eve::window::sdl::Window::getDesktopDimensions ( int  display,
int &  width,
int &  height 
) const
overridevirtual

Desktop resolution of a display.

实现了 eve::window::Window.

在文件 Window.cpp437 行定义.

引用了 getDisplayCount(), height , 以及 width.

◆ getDisplayCount()

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

Number of displays attached to the system.

实现了 eve::window::Window.

在文件 Window.cpp399 行定义.

引用了 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.cpp404 行定义.

引用了 getDisplayCount() , 以及 n.

◆ getDisplayOrientation()

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

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

实现了 eve::window::Window.

在文件 Window.cpp410 行定义.

引用了 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.cpp346 行定义.

引用了 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.cpp421 行定义.

引用了 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.h62 行定义.

◆ getHeight()

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

实现了 eve::window::Window.

在文件 Window.cpp68 行定义.

引用了 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.cpp341 行定义.

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

◆ getPixelHeight()

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

实现了 eve::window::Window.

在文件 Window.cpp339 行定义.

◆ getPixelWidth()

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

Framebuffer (pixel) dimensions of the window.

实现了 eve::window::Window.

在文件 Window.cpp337 行定义.

◆ 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.cpp293 行定义.

引用了 eve::window::WindowSettings::display, x, eve::window::WindowSettings::x, y , 以及 eve::window::WindowSettings::y.

◆ getVSync()

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

实现了 eve::window::Window.

在文件 Window.cpp335 行定义.

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

◆ getWidth()

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

实现了 eve::window::Window.

在文件 Window.cpp66 行定义.

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

◆ getWindowSettings()

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

实现了 eve::window::Window.

在文件 Window.cpp204 行定义.

◆ getWindowTitle()

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

实现了 eve::window::Window.

在文件 Window.cpp278 行定义.

◆ hasFocus()

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

True when the window has keyboard focus.

实现了 eve::window::Window.

在文件 Window.cpp320 行定义.

◆ hasMouseFocus()

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

True when the window has mouse focus.

实现了 eve::window::Window.

在文件 Window.cpp323 行定义.

◆ isMaximized()

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

实现了 eve::window::Window.

在文件 Window.cpp314 行定义.

◆ isMinimized()

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

实现了 eve::window::Window.

在文件 Window.cpp317 行定义.

◆ isOpen()

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

实现了 eve::window::Window.

在文件 Window.cpp271 行定义.

◆ isVisible()

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

实现了 eve::window::Window.

在文件 Window.cpp326 行定义.

◆ maximize()

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

实现了 eve::window::Window.

在文件 Window.cpp311 行定义.

◆ minimize()

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

Minimizes / maximizes / restores the window.

实现了 eve::window::Window.

在文件 Window.cpp310 行定义.

◆ 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.cpp359 行定义.

引用了 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.cpp476 行定义.

◆ restore()

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

实现了 eve::window::Window.

在文件 Window.cpp312 行定义.

◆ setFullscreenDesktop()

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

Switches between desktop fullscreen and windowed mode.

实现了 eve::window::Window.

在文件 Window.cpp206 行定义.

◆ setFullscreenExclusive()

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

Switches between exclusive fullscreen and windowed mode.

实现了 eve::window::Window.

在文件 Window.cpp210 行定义.

◆ setIconRGBA()

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

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

实现了 eve::window::Window.

在文件 Window.cpp487 行定义.

引用了 height , 以及 width.

被这些函数引用 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.cpp280 行定义.

引用了 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  width,
int  height 
)
overridevirtual

Requests a new logical window size.

实现了 eve::window::Window.

在文件 Window.cpp58 行定义.

引用了 f, height, setWindowSettings(), width , 以及 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.cpp331 行定义.

引用了 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.cpp70 行定义.

引用了 close(), f, getDisplayCount(), eve::cap::query(), 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.cpp273 行定义.

◆ showMessageBox()

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

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

实现了 eve::window::Window.

在文件 Window.cpp447 行定义.

引用了 parent, title , 以及 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.cpp453 行定义.

引用了 data.

◆ toPixels()

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

Scales a logical length to UI pixels (and back).

实现了 eve::window::Window.

在文件 Window.cpp382 行定义.

引用了 getNativeDPIScale() , 以及 x.

被这些函数引用 toPixelsXY().

◆ toPixelsXY()

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

Vector variants of the coordinate conversions above.

实现了 eve::window::Window.

在文件 Window.cpp389 行定义.

引用了 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.cpp573 行定义.

引用了 eve::cap::query().

被这些函数引用 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.cpp367 行定义.

引用了 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.cpp352 行定义.

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


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