Skip to content

Commit

Permalink
Tweak renderGeometry example once again
Browse files Browse the repository at this point in the history
To make blending controls more apparent.
  • Loading branch information
dpwiz committed Apr 19, 2023
1 parent 3833152 commit ed08221
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions examples/RenderGeometry.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,25 @@ main = do
}
SDL.showWindow window

-- SDL.windowOpacity window $= 0.5
renderer <- SDL.createRenderer window (-1) SDL.defaultRenderer

-- _ <- SDL.glCreateContext window

let
l = fromIntegral screenWidth * 0.33
t = fromIntegral screenHeight * 0.33
r = fromIntegral screenWidth * 0.66
b = fromIntegral screenHeight * 0.66
tl = fromIntegral screenWidth * 0.1
tt = fromIntegral screenHeight * 0.1
tr = fromIntegral screenWidth * 0.9
tb = fromIntegral screenHeight * 0.9

triVertices = V.fromList
[ SDL.Vertex
(FPoint l b)
(FPoint tl tb)
(Color 0xFF 0 0 255)
(FPoint 0 0)
, SDL.Vertex
(FPoint r b)
(FPoint tr tb)
(Color 0 0xFF 0 255)
(FPoint 0 1)
, SDL.Vertex
(FPoint r t)
(FPoint (tl/2 + tr/2) tt)
(Color 0 0 0xFF 255)
(FPoint 1 1)
]
Expand Down

0 comments on commit ed08221

Please sign in to comment.