]> icculus.org git repositories - taylor/freespace2.git/blob - include/grgl2.h
rendering functions mostly done; more complete shader setup
[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, float *u_scale, float *v_scale, int fail_on_full);
24 void opengl2_set_texture_state(gr_texture_source ts);
25
26 // shader program types
27 typedef enum {
28         PROG_INVALID = -1,
29         PROG_TMAPPER = 0,
30         PROG_AABITMAP = 1,
31         PROG_LINES = 2
32 } sdr_prog_t;
33
34 // shader variable indexes
35 enum {
36         SDRI_POSITION = 1,
37         SDRI_COLOR = 2,
38         SDRI_SEC_COLOR = 3,
39         SDRI_TEXCOORD = 4
40 };
41
42 int opengl2_shader_init();
43 void opengl2_shader_cleanup();
44 void opengl2_shader_use(sdr_prog_t prog);
45
46 void opengl2_error_check(const char *name, int lno);
47
48 // gr_* pointer functions
49 void gr_opengl2_flip();
50 void gr_opengl2_set_clip(int x, int y, int w, int h);
51 void gr_opengl2_fog_set(int fog_mode, int r, int g, int b, float fog_near, float fog_far);
52 void gr_opengl2_zbuffer_clear(int mode);
53 void gr_opengl2_fade_in(int instantaneous);
54 void gr_opengl2_fade_out(int instantaneous);
55 void gr_opengl2_get_region(int front, int w, int h, ubyte *data);
56 int gr_opengl2_save_screen();
57 void gr_opengl2_restore_screen(int);
58 void gr_opengl2_free_screen(int);
59 void gr_opengl2_dump_frame_start(int first_frame, int frames_between_dumps);
60 void gr_opengl2_dump_frame_stop();
61 void gr_opengl2_dump_frame();
62 void gr_opengl2_set_viewport(int width, int height);
63 void gr_opengl2_preload_init();
64 int gr_opengl2_preload(int bitmap_num, int is_aabitmap);
65 void gr_opengl2_set_gamma(float);
66 void gr_opengl2_release_texture(int handle);
67 void gr_opengl2_rect(int x, int y, int w, int h);
68 void gr_opengl2_shade(int x, int y, int w, int h);
69 void gr_opengl2_aabitmap_ex(int x, int y, int w, int h, int sx, int sy);
70 void gr_opengl2_aabitmap(int x, int y);
71 void gr_opengl2_string(int sx, int sy, const char *s);
72 void gr_opengl2_line(int x1, int y1, int x2, int y2);
73 void gr_opengl2_aaline(vertex *v1, vertex *v2);
74 void gr_opengl2_gradient(int x1, int y1, int x2, int y2);
75 void gr_opengl2_circle(int xc, int yc, int d);
76 void gr_opengl2_pixel(int x, int y);
77 void gr_opengl2_cross_fade(int bmap1, int bmap2, int x1, int y1, int x2, int y2, float pct);
78 void gr_opengl2_flash(int r, int g, int b);
79 void gr_opengl2_tmapper(int nverts, vertex **verts, uint flags);
80 void gr_opengl2_scaler(vertex *va, vertex *vb);
81
82 #endif // GRGL2_H