From 69dc80707f2d8615a560cf27877853b4933177e7 Mon Sep 17 00:00:00 2001 From: nek0 Date: Fri, 3 Nov 2017 01:33:12 +0100 Subject: [PATCH] new example --- examples/example00/Main.hs | 5 +++-- examples/example01/Main.hs | 5 +++-- hw.cabal | 28 ++++++++++++++++++++++++++++ src/Main.hs | 7 ++++--- 4 files changed, 38 insertions(+), 7 deletions(-) diff --git a/examples/example00/Main.hs b/examples/example00/Main.hs index 3dd7b22..6fca0a0 100644 --- a/examples/example00/Main.hs +++ b/examples/example00/Main.hs @@ -13,6 +13,7 @@ import qualified Graphics.GLUtil as GLU import Physics.Bullet.Raw import Control.Monad (when) +import Control.Monad.IO.Class (liftIO) import Linear as L @@ -31,8 +32,8 @@ main = { initComponents = All , windowTitle = "hw" , windowConfig = SDL.defaultWindow - { windowInitialSize = SDL.V2 1600 900 - , windowOpenGL = Just SDL.defaultOpenGL + { SDL.windowInitialSize = SDL.V2 1600 900 + , SDL.windowOpenGL = Just SDL.defaultOpenGL { SDL.glProfile = SDL.Core SDL.Normal 3 2 } } diff --git a/examples/example01/Main.hs b/examples/example01/Main.hs index 6b79660..df79e5a 100644 --- a/examples/example01/Main.hs +++ b/examples/example01/Main.hs @@ -13,6 +13,7 @@ import qualified Graphics.GLUtil as GLU import Physics.Bullet.Raw import Control.Monad (when) +import Control.Monad.IO.Class (liftIO) import Linear as L @@ -31,8 +32,8 @@ main = { initComponents = All , windowTitle = "hw" , windowConfig = SDL.defaultWindow - { windowInitialSize = SDL.V2 1600 900 - , windowOpenGL = Just SDL.defaultOpenGL + { SDL.windowInitialSize = SDL.V2 1600 900 + , SDL.windowOpenGL = Just SDL.defaultOpenGL { SDL.glProfile = SDL.Core SDL.Normal 3 2 } } diff --git a/hw.cabal b/hw.cabal index 25170f5..0348080 100644 --- a/hw.cabal +++ b/hw.cabal @@ -96,3 +96,31 @@ executable example01 default-language: Haskell2010 ghc-options: -Wall extra-libraries: stdc++ + +executable example02 + main-is: Main.hs + other-modules: Util + , Types + , Init + -- other-extensions: + default-extensions: OverloadedStrings + if flag(examples) + build-depends: base >=4.9 + , affection + , sdl2 + , linear + , spatial-math + , bytestring + , OpenGL + , OpenGLRaw + , GLUtil + , random + , vector + , wavefront + , shoot + else + buildable: False + hs-source-dirs: examples/example02 + default-language: Haskell2010 + ghc-options: -Wall + extra-libraries: stdc++ diff --git a/src/Main.hs b/src/Main.hs index 6abb06f..6b1baaa 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -13,6 +13,7 @@ import qualified Graphics.GLUtil as GLU import Physics.Bullet.Raw import Control.Monad (when) +import Control.Monad.IO.Class (liftIO) import Linear as L @@ -31,9 +32,9 @@ main = { initComponents = All , windowTitle = "hw" , windowConfig = SDL.defaultWindow - { windowInitialSize = SDL.V2 1600 900 - , windowOpenGL = Just SDL.defaultOpenGL - { SDL.glProfile = SDL.Core SDL.Normal 3 2 + { SDL.windowInitialSize = SDL.V2 1600 900 + , SDL.windowOpenGL = Just SDL.defaultOpenGL + { SDL.glProfile = SDL.Core SDL.Normal 3 3 } } , initScreenMode = SDL.Fullscreen