aboutsummaryrefslogtreecommitdiff
path: root/src/Chelleport/Context.hs
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2024-12-14 20:07:41 +0530
committerAkshay Nair <phenax5@gmail.com>2024-12-14 20:45:54 +0530
commit34907bc25dba055dfbfe91d9a91803cc75283bfa (patch)
tree310ed24c944b073f558ce6c67e3352fe0ad19d1d /src/Chelleport/Context.hs
parent73564537897f7573690955596097085b711c92e5 (diff)
downloadchelleport-34907bc25dba055dfbfe91d9a91803cc75283bfa.tar.gz
chelleport-34907bc25dba055dfbfe91d9a91803cc75283bfa.zip
Refactor view + add better highlighting of regions
Diffstat (limited to '')
-rw-r--r--src/Chelleport/Context.hs18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/Chelleport/Context.hs b/src/Chelleport/Context.hs
index 1dd764f..d62cd7e 100644
--- a/src/Chelleport/Context.hs
+++ b/src/Chelleport/Context.hs
@@ -1,35 +1,23 @@
module Chelleport.Context where
+import Chelleport.Types
import qualified Graphics.X11 as X11
import SDL (($=))
import qualified SDL
import qualified SDL.Font as TTF
-data DrawContext = DrawContext
- { ctxWindow :: SDL.Window,
- ctxRenderer :: SDL.Renderer,
- ctxFont :: TTF.Font,
- ctxX11Display :: X11.Display
- }
-
createContext :: IO DrawContext
createContext = do
- -- bounds <- fmap SDL.displayBoundsSize <$> SDL.getDisplays
- -- let windowSize = case bounds of
- -- (x : _) -> x
- -- _ -> SDL.V2 800 600
- let windowSize = SDL.V2 0 0
-
let windowCfg =
SDL.defaultWindow
{ SDL.windowMode = SDL.FullscreenDesktop,
SDL.windowPosition = SDL.Absolute $ SDL.P $ SDL.V2 0 0,
- SDL.windowInitialSize = windowSize,
+ SDL.windowInitialSize = SDL.V2 0 0,
SDL.windowBorder = False
}
window <- SDL.createWindow "Chelleport" windowCfg
renderer <- SDL.createRenderer window (-1) SDL.defaultRenderer
- font <- TTF.load "Inter-Regular.ttf" 16
+ font <- TTF.load "Inter-Regular.ttf" 24
SDL.windowOpacity window $= 0.6
SDL.rendererDrawBlendMode renderer $= SDL.BlendAlphaBlend