Skip to content

Commit ed08221

Browse files
committed
Tweak renderGeometry example once again
To make blending controls more apparent.
1 parent 3833152 commit ed08221

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

examples/RenderGeometry.hs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,28 +33,25 @@ main = do
3333
}
3434
SDL.showWindow window
3535

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

39-
-- _ <- SDL.glCreateContext window
40-
4138
let
42-
l = fromIntegral screenWidth * 0.33
43-
t = fromIntegral screenHeight * 0.33
44-
r = fromIntegral screenWidth * 0.66
45-
b = fromIntegral screenHeight * 0.66
39+
tl = fromIntegral screenWidth * 0.1
40+
tt = fromIntegral screenHeight * 0.1
41+
tr = fromIntegral screenWidth * 0.9
42+
tb = fromIntegral screenHeight * 0.9
4643

4744
triVertices = V.fromList
4845
[ SDL.Vertex
49-
(FPoint l b)
46+
(FPoint tl tb)
5047
(Color 0xFF 0 0 255)
5148
(FPoint 0 0)
5249
, SDL.Vertex
53-
(FPoint r b)
50+
(FPoint tr tb)
5451
(Color 0 0xFF 0 255)
5552
(FPoint 0 1)
5653
, SDL.Vertex
57-
(FPoint r t)
54+
(FPoint (tl/2 + tr/2) tt)
5855
(Color 0 0 0xFF 255)
5956
(FPoint 1 1)
6057
]

0 commit comments

Comments
 (0)