Re: [AD] is_windowed_mode

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Wednesday 01 December 2004 23:27, Evert Glebbeek wrote:
> Attached is a patch that adds an is_windowed_mode() function that returns 
> true if a graphics mode has been set and it is a windowed mode.
> This is a useful feature, for instance, if you use GFX_AUTODETECT and 
want 
> to know if the mode that was selected is a windowed mode (say, because of 
> mouse mickeys or system cursor). It was discussed on ACC a while back (a 
> few months) as a useful feature, and it's very simple to add anyway.

Commited, since noone seemed to object.
I've attached the (already applied) documentation patch.

Evert
Index: docs/src/allegro._tx
===================================================================
RCS file: /cvsroot/alleg/allegro/docs/src/allegro._tx,v
retrieving revision 1.279
diff -u -r1.279 allegro._tx
--- docs/src/allegro._tx	3 Dec 2004 22:11:26 -0000	1.279
+++ docs/src/allegro._tx	4 Dec 2004 12:43:53 -0000
@@ -3664,6 +3664,23 @@
    Returns the current display switching mode, in the same format passed to 
    set_display_switch_mode().
 
+@@int @is_windowed_mode(void);
+@xref set_gfx_mode
+   This function can be used to detect wether or not set_gfx_mode() selected
+   a windowed mode. Example:
+<codeblock>
+   set_gfx_mode(GFX_AUTODETECT, 640, 480, 0, 0);
+   if (is_windowed_mode()) {
+      /* Windowed mode stuff */
+   } else {
+      /* Fullscreen mode stuff */
+   }
+<endblock>
+@retval
+   Returns true if the current graphics mode is a windowed mode, or zero if
+   it is a fullscreen mode. You should not call this function if you are not
+   in graphics mode.
+
 @@extern int @gfx_capabilities;
 @xref screen, create_video_bitmap, scroll_screen, request_scroll, show_mouse
 @xref enable_triple_buffer


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/