]> icculus.org git repositories - taylor/freespace2.git/blob - include/grgl2.h
simply fullscreen<->window switching
[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_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 void opengl2_error_check(const char *name, int lno);
51
52 // gr_* pointer functions
53 void gr_opengl2_flip();
54 void gr_opengl2_set_clip(int x, int y, int w, int h);
55 void gr_opengl2_fog_set(int fog_mode, int r, int g, int b, float fog_near, float fog_far);
56 void gr_opengl2_zbuffer_clear(int mode);
57 void gr_opengl2_fade_in(int instantaneous);
58 void gr_opengl2_fade_out(int instantaneous);
59 void gr_opengl2_get_region(int front, int w, int h, ubyte *data);
60 int gr_opengl2_save_screen();
61 void gr_opengl2_restore_screen(int);
62 void gr_opengl2_free_screen(int);
63 void gr_opengl2_dump_frame_start(int first_frame, int frames_between_dumps);
64 void gr_opengl2_dump_frame_stop();
65 void gr_opengl2_dump_frame();
66 void gr_opengl2_stream_start(int x, int y, int w, int h);
67 void gr_opengl2_stream_frame(ubyte *frame);
68 void gr_opengl2_stream_stop();
69 void gr_opengl2_set_viewport(int width, int height);
70 void gr_opengl2_preload_init();
71 int gr_opengl2_preload(int bitmap_num, int is_aabitmap);
72 void gr_opengl2_set_gamma(float);
73 void gr_opengl2_release_texture(int handle);
74 void gr_opengl2_rect(int x, int y, int w, int h);
75 void gr_opengl2_shade(int x, int y, int w, int h);
76 void gr_opengl2_aabitmap_ex(int x, int y, int w, int h, int sx, int sy);
77 void gr_opengl2_aabitmap(int x, int y);
78 void gr_opengl2_string(int sx, int sy, const char *s);
79 void gr_opengl2_line(int x1, int y1, int x2, int y2);
80 void gr_opengl2_aaline(vertex *v1, vertex *v2);
81 void gr_opengl2_gradient(int x1, int y1, int x2, int y2);
82 void gr_opengl2_circle(int xc, int yc, int d);
83 void gr_opengl2_pixel(int x, int y);
84 void gr_opengl2_cross_fade(int bmap1, int bmap2, int x1, int y1, int x2, int y2, float pct);
85 void gr_opengl2_flash(int r, int g, int b);
86 void gr_opengl2_tmapper(int nverts, vertex **verts, uint flags);
87 void gr_opengl2_scaler(vertex *va, vertex *vb);
88
89 #endif // GRGL2_H