]> de.git.xonotic.org Git - xonotic/darkplaces.git/blob - cl_screen.h
added debug prints to FRIK_FILE fopen/fclose builtins
[xonotic/darkplaces.git] / cl_screen.h
1
2 #ifndef CL_SCREEN_H
3 #define CL_SCREEN_H
4
5 // drawqueue stuff for use by client to feed 2D art to renderer
6 #define DRAWQUEUE_STRING 0
7 #define DRAWQUEUE_MESH 1
8 #define DRAWQUEUE_SETCLIP 2
9 #define DRAWQUEUE_RESETCLIP 3
10
11 typedef struct drawqueue_s
12 {
13         unsigned short size;
14         qbyte command, flags;
15         unsigned int color;
16         float x, y, scalex, scaley;
17 }
18 drawqueue_t;
19
20 // a triangle mesh... embedded in the drawqueue
21 // each vertex is 4 floats (3 are used)
22 // each texcoord is 4 floats (3 are used)
23 // each color is 4 floats (4 are used)
24 typedef struct drawqueuemesh_s
25 {
26         rtexture_t *texture;
27         int num_triangles;
28         int num_vertices;
29         int *data_element3i;
30         float *data_vertex3f;
31         float *data_texcoord2f;
32         float *data_color4f;
33 }
34 drawqueuemesh_t;
35
36 enum drawqueue_drawflag_e {
37 DRAWFLAG_NORMAL,
38 DRAWFLAG_ADDITIVE,
39 DRAWFLAG_MODULATE,
40 DRAWFLAG_2XMODULATE,
41 DRAWFLAG_NUMFLAGS
42 };
43
44 // shared color tag printing constants
45 #define STRING_COLOR_TAG                        '^'
46 #define STRING_COLOR_DEFAULT            7
47 #define STRING_COLOR_DEFAULT_STR        "7"
48
49 // clear the draw queue
50 void DrawQ_Clear(void);
51 // draw an image
52 void DrawQ_Pic(float x, float y, const char *picname, float width, float height, float red, float green, float blue, float alpha, int flags);
53 // draw a text string
54 void DrawQ_String(float x, float y, const char *string, int maxlen, float scalex, float scaley, float red, float green, float blue, float alpha, int flags);
55 // draw a text string that supports color tags (colorindex can either be NULL, -1 to make it choose the default color or valid index to start with)
56 void DrawQ_ColoredString( float x, float y, const char *text, int maxlen, float scalex, float scaley, float basered, float basegreen, float baseblue, float basealpha, int flags, int *outcolor );
57 // draw a filled rectangle
58 void DrawQ_Fill(float x, float y, float w, float h, float red, float green, float blue, float alpha, int flags);
59 // draw a very fancy pic (per corner texcoord/color control), the order is tl, tr, bl, br
60 void DrawQ_SuperPic(float x, float y, const char *picname, float width, float height, float s1, float t1, float r1, float g1, float b1, float a1, float s2, float t2, float r2, float g2, float b2, float a2, float s3, float t3, float r3, float g3, float b3, float a3, float s4, float t4, float r4, float g4, float b4, float a4, int flags);
61 // draw a triangle mesh
62 void DrawQ_Mesh(drawqueuemesh_t *mesh, int flags);
63 // set the clipping area
64 void DrawQ_SetClipArea(float x, float y, float width, float height);
65 // reset the clipping area
66 void DrawQ_ResetClipArea(void);
67
68 void SHOWLMP_decodehide(void);
69 void SHOWLMP_decodeshow(void);
70 void SHOWLMP_drawall(void);
71 void SHOWLMP_clear(void);
72
73 extern cvar_t vid_conwidth;
74 extern cvar_t vid_conheight;
75 extern cvar_t vid_pixelaspect;
76 extern cvar_t scr_screenshot_jpeg;
77 extern cvar_t scr_screenshot_jpeg_quality;
78 extern cvar_t scr_screenshot_gamma;
79 extern cvar_t scr_screenshot_name;
80
81 void CL_Screen_NewMap(void);
82 void CL_Screen_Init(void);
83 void CL_UpdateScreen(void);
84
85 #endif
86