]> icculus.org git repositories - taylor/freespace2.git/blob - include/grgl1.h
re-add PXO sources to project files
[taylor/freespace2.git] / include / grgl1.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 _GROPENGL1_H
10 #define _GROPENGL1_H
11
12 #include "pstypes.h"
13
14
15 typedef enum gr_texture_source {
16         TEXTURE_SOURCE_NONE,
17         TEXTURE_SOURCE_DECAL,
18         TEXTURE_SOURCE_NO_FILTERING,
19 } gr_texture_source;
20
21 typedef enum gr_alpha_blend {
22         ALPHA_BLEND_NONE,                       // 1*SrcPixel + 0*DestPixel
23         ALPHA_BLEND_ADDITIVE,                   // 1*SrcPixel + 1*DestPixel
24         ALPHA_BLEND_ALPHA_ADDITIVE,             // Alpha*SrcPixel + 1*DestPixel
25         ALPHA_BLEND_ALPHA_BLEND_ALPHA,          // Alpha*SrcPixel + (1-Alpha)*DestPixel
26         ALPHA_BLEND_ALPHA_BLEND_SRC_COLOR,      // Alpha*SrcPixel + (1-SrcPixel)*DestPixel
27 } gr_alpha_blend;
28
29 typedef enum gr_zbuffer_type {
30         ZBUFFER_TYPE_NONE,
31         ZBUFFER_TYPE_READ,
32         ZBUFFER_TYPE_WRITE,
33         ZBUFFER_TYPE_FULL,
34 } gr_zbuffer_type;
35
36 extern PFNGLSECONDARYCOLORPOINTERPROC vglSecondaryColorPointer;
37
38 void opengl1_init();
39 void opengl1_cleanup();
40
41 void opengl1_set_state(gr_texture_source ts, gr_alpha_blend ab, gr_zbuffer_type zt);
42 void opengl1_set_texture_state(gr_texture_source ts);
43
44 void opengl1_tcache_init();
45 void opengl1_tcache_cleanup();
46 void opengl1_tcache_flush();
47 void opengl1_tcache_frame();
48 int opengl1_tcache_set(int bitmap_id, int bitmap_type, float *u_scale, float *v_scale, int fail_on_full = 0, int sx = -1, int sy = -1, int force = 0);
49
50 // gr_* pointer functions
51 void gr_opengl1_rect(int x,int y,int w,int h);
52 void gr_opengl1_shade(int x,int y,int w,int h);
53 void gr_opengl1_aabitmap_ex(int x,int y,int w,int h,int sx,int sy);
54 void gr_opengl1_aabitmap(int x, int y);
55 void gr_opengl1_string( int sx, int sy, const char *s );
56 void gr_opengl1_line(int x1,int y1,int x2,int y2);
57 void gr_opengl1_aaline(vertex *v1, vertex *v2);
58 void gr_opengl1_gradient(int x1,int y1,int x2,int y2);
59 void gr_opengl1_circle( int xc, int yc, int d );
60 void gr_opengl1_pixel(int x, int y);
61 void gr_opengl1_cross_fade(int bmap1, int bmap2, int x1, int y1, int x2, int y2, float pct);
62 void gr_opengl1_flash(int r, int g, int b);
63 void gr_opengl1_tmapper( int nverts, vertex **verts, uint flags );
64 void gr_opengl1_scaler(vertex *va, vertex *vb );
65 void gr_opengl1_save_mouse_area(int x, int y, int w, int h);
66 void gr_opengl1_set_gamma(float gamma);
67 void gr_opengl1_preload_init();
68 int gr_opengl1_preload(int bitmap_num, int is_aabitmap);
69 void gr_opengl1_activate(int active);
70 void gr_opengl1_clear();
71 void gr_opengl1_flip();
72 void gr_opengl1_set_clip(int x,int y,int w,int h);
73 void gr_opengl1_reset_clip();
74 void gr_opengl1_print_screen(const char *filename);
75 void gr_opengl1_fog_set(int fog_mode, int r, int g, int b, float fog_near, float fog_far);
76 void gr_opengl1_set_cull(int cull);
77 void gr_opengl1_zbuffer_clear(int mode);
78 void gr_opengl1_fade_in(int instantaneous);
79 void gr_opengl1_fade_out(int instantaneous);
80 void gr_opengl1_get_region(int front, int w, int h, ubyte *data);
81 void gr_opengl1_save_mouse_area(int x, int y, int w, int h);
82 int gr_opengl1_save_screen();
83 void gr_opengl1_restore_screen(int id);
84 void gr_opengl1_free_screen(int id);
85 void gr_opengl1_dump_frame_start(int first_frame, int frames_between_dumps);
86 void gr_opengl1_dump_frame_stop();
87 void gr_opengl1_dump_frame();
88 uint gr_opengl1_lock();
89 void gr_opengl1_unlock();
90 void gr_opengl1_zbias(int bias);
91 void gr_opengl1_set_viewport(int width, int height);
92 void gr_opengl1_release_texture(int handle);
93
94 #endif  // _GROPENGL1_H