# gui.c File Reference

AllegroGL GUI wrappers. More...

`#include "alleggl.h"`
`#include "allglint.h"`
`#include <allegro/internal/aintern.h>`

Go to the source code of this file.

## Defines

- #define A_S1 1
- #define A_S2 2
- #define A_S3 3
- #define A_B1 4
- #define A_B2 5
- #define A_B3 6
- #define SORT_OUT_BUTTON(x)

## Functions

- int algl_do_dialog (DIALOG *dialog, int focus_obj)
    AllegroGL-friendly version of do_dialog.
- int algl_popup_dialog (DIALOG *dialog, int focus_obj)
    AllegroGL-friendly version of popup_dialog.
- void algl_draw_mouse (void)
    Draws a mouse pointer on the screen.
- void algl_set_mouse_drawer (void(*user_draw_mouse)(void))
    Sets (or clears) a user mouse drawing callback.
- int algl_alert3 (AL_CONST char *s1, AL_CONST char *s2, AL_CONST char *s3, AL_CONST char *b1, AL_CONST char *b2, AL_CONST char *b3, int c1, int c2, int c3)
    AllegroGL-friendly version of Allegro's alert3.
- int algl_alert (AL_CONST char *s1, AL_CONST char *s2, AL_CONST char *s3, AL_CONST char *b1, AL_CONST char *b2, int c1, int c2)
    AllegroGL-friendly version of Allegro's alert.
- int d_algl_viewport_proc (int msg, DIALOG *d, int c)
    Creates a viewport object where OpenGL commands can be performed.
- int allegro_gl_set_mouse_sprite (BITMAP *sprite, int xfocus, int yfocus)
- int allegro_gl_show_mouse (BITMAP *bmp, int x, int y)
- void allegro_gl_hide_mouse (void)
- void allegro_gl_move_mouse (int x, int y)

## Variables

- struct {
  - GLuint texture
  - int hidden
  - int xfocus
  - int yfocus
  - int width
  - int height
- } allegro_gl_mouse
- static void(* __algl_user_draw_mouse )(void) = NULL
- static DIALOG alert_dialog []

## Detailed Description

AllegroGL GUI wrappers.

These are replacements for Allegro's do_dialog routine and standard dialogs (to use our version of the routine).

Definition in file gui.c.

## Define Documentation

#define SORT_OUT_BUTTON | ( | x |  | ) |

Value:

    {                                            \
          if (b##x) {                                                          \
         alert_dialog[A_B##x].flags &= ~D_HIDDEN;                          \
         alert_dialog[A_B##x].key = c##x;                                  \
         alert_dialog[A_B##x].dp = (char *)b##x;                           \
         len##x = gui_strlen(b##x);                                        \
         b[buttons++] = A_B##x;                                            \
          }                                                                    \
          else {                                                               \
         alert_dialog[A_B##x].flags |= D_HIDDEN;                           \
         len##x = 0;                                                       \
          }                                                                    \
       }

## Variable Documentation

DIALOG alert_dialog[]`[static]`

Initial value:

    {

       { _gui_shadow_box_proc, 0,    0,    0,    0,    0,    0,    0,    0,       0,    0,    NULL, NULL, NULL  },
       { _gui_ctext_proc,      0,    0,    0,    0,    0,    0,    0,    0,       0,    0,    NULL, NULL, NULL  },
       { _gui_ctext_proc,      0,    0,    0,    0,    0,    0,    0,    0,       0,    0,    NULL, NULL, NULL  },
       { _gui_ctext_proc,      0,    0,    0,    0,    0,    0,    0,    0,       0,    0,    NULL, NULL, NULL  },
       { _gui_button_proc,     0,    0,    0,    0,    0,    0,    0,    D_EXIT,  0,    0,    NULL, NULL, NULL  },
       { _gui_button_proc,     0,    0,    0,    0,    0,    0,    0,    D_EXIT,  0,    0,    NULL, NULL, NULL  },
       { _gui_button_proc,     0,    0,    0,    0,    0,    0,    0,    D_EXIT,  0,    0,    NULL, NULL, NULL  },
       { d_yield_proc,         0,    0,    0,    0,    0,    0,    0,    0,       0,    0,    NULL, NULL, NULL  },
       { NULL,                 0,    0,    0,    0,    0,    0,    0,    0,       0,    0,    NULL, NULL, NULL  }
    }

Definition at line 295 of file gui.c.