<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>[A5] Changing window flags</title>
		<link>http://www.allegro.cc/forums/view/614575</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Wed, 20 Aug 2014 17:42:44 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hey, how would I go by changing the window flags while the program is running?<br />Right now, the program is operating in fullscreen mode, but I want the user to be able to push F1 to switch between Windowed || Fullscreen mode.</p><p>I tried this, but it didn&#39;t seem to work;<br /><span class="source-code"><a href="http://www.allegro.cc/manual/al_set_new_display_flags"><span class="a">al_set_new_display_flags</span></a><span class="k2">(</span>ALLEGRO_WINDOWED <span class="k3">|</span><span class="k3">|</span> ALLEGRO_FULLSCREEN<span class="k2">)</span><span class="k2">;</span></span></p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">  1</span><span class="k1">if</span><span class="k2">(</span>ev.type <span class="k3">=</span><span class="k3">=</span> ALLEGRO_EVENT_KEY_DOWN<span class="k2">)</span>
<span class="number">  2</span><span class="k2">{</span>
<span class="number">  3</span>  <span class="c">//handle key presses</span>
<span class="number">  4</span>  <span class="k1">switch</span><span class="k2">(</span>ev.keyboard.keycode<span class="k2">)</span>
<span class="number">  5</span>  <span class="k2">{</span>
<span class="number">  6</span>  <span class="k1">case</span> ALLEGRO_KEY_F1:
<span class="number">  7</span>    <span class="k2">{</span>
<span class="number">  8</span>      <a href="http://www.allegro.cc/manual/al_set_new_display_flags"><span class="a">al_set_new_display_flags</span></a><span class="k2">(</span>ALLEGRO_WINDOWED<span class="k2">)</span><span class="k2">;</span>
<span class="number">  9</span>    <span class="k2">}</span>
<span class="number"> 10</span>    <span class="k1">break</span><span class="k2">;</span>
<span class="number"> 11</span>  <span class="k2">}</span>
<span class="number"> 12</span><span class="k2">}</span>
</div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matias Persson)</author>
		<pubDate>Wed, 20 Aug 2014 08:05:25 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You need <span class="source-code"><a href="http://www.allegro.cc/manual/al_toggle_display_flag"><span class="a">al_toggle_display_flag</span></a><span class="k2">(</span>display , ALLEGRO_FULLSCREEN_WINDOW , fullscreen <span class="k3">=</span> <span class="k3">!</span>fullscreen<span class="k2">)</span><span class="k2">;</span></span> Or you can destroy and recreate the display. But that means converting bitmaps to be compatible with the new display or reloading everything.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Wed, 20 Aug 2014 09:13:57 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matias Persson)</author>
		<pubDate>Wed, 20 Aug 2014 09:32:08 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Allegro 5.1 is supposed to do the bitmap conversion automatically for you, but with 5.0 you have to do it manually, using al_clone_bitmap. You don&#39;t need to do this when using the &quot;fullscreen window&quot; mode, though.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (torhu)</author>
		<pubDate>Wed, 20 Aug 2014 17:42:44 +0000</pubDate>
	</item>
</rss>
