[AD] is_windowed_mode

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


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.

Evert
Index: include/allegro/inline/gfx.inl
===================================================================
RCS file: /cvsroot/alleg/allegro/include/allegro/inline/gfx.inl,v
retrieving revision 1.7
diff -u -r1.7 gfx.inl
--- include/allegro/inline/gfx.inl	15 Dec 2003 06:56:01 -0000	1.7
+++ include/allegro/inline/gfx.inl	30 Nov 2004 20:01:17 -0000
@@ -84,6 +84,16 @@
 #endif      /* C vs. inline asm */
 
 
+AL_INLINE(int, is_windowed_mode, (void),
+{
+   if (gfx_driver)
+      return gfx_driver->windowed;
+   else
+      return 0;
+})
+
+
+
 AL_INLINE(void, clear_to_color, (BITMAP *bitmap, int color),
 {
    ASSERT(bitmap);


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