- Main Page
- Related Pages
- Modules
- Files

- File List
- Globals

# 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
    00096 void __allegro_gl_fill_in_info(void);
    00097
    00098 void __allegro_gl_manage_extensions(void);
    00099 void __allegro_gl_unmanage_extensions(void);
    00100 void __allegro_gl_print_extensions(const char * extension);
    00101 int __allegro_gl_look_for_an_extension(AL_CONST char *name,
    00102                                                   AL_CONST GLubyte * extensions);
    00103
    00104
    00105 extern _DRIVER_INFO *(*saved_gfx_drivers) (void);
    00106
    00107 typedef void (* BLIT_BETWEEN_FORMATS_FUNC) (struct BITMAP*, struct BITMAP*, int, int, int, int, int, int);
    00108 extern BLIT_BETWEEN_FORMATS_FUNC __blit_between_formats8;
    00109 extern BLIT_BETWEEN_FORMATS_FUNC __blit_between_formats15;
    00110 extern BLIT_BETWEEN_FORMATS_FUNC __blit_between_formats16;
    00111 extern BLIT_BETWEEN_FORMATS_FUNC __blit_between_formats24;
    00112 extern BLIT_BETWEEN_FORMATS_FUNC __blit_between_formats32;
    00113
    00114 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);
    00115
    00116 int allegro_gl_set_mouse_sprite(BITMAP *sprite, int xfocus, int yfocus);
    00117 int allegro_gl_show_mouse(BITMAP* bmp, int x, int y);
    00118 void allegro_gl_hide_mouse(void);
    00119 void allegro_gl_move_mouse(int x, int y);
    00120
    00121
    00122 extern char const *__allegro_gl_get_format_description(GLint format);
    00123 extern int __allegro_gl_get_num_channels(GLenum format);
    00124 extern GLenum __allegro_gl_get_bitmap_type(BITMAP *bmp, int flags);
    00125 extern GLenum __allegro_gl_get_bitmap_color_format(BITMAP *bmp, int flags);
    00126 extern GLint __allegro_gl_get_texture_format_ex(BITMAP *bmp, int flags);
    00127 extern BITMAP *__allegro_gl_munge_bitmap(int flags, BITMAP *bmp, int x, int y,
    00128                                       int w, int h, GLint *type, GLint *format);
    00129
    00130 extern int __allegro_gl_blit_operation;
    00131
    00132
    00136 typedef struct AGL_GLYPH {
    00137     int glyph_num;
    00138     int x, y, w, h;
    00139     int offset_x, offset_y, offset_w, offset_h;
    00140 } AGL_GLYPH;
    00141
    00142
    00143 /*   <ofs_x>
    00144      +--------------------+
    00145      |                    |
    00146      |    +-------+       |
    00147      |    | glyph |       |
    00148      |    +-------+       |
    00149      |                    |
    00150      +--------------------+
    00151           <   w   ><ofs_w >
    00152      <      polygon       >
    00153 */
    00154
    00155
    00160 typedef struct FONT_AGL_DATA {
    00161     int type;
    00162     int start, end;
    00163     int is_free_chunk;
    00164
    00165     float scale;
    00166     GLint format;
    00167
    00168     void *data;
    00169     AGL_GLYPH *glyph_coords;
    00170     GLuint list_base;
    00171     GLuint texture;
    00172
    00173     struct FONT_AGL_DATA *next;
    00174
    00175         int has_alpha;
    00176 } FONT_AGL_DATA;
    00177
    00178 extern struct FONT_VTABLE *font_vtable_agl;
    00179
    00180
    00185 #define AGL_TEXTURE_FORCE_ALPHA_INTERNAL 0x80000000
    00186
    00190 #define AGL_TEXTURE_CHECK_VALID_INTERNAL 0x40000000
    00191
    00192
    00193 #define AGL_OP_LOGIC_OP         0x0
    00194 #define AGL_OP_BLEND            0x1
    00195
    00196 #define AGL_H_FLIP      1   /* Flag to request horizontal flipping */
    00197 #define AGL_V_FLIP      2   /* Flag to request vertical flipping */
    00198 #define AGL_REGULAR_BMP 1   /* Must be set for bitmaps that are not sprites.
    00199                                Otherwise the clipping routine will not test
    00200                                if source_x and source_y are legal values */
    00201 #define AGL_NO_ROTATION 2   /* If not set the clipping routine is skipped
    00202                                This is needed for pivot_scaled_x() in order
    00203                                not to clip rotated bitmaps (in such a case
    00204                                OpenGL will take care of it) */
    00205
    00206
    00207 #define AGL_LOG(level,str)
    00208
    00209 #ifdef DEBUGMODE
    00210 #ifdef LOGLEVEL
    00211
    00212 void __allegro_gl_log (int level, const char *str);
    00213 #undef AGL_LOG
    00214 #define AGL_LOG(level,str) __allegro_gl_log (level, str)
    00215
    00216
    00217 #endif
    00218 #endif
    00219
    00220
    00221 #define GET_ALLEGRO_VERSION() MAKE_VER(ALLEGRO_VERSION, ALLEGRO_SUB_VERSION, \
    00222                                        ALLEGRO_WIP_VERSION)
    00223 #define MAKE_VER(a, b, c) (((a) << 16) | ((b) << 8) | (c))
    00224
    00225
    00226 #endif
    00227