]> icculus.org git repositories - taylor/freespace2.git/blob - include/grgl2.h
proper padding of PXO stats struct for FS2 demo
[taylor/freespace2.git] / include / grgl2.h
1 /*
2  * Copyright (C) Volition, Inc. 1999.  All rights reserved.
3  *
4  * All source code herein is the property of Volition, Inc. You may not sell
5  * or otherwise commercially exploit the source or things you created based on
6  * the source.
7  */
8
9 #ifndef GRGL2_H
10 #define GRGL2_H
11
12 #include "pstypes.h"
13
14
15 int opengl2_init();
16 void opengl2_cleanup();
17 void opengl2_set_state(gr_texture_source ts, gr_alpha_blend ab, gr_zbuffer_type zt);
18
19 void opengl2_tcache_init();
20 void opengl2_tcache_cleanup();
21 void opengl2_tcache_frame();
22 void opengl2_tcache_flush();
23 int opengl2_tcache_set(int bitmap_id, int bitmap_type, int fail_on_full = 0);
24 void opengl2_set_texture_state(gr_texture_source ts);
25
26 // shader program types
27 typedef enum {
28         PROG_INVALID = -1,
29         PROG_AABITMAP = 0,
30         PROG_TEX = 1,
31         PROG_TEX_FOG = 2,
32         PROG_COLOR = 3,
33         PROG_COLOR_FOG = 4,
34         PROG_WINDOW = 5
35 } sdr_prog_t;
36
37 // shader variable indexes
38 enum {
39         SDRI_POSITION = 1,
40         SDRI_COLOR = 2,
41         SDRI_SEC_COLOR = 3,
42         SDRI_TEXCOORD = 4
43 };
44
45 int opengl2_shader_init();
46 void opengl2_shader_cleanup();
47 void opengl2_shader_use(sdr_prog_t prog);
48 void opengl2_shader_update();
49
50 // gr_* pointer functions
51 void gr_opengl2_flip();
52 void gr_opengl2_set_clip(int x, int y, int w, int h);
53 void gr_opengl2_fog_set(int fog_mode, int r, int g, int b, float fog_near, float fog_far);
54 void gr_opengl2_zbuffer_clear(int mode);
55 void gr_opengl2_print_screen(const char *filename);
56 void gr_opengl2_fade_in(int instantaneous);
57 void gr_opengl2_fade_out(int instantaneous);
58 void gr_opengl2_get_region(int front, int w, int h, ubyte *data);
59 int gr_opengl2_save_screen();
60 void gr_opengl2_restore_screen(int);
61 void gr_opengl2_free_screen(int);
62 void gr_opengl2_dump_frame_start(int first_frame, int frames_between_dumps);
63 void gr_opengl2_dump_frame_stop();
64 void gr_opengl2_dump_frame();
65 void gr_opengl2_stream_start(int x, int y, int w, int h);
66 void gr_opengl2_stream_frame(ubyte *frame);
67 void gr_opengl2_stream_stop();
68 void gr_opengl2_set_viewport(int width, int height);
69 void gr_opengl2_preload_init();
70 int gr_opengl2_preload(int bitmap_num, int is_aabitmap);
71 void gr_opengl2_set_gamma(float);
72 void gr_opengl2_release_texture(int handle);
73 void gr_opengl2_rect(int x, int y, int w, int h);
74 void gr_opengl2_shade(int x, int y, int w, int h);
75 void gr_opengl2_aabitmap_ex(int x, int y, int w, int h, int sx, int sy);
76 void gr_opengl2_aabitmap(int x, int y);
77 void gr_opengl2_string(int sx, int sy, const char *s);
78 void gr_opengl2_line(int x1, int y1, int x2, int y2);
79 void gr_opengl2_aaline(vertex *v1, vertex *v2);
80 void gr_opengl2_gradient(int x1, int y1, int x2, int y2);
81 void gr_opengl2_circle(int xc, int yc, int d);
82 void gr_opengl2_pixel(int x, int y);
83 void gr_opengl2_cross_fade(int bmap1, int bmap2, int x1, int y1, int x2, int y2, float pct);
84 void gr_opengl2_flash(int r, int g, int b);
85 void gr_opengl2_tmapper(int nverts, vertex **verts, uint flags);
86 void gr_opengl2_scaler(vertex *va, vertex *vb);
87
88 #endif // GRGL2_H