~alcinnz/haphaestus

e414e86f48b6d75f6bb4eb86ebfe7e7213bbeecc — Adrian Cochrane 1 year, 2 months ago 394f69c
Trial use of SDL2 rendering.
2 files changed, 15 insertions(+), 1 deletions(-)

M haphaestus.cabal
M src/Main.hs
M haphaestus.cabal => haphaestus.cabal +2 -1
@@ 25,6 25,7 @@ executable haphaestus
                       xml-conduit, containers,
                       stylist >= 2.5, stylist-traits, css-syntax, xml-conduit-stylist >=3,
                       text >= 2, bytestring,
                       cattrap >= 0.1 && <0.2
                       cattrap >= 0.1 && <0.2,
                       sdl2 >= 2.5.4, gl, mtl
  hs-source-dirs:      src
  default-language:    Haskell2010

M src/Main.hs => src/Main.hs +13 -0
@@ 33,6 33,9 @@ import           Graphics.Layout.CSS.Internal (placeholderFont)
import           Graphics.Layout.Box (zeroBox, PaddedBox(..), Size(..))
import           Graphics.Layout (boxLayout)

import SDL hiding (rotate)
import Graphics.GL.Core32

import Data.Maybe (fromMaybe)
import System.Environment (getArgs)



@@ 128,4 131,14 @@ main = do
    let sysfont = placeholderFont -- FIXME: Parameterize!
    let layout = boxLayout zeroBox (finalizeCSS' sysfont style) False

    SDL.initializeAll
    let openGL = defaultOpenGL { glProfile = Core Debug 3 3 }
        wcfg = defaultWindow {
            windowInitialSize = V2 640 480,
            windowGraphicsContext = OpenGLContext openGL,
            windowResizable = True
          }
    w <- createWindow "Typograffiti" wcfg
    _ <- glCreateContext w

    putStrLn "Hello, Haskell!"