monomer-1.1.1.0: A GUI library for writing native Haskell applications.
Copyright(c) 2018 Francisco Vallarino
LicenseBSD-3-Clause (see the LICENSE file)
Maintainerfjvallarino@gmail.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Monomer.Main.Platform

Description

Helper functions for SDL platform related operations.

Synopsis

Documentation

defaultWindowSize :: (Int, Int) Source #

Default window size if not is specified.

initSDLWindow :: AppConfig e -> IO (Window, Double, Double, GLContext) Source #

Creates and initializes a window using the provided configuration.

detroySDLWindow :: Window -> IO () Source #

Destroys the provided window, shutdowns the video subsystem and SDL.

getCurrentMousePos :: Double -> IO Point Source #

Returns the current mouse position.

getDrawableSize :: Window -> IO Size Source #

Returns the drawable size of the provided window. May differ from window size if HDPI is enabled.

getWindowSize :: Window -> IO Size Source #

Returns the size of the provided window.

getViewportSize :: Window -> Double -> IO Size Source #

Returns the viewport size. This is the size of the viewport the application will render to and, depending on the platform, may match window size or not. For example, on Windows and Linux Wayland this size may be smaller than the window size because of dpr scaling.

getPlatform :: IO Text Source #

Returns the name of the host OS.

getDisplayDPI :: IO (Double, Double, Double) Source #

Returns the diagonal, horizontal and vertical DPI of the main display.