Reimplement text rendering, slow
This commit is contained in:
+77
-2
@@ -1,6 +1,81 @@
|
|||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
import Lib
|
import Loop
|
||||||
|
import EventHelper
|
||||||
|
import Shaders
|
||||||
|
import Render
|
||||||
|
import Shapes
|
||||||
|
|
||||||
|
import Dodge.Rendering
|
||||||
|
import Dodge.RenderPicture
|
||||||
|
import Dodge.Picture
|
||||||
|
import Dodge.Prototypes
|
||||||
|
import Dodge.Data
|
||||||
|
import Dodge.Initialisation
|
||||||
|
import Dodge.Rooms
|
||||||
|
import Dodge.Layout
|
||||||
|
import Dodge.LoadSound
|
||||||
|
import Dodge.Update
|
||||||
|
import Dodge.KeyEvents
|
||||||
|
import Dodge.Preload
|
||||||
|
|
||||||
|
import Control.Concurrent
|
||||||
|
import Control.Lens
|
||||||
|
|
||||||
|
import System.Random
|
||||||
|
|
||||||
|
import qualified SDL as SDL
|
||||||
|
import qualified SDL.Mixer as Mix
|
||||||
|
import Graphics.Rendering.OpenGL hiding (color,scale)
|
||||||
|
--Mix.openAudio Mix.defaultAudio 256 >>
|
||||||
|
|
||||||
|
initWorld = initialWorld
|
||||||
|
{ _randGen = mkStdGen 2
|
||||||
|
, _windowX = 800
|
||||||
|
, _windowY = 600
|
||||||
|
}
|
||||||
|
|
||||||
|
pps = [(0,0),(50,0),(0,25)]
|
||||||
|
ppt = [(0,0),(-50,0),(20,25)]
|
||||||
|
|
||||||
|
tSh = TextShape
|
||||||
|
[((0.0,0.0,0),(1,0,1,1),(s,1))
|
||||||
|
,((0.5,0.0,0),(1,1,1,1),(e,1))
|
||||||
|
,((0.5,1.0,0),(1,1,1,1),(e,0))
|
||||||
|
,((0.0,1.0,0),(1,1,1,1),(s,0))
|
||||||
|
]
|
||||||
|
where x = 1/128
|
||||||
|
s = 20 * x
|
||||||
|
e = s + x
|
||||||
|
tSh' = TShape'
|
||||||
|
[0.0,0.0,0,1,0,1,1,s,1
|
||||||
|
,0.5,0.0,0,1,1,1,1,e,1
|
||||||
|
,0.5,1.0,0,1,1,1,1,e,0
|
||||||
|
,0.0,1.0,0,1,1,1,1,s,0
|
||||||
|
] TriangleFan
|
||||||
|
where x = 1/128
|
||||||
|
s = 20 * x
|
||||||
|
e = s + x
|
||||||
|
tSha = TShape'
|
||||||
|
[0.0,0.0,0,1,1,1,1
|
||||||
|
,50 ,0.0,0,1,1,1,1
|
||||||
|
,50 ,50 ,0,1,1,1,1
|
||||||
|
,0.0,1.0,0,1,1,1,1
|
||||||
|
] TriangleFan
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = someFunc
|
main = do
|
||||||
|
-- loadedSounds <- loadSounds
|
||||||
|
setupLoop
|
||||||
|
"windowName"
|
||||||
|
800 600
|
||||||
|
doPreload'
|
||||||
|
(initializeWorld $ generateFromTree lev1 $ initWorld)
|
||||||
|
(-- \((bs:fs:ts:_),tes) w -> --do render setparams w egFade
|
||||||
|
\preData w -> --do render setparams w egFade
|
||||||
|
renderPicture preData (draw blank w)
|
||||||
|
-- renderTex'' preData tSh
|
||||||
|
)
|
||||||
|
handleEvent
|
||||||
|
(\w -> Just $ update w)
|
||||||
|
Mix.closeAudio
|
||||||
|
|||||||
@@ -21,6 +21,23 @@ description: Please see the README on GitHub at <https://github.com/gith
|
|||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
- base >= 4.7 && < 5
|
- base >= 4.7 && < 5
|
||||||
|
- containers
|
||||||
|
- unordered-containers
|
||||||
|
- heap
|
||||||
|
- sdl2
|
||||||
|
- sdl2-mixer
|
||||||
|
- text
|
||||||
|
- OpenGL
|
||||||
|
- raw-strings-qq
|
||||||
|
- bytestring
|
||||||
|
- lens
|
||||||
|
- mtl
|
||||||
|
- fgl
|
||||||
|
- random
|
||||||
|
- bmp
|
||||||
|
- monad-loops
|
||||||
|
- JuicyPixels
|
||||||
|
- vector
|
||||||
|
|
||||||
library:
|
library:
|
||||||
source-dirs: src
|
source-dirs: src
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
module Lib
|
|
||||||
( someFunc
|
|
||||||
) where
|
|
||||||
|
|
||||||
someFunc :: IO ()
|
|
||||||
someFunc = putStrLn "someFunc"
|
|
||||||
+2
-1
@@ -34,7 +34,8 @@ packages:
|
|||||||
# These entries can reference officially published versions as well as
|
# These entries can reference officially published versions as well as
|
||||||
# forks / in-progress versions pinned to a git hash. For example:
|
# forks / in-progress versions pinned to a git hash. For example:
|
||||||
#
|
#
|
||||||
# extra-deps:
|
extra-deps:
|
||||||
|
- SDL-0.6.7.0@sha256:9d6ba75c0cab575ec38468c8277803983e985f9622437aeca6a53e6a7337a7d5,2045
|
||||||
# - acme-missiles-0.3
|
# - acme-missiles-0.3
|
||||||
# - git: https://github.com/commercialhaskell/stack.git
|
# - git: https://github.com/commercialhaskell/stack.git
|
||||||
# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a
|
# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a
|
||||||
|
|||||||
Reference in New Issue
Block a user