<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Multiple windows</title>
		<link>http://www.allegro.cc/forums/view/611969</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sat, 02 Feb 2013 05:58:58 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>

I have a few questions for using multiple windows.</p><p>1) What is the best way to avoid context switching?</p><p>2) Is it just video bitmaps that are attached to a display?</p><p>3) What happens when you draw images to a display that aren&#39;t attached to them? Is this supported?</p><p>4) Will al_convert_bitmap be backported to Allegro 5.0.x? Or should I just stick with A5.1?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Fri, 01 Feb 2013 02:02:53 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/611969/975904#target">Edgar Reynaldo</a> said:</div><div class="quote"><p> 2) Is it just video bitmaps that are attached to a display?</p></div></div><p>Since only video bitmaps are stored in V-RAM, my guess is &quot;yes&quot;. At least memory bitmaps I can&#39;t imagine being display dependent.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> 3) What happens when you draw images to a display that aren&#39;t attached to them? Is this supported?</p></div></div><p>I think I once did that in a multi-threaded application without knowing. I loaded graphics in a thread that did not create the active display and then displayed them, anyways. I didn&#39;t experience any problems, but I also have to say that my engine wasn&#39;t really too far at that time (only a few tiny graphics on-screen) and that I don&#39;t know if it would work the same way when having multiple windows.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (RPG Hacker)</author>
		<pubDate>Fri, 01 Feb 2013 04:54:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Drawing bitmaps to a display that aren&#39;t attached to that display treats them as memory bitmaps. It might actually be a bit worse than that, since it probably has to lock and read the contents from the source, then lock and write to the destination.</p><p>It is not an optimal route to go. You can however clone all of the bitmaps you want to use on both displays, so load them attached to one display, switch to the other display, and <span class="source-code"><a href="http://www.allegro.cc/manual/al_clone_bitmap"><span class="a">al_clone_bitmap</span></a></span> the &quot;shared&quot; bitmaps.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Fri, 01 Feb 2013 06:23:32 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>A bit of background. An Allegro display always has its own rendering context (in OpenGL terms). The texture underlying a video bitmap belongs to a rendering context.  This is where the concept of a video bitmap being &quot;tied&quot; to a display comes from.</p><p>On X, OpenGL contexts always share resources so, actually, you can draw a video bitmap in a different context. On Windows, OpenGL rendering contexts do NOT share by default. It is possible to create a context which shares with another, but Allegro does not expose this yet.</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/611969/975904#target">Edgar Reynaldo</a> said:</div><div class="quote"><p>3) What happens when you draw images to a display that aren&#39;t attached to them? Is this supported?</p></div></div><p>

If al_is_compatible_bitmap returns true then it would draw with acceleration. Otherwise it is treated as a memory bitmap - but I&#39;m a bit hazy on that point, as that would imply we have a memory copy of every video bitmap. Maybe NO_PRESERVE_TEXTURE has something to do with it.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>4) Will al_convert_bitmap be backported to Allegro 5.0.x?</p></div></div><p>

No.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Peter Wang)</author>
		<pubDate>Fri, 01 Feb 2013 09:01:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I think we only have a copy of every bitmap when the platform port doesn&#39;t default to preserving textures (ie X11+GL since it keeps the textures for us).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Fri, 01 Feb 2013 09:29:04 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Will there be a <span class="source-code">al_convert_font</span> function in 5.1.x? It would be cool if there was. That way you could load fonts in other threads and then convert them later.</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/611969/975927#target">Peter Wang</a> said:</div><div class="quote"><p>
It is possible to create a context which shares with another, but Allegro does not expose this yet.
</p></div></div><p>
How much work would this take?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Fri, 01 Feb 2013 12:39:54 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/611969/975931#target">Edgar Reynaldo</a> said:</div><div class="quote"><p>Will there be a al_convert_font function in 5.1.x? </p></div></div><p>

I think for TTF fonts objects we would need to add a function to explicitly cache certain glyphs, for that to be useful.</p><p>A few times, I wish TTF font objects had separate caches per (compatible) target, so you don&#39;t need two of the &quot;same&quot; ALLEGRO_FONT to draw to memory and video bitmap targets. Not sure how it would work out, though.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>How much work would this take?</p></div></div><p>

Don&#39;t know, but probably not that much. The relevant function is wglCreateContextAttribsARB. I think it will mostly require testing.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Peter Wang)</author>
		<pubDate>Sat, 02 Feb 2013 05:58:58 +0000</pubDate>
	</item>
</rss>
