Copyright | (c) 2018 Francisco Vallarino |
---|---|
License | BSD-3-Clause (see the LICENSE file) |
Maintainer | fjvallarino@gmail.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Helper functions for SDL platform related operations.
Synopsis
- defaultWindowSize :: (Int, Int)
- initSDLWindow :: AppConfig s e -> IO (Window, Double, Double, GLContext)
- destroySDLWindow :: Window -> IO ()
- getCurrentMousePos :: Double -> IO Point
- getDrawableSize :: Window -> IO Size
- getWindowSize :: Window -> IO Size
- getViewportSize :: Window -> Double -> IO Size
- getPlatform :: IO Text
- getDisplayDPI :: IO (Double, Double, Double)
Documentation
defaultWindowSize :: (Int, Int) Source #
Default window size if not specified.
initSDLWindow :: AppConfig s e -> IO (Window, Double, Double, GLContext) Source #
Creates and initializes a window using the provided configuration.
destroySDLWindow :: Window -> IO () Source #
Destroys the provided window, shutdowns the video subsystem and SDL.
getDrawableSize :: Window -> IO Size Source #
Returns the drawable size of the provided window. May differ from window size if HDPI is enabled.
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.