<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Allegro 4.9.16 and set window</title>
		<link>http://www.allegro.cc/forums/view/602371</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sun, 06 Dec 2009 05:58:41 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Allegro 4.2.x and prior versions had a function, &quot;win_set_window&quot;. This was, obviously, a Windows-specific function. It allows the user to create their own window and have Allegro bind itself to it. You can&#39;t use graphics calls, but you can use things like Allegro&#39;s sound and input drivers.</p><p>I know in 4.2.1, the last version of Allegro I used, it didn&#39;t work very well. It was buggy and Allegro&#39;s functionality didn&#39;t seem to work well.</p><p>Allegro 5, as far as I can tell, does not have similar functionality. Will there be some way to use Allegro 5 without it having to own the window?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Nicol Bolas)</author>
		<pubDate>Wed, 02 Dec 2009 11:21:10 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The only trouble I had with this in 4.2.2 was that you had to make sure the window had focus when using graphics functions. The windows API sends messages to the window when it gains and looses focus. I had to use a &#39;focus&#39; variable to check whether the game ran or not (it just skipped the major parts of the loop).</p><p>All in all its only useful if you want a customized window or to use the windows GUI. Perhaps there is another way to do what you want? <img src="http://www.allegro.cc/forums/smileys/huh.gif" alt="???" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (furinkan)</author>
		<pubDate>Thu, 03 Dec 2009 14:26:51 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>What I want is to use Allegro&#39;s sound and input systems while I do what I want with graphics and other things.</p><p>Allegro 4.2.1 didn&#39;t seem to work very well. I haven&#39;t tried a more recent version on the 4.2/4.4 branch. I was wondering if Allegro 5 was going to provide some equivalent to this functionality.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Nicol Bolas)</author>
		<pubDate>Fri, 04 Dec 2009 01:29:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>We&#39;d add it if someone sent in a patch; we have al_win_get_window() already. I&#39;m not sure how it should work. Maybe you can propose a design.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Peter Wang)</author>
		<pubDate>Fri, 04 Dec 2009 03:19:57 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The design is exactly how win_set_window works in Allegro 4.2/4.4:</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Registers an user-created window to be used by Allegro. This function is meant to be called before initialising the library with allegro_init() or installing the autodetected system driver (SYSTEM_AUTODETECT). It lets you attach Allegro to any already existing window and prevents the library from creating its own, thus leaving you total control over the window; in particular, you are responsible for processing the events as usual (Allegro will automatically monitor a few of them, but will not filter out any of them). You can then use every component of the library (graphics, mouse, keyboard, sound, timers and so on), bearing in mind that some Allegro functions are blocking (e.g. readkey() if the key buffer is empty) and thus must be carefully manipulated by the window thread.</p></div></div><p>

Some modification of the details is understandable in order to make the whole thing work. But the main thing is that input, sound, and other non-graphics components function as normal.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Nicol Bolas)</author>
		<pubDate>Sat, 05 Dec 2009 10:17:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>So al_create_display() could only succeed once? Or maybe the user should set a new display flag to tell it to use the user-supplied window.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Peter Wang)</author>
		<pubDate>Sat, 05 Dec 2009 11:56:23 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;m not sure a display flag is the right way to go here. Creating an ALLEGRO_DISPLAY object isn&#39;t right because the user will assume that they can, you know, <i>use</i> it.</p><p>Functions like al_get_backbuffer, al_flip_display, and such should fail when using this mechanism. This is because Allegro should not modify the HWND in that way. That means no initializing OpenGL or D3D (or any other graphics driver).</p><p>I did notice a display flag called &quot;ALLEGRO_COMPATIBLE_DISPLAY&quot;. What exactly does this mean, and when would it be used currently? If this means that an ALLEGRO_DISPLAY object could be made such that the user knows that Allegro rendering is not available, then using a display flag/setting to do this is just fine.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Nicol Bolas)</author>
		<pubDate>Sun, 06 Dec 2009 02:07:32 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Huh, I never noticed ALLEGRO_COMPATIBLE_DISPLAY before.<br />It seems to be for situations like if you only have OpenGL &lt; 1.2 available. Then al_create_display() will not succeed in creating a display, as the rest of the graphics routines depend on OpenGL &gt;= 1.2.</p><p>Back to al_win_set_window(). It sounds like you wouldn&#39;t have used al_create_display() at all. I think the problem with that is the `display&#39; fields in keyboard/mouse events would have to be NULL, so you wouldn&#39;t have an indication which window was focused.</p><p>What about `ALLEGRO_DISPLAY *al_win_create_display(HWND wnd);&#39;?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Peter Wang)</author>
		<pubDate>Sun, 06 Dec 2009 03:57:12 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>That could work.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Nicol Bolas)</author>
		<pubDate>Sun, 06 Dec 2009 05:58:41 +0000</pubDate>
	</item>
</rss>
