2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
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
15 typedef enum gr_texture_source {
18 TEXTURE_SOURCE_NO_FILTERING,
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
29 typedef enum gr_zbuffer_type {
36 extern PFNGLSECONDARYCOLORPOINTERPROC vglSecondaryColorPointer;
39 void opengl1_cleanup();
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);
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);
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);
94 #endif // _GROPENGL1_H