Skip to content

Commit c05ef0c

Browse files
committed
cleanup: Delete almost all of the old code
1 parent 75160c9 commit c05ef0c

File tree

20 files changed

+48
-1217
lines changed

20 files changed

+48
-1217
lines changed

examples/cube/Main.hs

Lines changed: 0 additions & 87 deletions
This file was deleted.

examples/cube/Shaders.hs

Lines changed: 0 additions & 107 deletions
This file was deleted.

examples/ghengin-games.cabal

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ cabal-version: 3.4
88
--------------------------------------------------------------------------------
99

1010
name: ghengin-games
11-
tested-with: GHC ==9.10.1
11+
tested-with: GHC ==9.12.1
1212
version: 0.1.0.0
1313
license: BSD-3-Clause
1414
license-file: ../LICENSE
@@ -131,18 +131,22 @@ common common-flags
131131
, Ghengin.Core.Renderer as Ghengin.Vulkan.Renderer
132132
)
133133

134+
--------------------------------------------------------------------------------
135+
-- Cooler examples
136+
--------------------------------------------------------------------------------
137+
138+
-- Sebastian Lague's Procedural Planets
139+
executable planets-core
140+
import: common-flags
141+
main-is: Main.hs
142+
other-modules: Camera, Planet, Shaders
143+
hs-source-dirs: planets-core
144+
134145
-- library
135146
-- import: common-flags
136147
-- exposed-modules: Common, Common.Shader
137148
-- hs-source-dirs: common
138149

139-
-- executable planets-core
140-
-- import: common-flags
141-
-- main-is: Main.hs
142-
-- other-modules: Camera, Planet, Shaders
143-
-- build-depends: ghengin-games
144-
-- hs-source-dirs: planets-core
145-
--
146150
-- executable fir-juliaset
147151
-- import: common-flags
148152
-- main-is: Main.hs
@@ -170,13 +174,6 @@ common common-flags
170174
-- other-modules: Shaders
171175
-- build-depends: ghengin-games
172176
-- hs-source-dirs: ocean-waves/
173-
--
174-
-- executable cube
175-
-- import: common-flags
176-
-- main-is: Main.hs
177-
-- other-modules: Shaders
178-
-- build-depends: ghengin-games
179-
-- hs-source-dirs: cube/
180177

181178
--------------------------------------------------------------------------------
182179
-- Some demos in increasing level of complexity
@@ -222,6 +219,7 @@ executable function-drawing
222219

223220
--------------------------------------------------------------------------------
224221
-- Experiments
222+
--------------------------------------------------------------------------------
225223

226224
-- This example is pretty hacked through.
227225
executable function-plotting

examples/planets-core/Camera.hs

Lines changed: 0 additions & 43 deletions
This file was deleted.

examples/planets-core/Main.hs

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ which in turn are made up of multiple things, as represented in the following pi
1717
│Mesh││Material ││Pipeline │
1818
└┬───┘└┬────────────────────────┘└┬───────────────────┘
1919
┌▽─────▽──────────────────────────▽┐
20-
│Planet (RenderPacket)
20+
│Planet
2121
└──────────────────────────────────┘
2222
2323
The function `newPlanet` handles the creation of planet render packets...
@@ -51,29 +51,13 @@ import qualified FIR
5151
import qualified Math.Linear as FIR
5252
import qualified Prelude
5353

54+
-- planets!
5455
import Shaders -- planet shaders
5556
import Planet
5657

57-
newtype ProjectionM = ProjectionM Transform
58-
deriving Storable -- use GlBlock instead...
59-
deriving FIR.Syntactic via (StructMat4 "m")
60-
61-
newtype ViewM = ViewM Transform
62-
deriving Storable
63-
deriving FIR.Syntactic via (StructMat4 "m")
64-
65-
newtype CameraPos = CameraPos Vec3
66-
deriving Storable
67-
deriving FIR.Syntactic via (StructVec3 "v")
68-
69-
type CameraProperties = [ProjectionM, ViewM, CameraPos]
70-
7158
pattern MAX_FRAME_TIME :: Float
7259
pattern MAX_FRAME_TIME = 0.5
7360

74-
-- We should use Alexander's gl-block library instead of Storable, and
75-
-- Geomancy.Transform.Tree for the node tree...
76-
7761
makeMainPipeline :: Renderer (RenderPipeline _ CameraProperties)
7862
makeMainPipeline = Linear.do
7963
Ur extent <- getRenderExtent
@@ -115,8 +99,8 @@ main = do
11599
currTime <- getCurrentTime
116100
withLinearIO $
117101
runCore (1280, 720) Linear.do
118-
sampler <- ( createSampler FILTER_NEAREST SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE )
119-
tex <- ( texture "assets/planet_gradient.png" sampler )
102+
-- sampler <- ( createSampler FILTER_NEAREST SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE ↑)
103+
-- tex <- ( texture "assets/planet_gradient.png" sampler ↑)
120104

121105
pipeline <- (makeMainPipeline )
122106
((p1mesh, pipeline), Ur minmax) <- newPlanetMesh pipeline defaultPlanetSettings

examples/planets-core/Planet.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ data PlanetSettings = PlanetSettings { resolution :: !Int
5050

5151
data DisplayFace = All | FaceUp | FaceRight deriving Show
5252

53-
54-
5553
data MinMax = MinMax !Float !Float
5654
deriving (P.Eq, Generic, SOP.Generic, Show, GStorable)
5755
deriving FIR.Syntactic via (FromGenericProduct MinMax ["min", "max"])

0 commit comments

Comments
 (0)