Core routines

Basic AllegroGL functions. More...

Core Functions

Functions


Detailed Description

Basic AllegroGL functions.

These functions allow you to initialize AllegroGL, set up a rendering context via set_gfx_mode(), and allow access to regular OpenGL functions.


Define Documentation

 
#define allegro_gl_begin (  )     ;

Backward compatibility #define for programs written prior to AGL 0.0.22.

It isn't defined as anything meaningful, so you don't need to put them in your program.

See also:
allegro_gl_end()

Definition at line 135 of file alleggl.h.

Referenced by allegro_gl_printf_ex().

 
#define allegro_gl_end (  )     ;

Backward compatibility #define for programs written prior to AGL 0.0.22.

It isn't defined as anything meaningful, so you don't need to put them in your program.

See also:
allegro_gl_begin()

Definition at line 145 of file alleggl.h.

Referenced by allegro_gl_printf_ex().


Function Documentation

int install_allegro_gl ( void   ) 

Installs the AllegroGL addon to Allegro.

Allegro should already be initialized with allegro_init() or install_allegro().

Returns:
0 on success; -1 on failure.
See also:
remove_allegro_gl()

Definition at line 835 of file alleggl.c.

References __blit_between_formats15, __blit_between_formats16, __blit_between_formats24, __blit_between_formats32, __blit_between_formats8, allegro_gl_clear_settings(), allegro_gl_error, allegro_gl_memory_blit_between_formats(), list_saved_gfx_drivers(), our_gfx_drivers(), remove_allegro_gl(), and saved_gfx_drivers.

void remove_allegro_gl ( void   ) 

Removes the AllegroGL addon.

You should not call any more OpenGL or AllegroGL functions after calling this function. Note that it will be called automatically at program exit, so you don't need to explicitly do it.

See also:
install_allegro_gl()

Definition at line 893 of file alleggl.c.

References __blit_between_formats15, __blit_between_formats16, __blit_between_formats24, __blit_between_formats32, __blit_between_formats8, list_saved_gfx_drivers(), and saved_gfx_drivers.

Referenced by install_allegro_gl().

void allegro_gl_flip ( void   ) 

Flips the front and back framebuffers.

If you chose, or were given, a double buffered OpenGL mode, you have access to a front buffer, which is visible on the screen, and also a back buffer, which is not visible. This routine swaps the buffers, so that what was the back buffer is now the (visible) front buffer, and vice versa.

Normally in these modes you would do all your drawing to the back buffer, without the user seeing the image while it's partially drawn, and then call this function to swap the buffers, allowing the user to see what you've drawn, now that it's finished, while you proceed to draw the next frame.

When drawing to the screen bitmap, you may not be drawing to what user currently sees on his monitor. Since the buffers are swapped, you will actually be drawing in the previous frame. It is recommended that you either rebuild the screen every frame, or modify both front and back buffers every frame by drawing once, then flipping, then drawing again.

See also:
allegro_gl_set(), AGL_DOUBLEBUFFER

Definition at line 951 of file alleggl.c.

References __allegro_gl_driver, and allegro_gl_driver::flip.

Referenced by algl_do_dialog(), and algl_popup_dialog().

float allegro_gl_opengl_version (  ) 

Returns the OpenGL version number of the client (the computer the program is running on).

"1.0" is returned as 1.0, "1.2.1" is returned as 1.21, and "1.2.2" as 1.22, etc.

A valid OpenGL context must exist for this function to work, which means you may not call it before set_gfx_mode(GFX_OPENGL)

Returns:
The OpenGL ICD/MCD version number.

Definition at line 971 of file alleggl.c.

References __allegro_gl_valid_context.

Referenced by __fill_in_info_struct().


Generated on Sun Dec 3 18:06:50 2006 for AllegroGL by  doxygen 1.5.1