载入中...
搜索中...
未找到
Window.h
浏览该文件的文档.
Platform window interface (SDL implementation on desktop/mobile). Script: win <- eve....
Definition Window.h:47
virtual void setVSync(int vsync)=0
Enables/disables vertical sync (0 = off, 1 = on).
virtual int getDisplayCount() const =0
Number of displays attached to the system.
virtual int showMessageBoxData(const MessageBoxData &data)=0
Shows a configurable message box; returns the pressed button index.
virtual bool setFullscreenDesktop(bool fullscreen)=0
Switches between desktop fullscreen and windowed mode.
virtual double getNativeDPIScale() const =0
Native DPI scale reported by the OS for this window.
virtual bool hasFocus() const =0
True when the window has keyboard focus.
virtual bool isMinimized() const =0
True when the window is minimized.
virtual void toPixelsXY(double wx, double wy, double &px, double &py) const =0
Converts a logical XY pair to framebuffer pixels.
virtual std::string getDisplayName(int display) const =0
Human-readable display name for a display index.
virtual bool showMessageBox(const std::string &title, const std::string &message, const std::string &type, bool attachToWindow)=0
Shows a modal message box ("info", "warning", or "error").
virtual bool isVisible() const =0
True when the window is visible (not hidden).
virtual std::vector< WindowSize > getFullscreenSizes(int display) const =0
Fullscreen sizes supported by a display.
virtual bool setFullscreenExclusive(bool fullscreen)=0
Switches between exclusive fullscreen and windowed mode.
virtual void setWindowTitle(const std::string &title)=0
Sets the window title shown in the OS title bar.
virtual void windowToDPICoords(double *x, double *y) const =0
Converts window logical coordinates to UI-DPI coordinates.
virtual const std::string & getWindowTitle() const =0
Current title string.
virtual bool setIconRGBA(const uint8_t *rgba, int width, int height)=0
Sets the window icon from tightly packed RGBA8 pixels (w*h*4 bytes).
virtual bool isOpen() const =0
True while the native window exists and has not been closed.
virtual bool hasMouseFocus() const =0
True when the window has mouse focus.
virtual void getDesktopDimensions(int display, int &width, int &height) const =0
Desktop resolution of a display.
virtual double getDPIScale() const =0
Current UI/logical DPI scale (1.0 on non-retina displays).
virtual void windowToPixelCoords(double *x, double *y) const =0
Converts window logical coordinates to framebuffer pixel coordinates.
virtual bool setWindowSettings(WindowSettings settings)=0
Applies a full WindowSettings struct (recreates the window when needed).
Module_REG(Window)
virtual void requestAttention(bool continuous)=0
Requests OS attention (flashing taskbar); continuous repeats until focused.
virtual double toPixels(double x) const =0
Scales a logical length to UI pixels.
virtual void DPIToWindowCoords(double *x, double *y) const =0
Converts UI-DPI coordinates to window logical coordinates.
virtual std::string getDisplayOrientation(int display) const =0
Display orientation string (e.g. "landscape").
virtual bool isMaximized() const =0
True when the window is maximized.
virtual void pixelToWindowCoords(double *x, double *y) const =0
Converts framebuffer pixel coordinates to window logical coordinates.
virtual double fromPixels(double x) const =0
Scales a UI-pixel length back to logical units.
virtual void getPosition(int &x, int &y, int &display)=0
Reads the current window position and display index.
virtual WindowSettings getWindowSettings()=0
Returns the settings last applied to this window.
virtual void setPosition(int x, int y, int display)=0
Moves the window to a position in logical units on the given display.
virtual int getPixelWidth() const =0
Framebuffer (pixel) width of the window.
virtual void * getHandle() const =0
Native window handle (SDL_Window* on SDL backend).
virtual void setSize(int width, int height)=0
Requests a new logical window size.
virtual void fromPixelsXY(double px, double py, double &wx, double &wy) const =0
Converts a framebuffer pixel XY pair to logical coordinates.
virtual int getVSync() const =0
Current vsync setting (0 = off, 1 = on).
virtual int getPixelHeight() const =0
Framebuffer (pixel) height of the window.
WidgetDesc window(std::string title, std::vector< WidgetDesc > children, std::string id)
Top-level window widget with a title bar.
Definition Widget.cpp:292
Display settings for window creation/resize. width/height == 0 selects the desktop display mode size.
Definition Window.h:18
Parameters for a multi-button modal message box.
Definition Window.h:61
std::vector< std::string > buttons
Definition Window.h:68
Logical width/height pair used by fullscreen size queries.
Definition Window.h:52