-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathcurrent-task
77 lines (63 loc) · 2.12 KB
/
current-task
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
MEDIUM TASKS:
- add HUD support to engine
- implement level collision
TASK:
- make engine api more general
- support rendrering to multiple viewports
Q: should it be a proper render tartget or just a specific area of the screen?
- support 2D quads with shaders (2D screen space)
- support dynamic lights (in the scene)
QUESTION:
Context: Quake 3 Engine implemented graphics features in the game client code e.g.
- font rendering
- particle system
How should the Haskell engine API look like?
(A): Mimic the Q3 Engine API and support:
- add polys to scene
- stretch pic primitive
(B): Builtin support, high level API
Preference: (B)
Decision:
- support for emitting 2D quads (a.k.a trap_R_DrawStretchPic)
use case:
- text rendering
- menu rendering
- icons
- native support for particles (must be efficient)
render active weapon
render status bar
ammo count
health count
armor count (optional)
frag limit / frag count
PROBLEM:
convenient transformation between world space and screen space
TODO:
UI layer in scene
text
models
general:
done - protea audio
parameter types and names; add description
include example code in the main hackage page
add ByteString loader also
quake
check how the weapon is draw in the original game
HUD SUPPORT
text, icon, md3
TODO
check the API in the q3 source
cg_newdraw.c
CG_DrawPic( rect->x, rect->y + rect->h/2 + 1, rect->w, rect->h, cgs.media.armorIcon );
trap:
trap_R_DrawStretchPic
command:
void RE_StretchPic ( float x, float y, float w, float h, float s1, float t1, float s2, float t2, qhandle_t hShader )
implementation:
RB_StretchPic
CG_Draw3DModel( rect->x, rect->y, rect->w, rect->h, cgs.media.armorModel, 0, origin, angles );
void CG_DrawField (int x, int y, int width, int value)
introduce a 2D layer in the engine with settings from RB_SetGL2D
top level code
CG_DrawStatusBar
need for an absolute coordinate system, q3 uses 640x480 virtual screen size