<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>how does &quot;screen&quot; interact with &quot;show_video_bitmap&quot; ?</title>
		<link>http://www.allegro.cc/forums/view/585751</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Mon, 05 Jun 2006 15:57:36 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The following piece of code leads to unpredictable behaviour (due to recasting the screen pointer).</p><div class="source-code snippet"><div class="inner"><pre>video_screen <span class="k3">=</span> <a href="http://www.allegro.cc/manual/create_video_bitmap" target="_blank"><span class="a">create_video_bitmap</span></a><span class="k2">(</span>width, height<span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/show_video_bitmap" target="_blank"><span class="a">show_video_bitmap</span></a><span class="k2">(</span>video_screen<span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/screen" target="_blank"><span class="a">screen</span></a> <span class="k3">=</span> video_screen<span class="k2">;</span>
</pre></div></div><p>

I wonder why the screen pointer leads to a crash (on exit) if you let it point to the displayed screen. Also, I wonder if the &quot;screen&quot; pointer becomes obsolete after you use the show_video_bitmap function.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Geoman)</author>
		<pubDate>Sun, 04 Jun 2006 20:59:27 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You should not use the screen pointer if you use show_video_bitmap. Why would you want to do that anyway?</p><div class="quote_container"><div class="title">the allmighty Manual said:</div><div class="quote"><p>
Warning: video memory bitmaps are usually allocated from the same space as the screen bitmap, so they may overlap with it; it is therefore not a good idea to use the global screen at the same time as any surfaces returned by this function.
</p></div></div><p>
This is from the documentation of the create_video_bitmap() function.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (miran)</author>
		<pubDate>Sun, 04 Jun 2006 21:14:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>screen points to a special bitmap for the screen, you cant just change what bitmap is used for the screen by changing screen...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (BAF)</author>
		<pubDate>Sun, 04 Jun 2006 21:31:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I guess I&#39;m nitpicky, but I&#39;d like to know why the old &quot;screen&quot; pointer is still important, even if I only draw to something that was explicitly allocated. By using show_video_bitmap, I would expect that the old pointer becomes irrelevant, because what&#39;s its use after the graphics operations are routed elsewhere ?</p><p>Also, if I&#39;m not allowed to change it (it seems like it), then why is its name something as general as &quot;screen&quot;, instead of something more explicit like &quot;screen_raw&quot; or &quot;screen_memory&quot; or something like that (assuming here that &quot;screen&quot; is used as an entry value to the video memory as a whole) ?</p><p>(imo what&#39;s mentioned sofar is a bit vague -- and it&#39;s a problem in my case, cause I thought there wouldn&#39;t be a problem if I changed &quot;screen&quot;).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Geoman)</author>
		<pubDate>Mon, 05 Jun 2006 05:35:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The screen bitmap is like the main bitmap. In certain system, it holds all the available VRAM for Allegro to use. There, it&#39;s the entirety of the screen. And creating video bitmaps is basically making sub-bitmaps of the screen. On all systems, it holds extra info pertaining to the display. So when you exit the video mode, Allegro will also get bogus data about the display and crash.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kitty Cat)</author>
		<pubDate>Mon, 05 Jun 2006 06:06:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Okay, that&#39;s clear now <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Geoman)</author>
		<pubDate>Mon, 05 Jun 2006 15:57:36 +0000</pubDate>
	</item>
</rss>
