<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Patch to make _al_get_bitmap_display public</title>
		<link>http://www.allegro.cc/forums/view/615913</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Tue, 08 Dec 2015 07:52:28 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>For debugging purposes I needed to make <span class="source-code">_al_get_bitmap_display</span> public. So here&#39;s a patch to do so. It&#39;s a simple change, and it makes it possible to know which display a bitmap is currently attached to.</p><pre>
 docs/src/refman/graphics.txt |  4 ++++
 include/allegro5/bitmap.h    |  4 ++++
 src/bitmap.c                 | 10 ++++++++++
 3 files changed, 18 insertions(+)

diff --git a/docs/src/refman/graphics.txt b/docs/src/refman/graphics.txt
index 6ebde96..9d4b873 100644
--- a/docs/src/refman/graphics.txt
+++ b/docs/src/refman/graphics.txt
@@ -684,6 +684,10 @@ Returns the height of a bitmap in pixels.
 
 Returns the width of a bitmap in pixels.
 
+### API: al_get_bitmap_display
+
+Returns the display that the bitmap is attached to.
+
 ### API: al_get_pixel
 
 Get a pixel&#39;s color value from the specified bitmap.  This operation is slow
diff --git a/include/allegro5/bitmap.h b/include/allegro5/bitmap.h
index e93851d..042b0d0 100644
--- a/include/allegro5/bitmap.h
+++ b/include/allegro5/bitmap.h
@@ -11,6 +11,10 @@
  */
 typedef struct ALLEGRO_BITMAP ALLEGRO_BITMAP;
 
+/* Forward declaration of ALLEGRO_DISPLAY
+ */
+typedef struct ALLEGRO_DISPLAY ALLEGRO_DISPLAY;
+
 
 /*
  * Bitmap flags
diff --git a/src/bitmap.c b/src/bitmap.c
index 454e80f..82fc8a5 100644
--- a/src/bitmap.c
+++ b/src/bitmap.c
@@ -328,6 +328,16 @@ int al_get_bitmap_flags(ALLEGRO_BITMAP *bitmap)
 }
 
 
+
+/* Function: al_get_bitmap_display
+ */
+ALLEGRO_DISPLAY* al_get_bitmap_display(ALLEGRO_BITMAP* bitmap) 
+{
+   return _al_get_bitmap_display(bitmap);
+}
+
+
+
 ALLEGRO_DISPLAY *_al_get_bitmap_display(ALLEGRO_BITMAP *bitmap)
 {
    if (bitmap-&gt;parent)
</pre><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Tue, 08 Dec 2015 03:50:35 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Sounds useful to me... if nobody applies it within a few days make sure to put it on github.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Tue, 08 Dec 2015 07:52:28 +0000</pubDate>
	</item>
</rss>
