allglint.h

00001 #ifndef gf_included_allglint_h
00002 #define gf_included_allglint_h
00003 
00004 #include "alleggl.h"
00005 
00006 
00007 struct allegro_gl_info {
00008     float version;          /* OpenGL version */
00009     int num_texture_units;  /* Number of texture units */
00010     int max_texture_size;   /* Maximum texture size */
00011     int is_voodoo3_and_under; /* Special cases for Voodoo 1-3 */
00012     int is_voodoo;          /* Special cases for Voodoo cards */
00013     int is_matrox_g200;     /* Special cases for Matrox G200 boards */
00014     int is_ati_rage_pro;    /* Special cases for ATI Rage Pro boards */
00015     int is_ati_radeon_7000; /* Special cases for ATI Radeon 7000 */
00016     int is_ati_r200_chip;   /* Special cases for ATI card with chip R200 */
00017     int is_mesa_driver;     /* Special cases for MESA */
00018 };
00019 
00020 
00021 
00022 struct allegro_gl_driver {
00023     void (*flip) (void);
00024     void (*gl_on) (void);
00025     void (*gl_off) (void);
00026     void (*screen_masked_blit)(struct BITMAP *source, int source_x,
00027                                int source_y, int dest_x, int dest_y,
00028                                int width, int height, int flip_dir,
00029                                int blit_type);
00030 };
00031 
00032 
00033 
00034 struct allegro_gl_rgba_size {
00035     int r, g, b, a;
00036 };
00037 
00038 
00039 
00040 struct allegro_gl_indexed_size {
00041     int bpp;
00042 };
00043 
00044 
00045 
00046 union allegro_gl_pixel_size {
00047     struct allegro_gl_rgba_size rgba;
00048     struct allegro_gl_indexed_size indexed;
00049 };
00050 
00051 
00052 
00053 struct allegro_gl_display_info {
00054     int allegro_format;
00055     union allegro_gl_pixel_size pixel_size;
00056     int colour_depth;
00057     union allegro_gl_pixel_size accum_size;
00058     int doublebuffered;
00059     int stereo;
00060     int aux_buffers;
00061     int depth_size;
00062     int stencil_size;
00063     int w, h, x, y;
00064     int r_shift, g_shift, b_shift, a_shift;
00065     int packed_pixel_type, packed_pixel_format;
00066     int rmethod; /* type of rendering, 0: software; 1: hardware, 2: unknown (X Win) */
00067     int fullscreen;
00068     int vidmem_policy;
00069     int sample_buffers;
00070     int samples;
00071     int float_color;
00072     int float_depth;
00073 };
00074 
00075 extern struct allegro_gl_display_info allegro_gl_display_info;
00076 extern struct allegro_gl_driver *__allegro_gl_driver;
00077 extern struct allegro_gl_info allegro_gl_info;
00078 extern int __allegro_gl_required_settings, __allegro_gl_suggested_settings;
00079 extern int __allegro_gl_valid_context;
00080 extern int __allegro_gl_use_alpha;
00081 extern GLint __allegro_gl_texture_read_format[5];
00082 extern GLint __allegro_gl_texture_components[5];
00083 
00084 #ifdef ALLEGRO_WINDOWS
00085 extern HDC __allegro_gl_hdc;
00086 #endif
00087 
00088 int __allegro_gl_make_power_of_2(int x);
00089 
00090 void __allegro_gl_reset_scorer (void);
00091 int __allegro_gl_score_config (int refnum, struct allegro_gl_display_info *dinfo);
00092 int __allegro_gl_best_config (void);
00093 
00094 void __allegro_gl_set_allegro_image_format (int big_endian);
00095 BITMAP* __allegro_gl_convert_masked_bitmap(int *dest_fmt, BITMAP *source, int source_x, int source_y, int width, int height, int flip);
00096 
00097 void __allegro_gl_fill_in_info(void);
00098 
00099 void __allegro_gl_manage_extensions(void);
00100 void __allegro_gl_unmanage_extensions(void);
00101 void __allegro_gl_print_extensions(const char * extension);
00102 int __allegro_gl_look_for_an_extension(AL_CONST char *name,
00103                                                   AL_CONST GLubyte * extensions);
00104 
00105 
00106 extern _DRIVER_INFO *(*saved_gfx_drivers) (void);
00107 
00108 typedef void (* BLIT_BETWEEN_FORMATS_FUNC) (struct BITMAP*, struct BITMAP*, int, int, int, int, int, int);
00109 extern BLIT_BETWEEN_FORMATS_FUNC __blit_between_formats8;
00110 extern BLIT_BETWEEN_FORMATS_FUNC __blit_between_formats15;
00111 extern BLIT_BETWEEN_FORMATS_FUNC __blit_between_formats16;
00112 extern BLIT_BETWEEN_FORMATS_FUNC __blit_between_formats24;
00113 extern BLIT_BETWEEN_FORMATS_FUNC __blit_between_formats32;
00114 
00115 void allegro_gl_memory_blit_between_formats(struct BITMAP *source, struct BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height);
00116 
00117 int allegro_gl_set_mouse_sprite(BITMAP *sprite, int xfocus, int yfocus);
00118 int allegro_gl_show_mouse(BITMAP* bmp, int x, int y);
00119 void allegro_gl_hide_mouse(void);
00120 void allegro_gl_move_mouse(int x, int y);
00121 
00122 
00123 extern GLenum __allegro_gl_get_bitmap_type(BITMAP *bmp, int flags);
00124 extern GLenum __allegro_gl_get_bitmap_color_format(BITMAP *bmp, int flags);
00125 extern GLint __allegro_gl_get_texture_format_ex(BITMAP *bmp, int flags);
00126 extern BITMAP *__allegro_gl_munge_bitmap(int flags, BITMAP *bmp, int x, int y,
00127                                       int w, int h, GLint *type, GLint *format);
00128 
00132 typedef struct AGL_GLYPH {
00133     int glyph_num;
00134     int x, y, w, h;
00135     int offset_x, offset_y, offset_w, offset_h;
00136 } AGL_GLYPH;
00137 
00138 
00139 /*   <ofs_x>
00140      +--------------------+
00141      |                    |
00142      |    +-------+       |
00143      |    | glyph |       |
00144      |    +-------+       |
00145      |                    |
00146      +--------------------+
00147           <   w   ><ofs_w >
00148      <      polygon       >
00149 */
00150 
00151 
00156 typedef struct FONT_AGL_DATA {
00157     int type;
00158     int start, end;
00159     int is_free_chunk;
00160 
00161     float scale;
00162     GLint format;
00163 
00164     void *data;
00165     AGL_GLYPH *glyph_coords;
00166     GLuint list_base;
00167     GLuint texture;
00168 
00169     struct FONT_AGL_DATA *next;
00170 
00171         int has_alpha;
00172 } FONT_AGL_DATA;
00173 
00174 extern struct FONT_VTABLE *font_vtable_agl;
00175 
00176 
00181 #define AGL_TEXTURE_FORCE_ALPHA_INTERNAL 0x80000000
00182 
00186 #define AGL_TEXTURE_CHECK_VALID_INTERNAL 0x40000000
00187 
00188 
00189 #define AGL_LOG(level,str)
00190 
00191 #ifdef DEBUGMODE
00192 #ifdef LOGLEVEL
00193 
00194 void __allegro_gl_log (int level, const char *str);
00195 #undef AGL_LOG
00196 #define AGL_LOG(level,str) __allegro_gl_log (level, str)
00197 
00198 
00199 #endif
00200 #endif
00201 
00202 
00203 #define GET_ALLEGRO_VERSION() MAKE_VER(ALLEGRO_VERSION, ALLEGRO_SUB_VERSION, \
00204                                        ALLEGRO_WIP_VERSION)
00205 #define MAKE_VER(a, b, c) (((a) << 16) | ((b) << 8) | (c))
00206 
00207 
00208 #endif
00209 

Generated on Mon Apr 3 18:20:12 2006 for AllegroGL by  doxygen 1.4.6