iOS/buildlibs/armv7/allegro-4.4.2/addons/allegrogl/src/gui.c
/**
 * \ingroup gui
 * \brief AllegroGL-friendly version of do_dialog
 *
 * This behaves exactly like do_dialog but forces a screen clear, 
 * rerender, and flip, after each iteration of update_dialog.
 *
 * User gui components can do OpenGL or Allegro rendering to draw 
 * themselves.  They should take care not to alter any OpenGL state
 * (or be aware that this will affect other components).  For the 
 * main render, they will be called in order, but this is not 
 * guarranteed at other times -- they may be called out of order;
 * however the results will never be visible, so just don't crash.
 *
 * Before drawing the final (in-order) pass, the color and depth buffers will
 * be cleared -- set your clear color to black or green or whatever you like.
 * You can overdraw it with an object of course.
 *
 * Further notes: This routine uses allegro_gl_set_allegro_mode(), so
 * your GUI components can use allegro_gl_unset_allegro_mode() to restore
 * the old state while they draw themselves, provided that they use 
 * allegro_gl_set_allegro_mode() again afterwards.
 *
 * \param dialog an array of dialog objects terminated by one with a NULL 
 * dialog procedure.
 * \param focus_obj index of the object on which the focus is set (-1 if you
 * don't want anything to have the focus
 *
 * \sa algl_draw_mouse
 */
\ingroup gui
\brief AllegroGL-friendly version of do_dialog

This behaves exactly like do_dialog but forces a screen clear,
rerender, and flip, after each iteration of update_dialog.

User gui components can do OpenGL or Allegro rendering to draw
themselves.  They should take care not to alter any OpenGL state
(or be aware that this will affect other components).  For the
main render, they will be called in order, but this is not
guarranteed at other times -- they may be called out of order;
however the results will never be visible, so just don't crash.

Before drawing the final (in-order) pass, the color and depth buffers will
be cleared -- set your clear color to black or green or whatever you like.
You can overdraw it with an object of course.

Further notes: This routine uses allegro_gl_set_allegro_mode(), so
your GUI components can use allegro_gl_unset_allegro_mode() to restore
the old state while they draw themselves, provided that they use
allegro_gl_set_allegro_mode() again afterwards.

\param dialog an array of dialog objects terminated by one with a NULL
dialog procedure.
\param focus_obj index of the object on which the focus is set (-1 if you
don't want anything to have the focus


\ ingroup gui \ brief AllegroGL - friendly version of do_dialog This behaves exactly like do_dialog but forces a screen clear rerender and flip after each iteration of update_dialog . User gui components can do OpenGL or Allegro rendering to draw themselves . They should take care not to alter any OpenGL state ( or be aware that this will affect other components ) . For the main render they will be called in order but this is not guarranteed at other times -- they may be called out of order ; however the results will never be visible so just don ' t crash . Before drawing the final ( in - order ) pass the color and depth buffers will be cleared -- set your clear color to black or green or whatever you like . You can overdraw it with an object of course . Further notes : This routine uses allegro_gl_set_allegro_mode () so your GUI components can use allegro_gl_unset_allegro_mode () to restore the old state while they draw themselves provided that they use allegro_gl_set_allegro_mode () again afterwards . \ param dialog an array of dialog objects terminated by one with a NULL dialog procedure . \ param focus_obj index of the object on which the focus is set ( - 1 if you don ' t want anything to have the focus
int algl_do_dialog (DIALOG *dialog, int focus_obj)
{
	DIALOG_PLAYER *player;
	AGL_LOG(2, "allegro_gl_do_dialog\n");
	allegro_gl_set_allegro_mode();
	player = init_dialog (dialog, focus_obj);
	show_mouse(screen);
	while (update_dialog (player)) {}
	show_mouse(NULL);
	allegro_gl_unset_allegro_mode();
	return shutdown_dialog (player);
}
int algl_do_dialog ( DIALOG * dialog , int focus_obj ) { DIALOG_PLAYER * player ; AGL_LOG ( 2 , " \n " ) ; allegro_gl_set_allegro_mode ( ) ; player = init_dialog ( dialog , focus_obj ) ; show_mouse ( screen ) ; while ( update_dialog ( player ) ) { } show_mouse ( NULL ) ; allegro_gl_unset_allegro_mode ( ) ; return shutdown_dialog ( player ) ; }
\ingroup gui
 \brief AllegroGL-friendly version of do_dialog
\ ingroup gui \ brief AllegroGL - friendly version of do_dialog
/* Allegro GUI routines generally use the 2D gfx functions therefore
	   we set default behaviour to allegro_gl_set_allegro_mode so that we
	   can use the GUI functions "as is" */ /* Nothing to do here.
	 * Redrawing is done from d_algl_viewport_proc() callback. */ /* restore previous projection matrices */