<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Screen Update API: final draft</title>
		<link>http://www.allegro.cc/forums/view/395441</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sat, 28 Aug 2004 03:46:18 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
<b>EDIT: See posts below for the latest attached update</b></p><p>Keen observers may have seen <a href="http://www.allegro.cc/resource/resource-view.php?id=85">this</a> already. I want to submit my screen update API too, so I gave it a quick once-over and added some new functionality, and made it as C friendly as I can. I&#39;d like the code checked over before I formally submit it though, since it&#39;s longer (and the possibility that I missed a bug has thus gone up), but especially since I want to make sure it&#39;s okay for use in C programs (and for the life of me, I can&#39;t get my makefile to compile C source to check for myself). I&#39;m pretty sure some sort of extern C should be in there somewhere, but I forget what and where. <img src="http://www.allegro.cc/forums/smileys/embarassed.gif" alt=":-[" /></p><p>The source is pretty condensed; less than 300 lines of code total across 3 files (implementation .cpp, declaration .h, and the main .cpp example program). Just for kicks, I also set the color depth and default update method using a config file, if that sort of idea appeals to you.</p><p>Thanks for your time.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Sun, 15 Aug 2004 11:32:00 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Looking good!</p><p>But change the BOOL type to char to make it work with C.</p><p><img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Richard Phipps)</author>
		<pubDate>Sun, 15 Aug 2004 11:55:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
You mean the waitforvsync variable? Good point. I changed the updatemethod variable to char too, just because. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /> Also, I assume // comments are okay? And what about extern C; do I still have to do that somewhere? I expected more feedback. <img src="http://www.allegro.cc/forums/smileys/sad.gif" alt=":(" /> Thanks for checking it, RP.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Sun, 15 Aug 2004 18:38:34 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
// comments were adopted as part of the c99 standed (I think), anyway I use them and they are ok.</p><p>Sunday is always a bit quiet.. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Richard Phipps)</author>
		<pubDate>Sun, 15 Aug 2004 18:49:34 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Here is my own screen update API, complete with support for DRS (with a very fast clever system that avoids blitting of the same area twice without using rectangle combining/splitting) as well as all the traditional methods for screen updating, along with a little DRS demo.</p><p>EDIT:</p><p>I forgot to say that it also includes support for writing balanced game loops (the known algorithm in the Allegro FAQ), and that it is 283 lines of code, non-condensed, containing comments for Doc++ (you can find the reference at doc/index.htm).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (axilmar)</author>
		<pubDate>Sun, 15 Aug 2004 19:25:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>axilmar: bad puppy. If you want to present your api, create your own thread. Stop that BAFism now.</p><p>23: You should check if cplusplpus is not defined:
</p><div class="source-code snippet"><div class="inner"><pre><span class="p">#ifndef __cplusplus</span>
    <span class="k1">extern</span> <span class="s">"C"</span> <span class="k2">{</span>
<span class="p">#endif</span>

<span class="c">// ...</span>

<span class="p">#ifndef __cplusplus</span>
    <span class="k2">}</span>
<span class="p">#endif</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (spellcaster)</author>
		<pubDate>Sun, 15 Aug 2004 19:32:51 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Right; that. So I should change the header to this?</p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td>&#160;</td></tr><tr><td class="number">2</td><td><span class="p">#define TRIPLEBUFFER 1</span></td></tr><tr><td class="number">3</td><td><span class="p">#define PAGEFLIP     2</span></td></tr><tr><td class="number">4</td><td><span class="p">#define SYSTEMBUFFER 3</span></td></tr><tr><td class="number">5</td><td><span class="p">#define DOUBLEBUFFER 4</span></td></tr><tr><td class="number">6</td><td>&#160;</td></tr><tr><td class="number">7</td><td><span class="p">#ifndef __cplusplus</span></td></tr><tr><td class="number">8</td><td>    <span class="k1">extern</span> <span class="s">"C"</span> <span class="k2">{</span></td></tr><tr><td class="number">9</td><td><span class="p">#endif</span></td></tr><tr><td class="number">10</td><td>     </td></tr><tr><td class="number">11</td><td><span class="k1">char</span>    InitializeScreenUpdate<span class="k2">(</span><span class="k1">char</span> i<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">12</td><td><span class="k1">void</span>    UpdateScreen<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">13</td><td><a href="http://www.allegro.cc/manual/BITMAP" target="_blank"><span class="a">BITMAP</span></a><span class="k3">*</span> GetBuffer<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">14</td><td><span class="k1">void</span>    EnableVSync<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">15</td><td><span class="k1">void</span>    DisableVSync<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">16</td><td><span class="k1">char</span>    GetUpdateMethod<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">17</td><td><span class="k1">void</span>    ShutDownScreenUpdate<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">18</td><td>     </td></tr><tr><td class="number">19</td><td><span class="p">#ifndef __cplusplus</span></td></tr><tr><td class="number">20</td><td>    <span class="k2">}</span></td></tr><tr><td class="number">21</td><td><span class="p">#endif</span></td></tr></tbody></table></div></div><p>

And if the implementation file is a .cpp file (as it is now), that&#39;s not necessary, is it? If it&#39;s changed to a .c file, that&#39;s needed? I can&#39;t get my makefile to compile .c files so I can&#39;t check. <img src="http://www.allegro.cc/forums/smileys/sad.gif" alt=":(" /></p><p>axilmar makes a good point, that my API has no DRS. But a DRS can be built on top of it easily enough. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /> I have no need for a DRS personally.</p><p>Here&#39;s my makefile:</p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td><span class="p"># Generic Makefile.</span></td></tr><tr><td class="number">2</td><td>TEMP   <span class="k3">=</span> $<span class="k2">(</span>wildcard <span class="k3">*</span>.cpp, <span class="k3">*</span>.c<span class="k2">)</span></td></tr><tr><td class="number">3</td><td>FILES  <span class="k3">=</span> $<span class="k2">(</span><span class="k1">if</span> $<span class="k2">(</span>TEMP<span class="k2">)</span>, $<span class="k2">(</span>TEMP<span class="k2">)</span>, $<span class="k2">(</span>error No source code found<span class="k3">!</span><span class="k2">)</span><span class="k2">)</span></td></tr><tr><td class="number">4</td><td>OBJS   <span class="k3">=</span> $<span class="k2">(</span>addsuffix .o, $<span class="k2">(</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_58.html" target="_blank">basename</a> $<span class="k2">(</span>FILES<span class="k2">)</span><span class="k2">)</span><span class="k2">)</span></td></tr><tr><td class="number">5</td><td>&#160;</td></tr><tr><td class="number">6</td><td><span class="p"># binary name</span></td></tr><tr><td class="number">7</td><td>BINARY <span class="k3">=</span> ScreenUpdate.exe</td></tr><tr><td class="number">8</td><td>&#160;</td></tr><tr><td class="number">9</td><td><span class="p"># compiler flags</span></td></tr><tr><td class="number">10</td><td>FLAGS  <span class="k3">=</span> <span class="k3">-</span>Wall <span class="k3">-</span>O2 <span class="k3">-</span>s  <span class="k3">-</span>ffast-math <span class="k3">-</span>fomit-frame-pointer <span class="k3">-</span>funroll-loops</td></tr><tr><td class="number">11</td><td>&#160;</td></tr><tr><td class="number">12</td><td><span class="p"># main rule; compiles and links everything</span></td></tr><tr><td class="number">13</td><td>$<span class="k2">(</span>BINARY<span class="k2">)</span> <span class="k2">:</span> $<span class="k2">(</span>OBJS<span class="k2">)</span></td></tr><tr><td class="number">14</td><td>  $<span class="k2">(</span>CXX<span class="k2">)</span> <span class="k3">-</span>o $<span class="k2">(</span>BINARY<span class="k2">)</span> $<span class="k2">(</span>OBJS<span class="k2">)</span> $<span class="k2">(</span>FLAGS<span class="k2">)</span> <span class="k3">-</span>mwindows <span class="k3">-</span>lalleg</td></tr><tr><td class="number">15</td><td>&#160;</td></tr><tr><td class="number">16</td><td><span class="p"># compiles all .cpp files, recompiles all if a header has changed,</span></td></tr><tr><td class="number">17</td><td><span class="p"># and redirects errors to a log (if need be)</span></td></tr><tr><td class="number">18</td><td>%.o <span class="k2">:</span> %.cpp <span class="k3">*</span>.h</td></tr><tr><td class="number">19</td><td>  $<span class="k2">(</span>CXX<span class="k2">)</span> <span class="k3">-</span>o $@ <span class="k3">-</span>c $<span class="k3">&lt;</span></td></tr></tbody></table></div></div><p>

Here&#39;s my error:</p><div class="source-code snippet"><div class="inner"><pre>   <span class="k3">&gt;</span>make
   cc    <span class="k3">-</span>c <span class="k3">-</span>o screen.o screen.c
   process_begin: CreateProcess<span class="k2">(</span><span class="k2">(</span>null<span class="k2">)</span>, cc <span class="k3">-</span>c <span class="k3">-</span>o screen.o screen.c, ...<span class="k2">)</span> failed.
   make <span class="k2">(</span>e<span class="k3">=</span><span class="n">2</span><span class="k2">)</span><span class="k2">:</span> The <a href="http://www.delorie.com/djgpp/doc/libc/libc_802.html" target="_blank">system</a> cannot find the file specified.

   make: <span class="k3">*</span><span class="k3">*</span><span class="k3">*</span> <span class="k2">[</span>screen.o<span class="k2">]</span> Error <span class="n">2</span>
   <span class="k3">&gt;</span>Exit code: <span class="n">2</span>
</pre></div></div><p>
Anyone help me?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Sun, 15 Aug 2004 19:47:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>%.o : %.cpp *.h</p></div></div><p>
Change to:
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>%.o : %.c *.h</p></div></div><p>
?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Richard Phipps)</author>
		<pubDate>Sun, 15 Aug 2004 20:09:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">here&#39;s my error said:</div><div class="quote"><p>
&gt;make   cc    -c -o screen.o screen.c   process_begin: CreateProcess((null), cc -c -o screen.o screen.c, ...) failed.   make (e=2): The system cannot find the file specified.   make: *** [screen.o] Error 2   &gt;Exit code: 2
</p></div></div><p>

1. are all your files cpp sources or is there c source ones too?<br />2. im guessing you are using mingw, so set the variable CXX=g++ and CC=gcc, because it seems as if make is having trouble running cc.exe also it might help to echo out the variables like echo $(CXX) to see what file it is pointing to. you usually get the create proccess error when make can&#39;t find a file.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (flares)</author>
		<pubDate>Sun, 15 Aug 2004 20:10:52 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If you want to be able to compile .c and .cpp files in a same project, just have this in your makefile:</p><div class="source-code snippet"><div class="inner"><pre>$<span class="k2">(</span>OBJ_DIR<span class="k2">)</span><span class="k3">/</span>%.o: src<span class="k3">/</span>%.cpp
  g<span class="k3">+</span><span class="k3">+</span> $<span class="k2">(</span>CFLAGS<span class="k2">)</span> <span class="k3">-</span>o $@ <span class="k3">-</span>c $<span class="k3">&lt;</span>

$<span class="k2">(</span>OBJ_DIR<span class="k2">)</span><span class="k3">/</span>%.o: src<span class="k3">/</span>%.c
  gcc $<span class="k2">(</span>CFLAGS<span class="k2">)</span> <span class="k3">-</span>o $@ <span class="k3">-</span>c $<span class="k3">&lt;</span>
</pre></div></div><p>

works for me <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Oscar Giner)</author>
		<pubDate>Sun, 15 Aug 2004 21:10:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Same error; sorry. <img src="http://www.allegro.cc/forums/smileys/sad.gif" alt=":(" /> Maybe I just don&#39;t have cc.exe ... or gcc ... or something ...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Sun, 15 Aug 2004 21:25:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>/me sees the following:</p><div class="source-code snippet"><div class="inner"><pre><span class="p">#define TRIPLEBUFFER 1</span>
<span class="p">#define PAGEFLIP     2</span>
<span class="p">#define SYSTEMBUFFER 3</span>
<span class="p">#define DOUBLEBUFFER 4</span>
</pre></div></div><p>
&lt;C0CKS SHOTGUN&gt;<br />Try this before I blow your brains out:</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">enum</span> <span class="k2">{</span>
        TRIPLEBUFFER <span class="k3">=</span> <span class="n">1</span>,
        PAGEFLIP     <span class="k3">=</span> <span class="n">2</span>,
        SYSTEMBUFFER <span class="k3">=</span> <span class="n">3</span>,
        DOUBLEBUFFER <span class="k3">=</span> <span class="n">4</span>
<span class="k2">}</span><span class="k2">;</span>
</pre></div></div><p>

After that, I&#39;m going after Matthew and his censorship filter.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rash)</author>
		<pubDate>Sun, 15 Aug 2004 21:36:52 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Yeah, I considered that. Just didn&#39;t think it was a big issue; I thought everyone here loved #define. <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" /></p><p>I&#39;d make it this though ...</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">enum</span> <span class="k2">{</span>
        NOUPDATEMETHOD <span class="k3">=</span> <span class="n">0</span>,
        TRIPLEBUFFER   <span class="k3">=</span> <span class="n">1</span>,
        PAGEFLIP       <span class="k3">=</span> <span class="n">2</span>,
        SYSTEMBUFFER   <span class="k3">=</span> <span class="n">3</span>,
        DOUBLEBUFFER   <span class="k3">=</span> <span class="n">4</span>
<span class="k2">}</span><span class="k2">;</span>
</pre></div></div><p>

... because the invalid method is handy in screen.cpp.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Sun, 15 Aug 2004 21:39:30 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You might as well drop the values then as you&#39;re not using them.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rash)</author>
		<pubDate>Sun, 15 Aug 2004 21:42:10 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Yeah, I considered that. Just didn&#39;t think it was a big issue;</p></div></div><p>
It isn&#39;t a big issue. But you shouldn&#39;t use defines for constant values.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (spellcaster)</author>
		<pubDate>Sun, 15 Aug 2004 21:46:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>All hail Barry, King of the Kode! <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" /><img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" /><img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /></p><p>Nice work 23, this resource will prove useful to many.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Gnatinator)</author>
		<pubDate>Sun, 15 Aug 2004 22:08:00 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>23, define CXX as <i>g++</i>, by default it seems to be set to <i>cc</i>, which is a very old name of the GCC compiler (<i>CXX = g++</i> at the begining of your makefile), as said above. If it stills triggers CXX, then use GCC instead of CXX, or just hardcode the compiler as Oscar suggested.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (ReyBrujo)</author>
		<pubDate>Sun, 15 Aug 2004 22:28:51 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
RB: No good. <img src="http://www.allegro.cc/forums/smileys/sad.gif" alt=":(" /></p><p>Okay, here&#39;s draft 2. The screen.cpp file is now a .c file, and I&#39;m including no makefile, so if you can&#39;t compile it without error yourself, tell me why. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><p>If the code is all good, the subject of naming conventions may be introduced ...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Sun, 15 Aug 2004 22:31:10 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ok, got the error. The problem is this rule:</p><pre>%.o : %.cpp *.h
    $(CXX) -o $@ -c $&lt;</pre><p>

Note that it tells how to compile cpp files, but you have c files, so the compiler goes to the implicit default rule for c files (which is legacy, using cc for compiling). So, change that rule to:</p><pre>%.o : %.c *.h
    $(CXX) -o $@ -c $&lt; $(CFLAGS)</pre><p>

And should work.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (ReyBrujo)</author>
		<pubDate>Sun, 15 Aug 2004 22:35:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Hooray!</p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td>&#160;</td></tr><tr><td class="number">2</td><td><span class="p"># Generic Makefile.</span></td></tr><tr><td class="number">3</td><td>TEMP   <span class="k3">=</span> $<span class="k2">(</span>wildcard <span class="k3">*</span>.cpp <span class="k3">*</span>.c<span class="k2">)</span></td></tr><tr><td class="number">4</td><td>FILES  <span class="k3">=</span> $<span class="k2">(</span><span class="k1">if</span> $<span class="k2">(</span>TEMP<span class="k2">)</span>, $<span class="k2">(</span>TEMP<span class="k2">)</span>, $<span class="k2">(</span>error No source code found<span class="k3">!</span><span class="k2">)</span><span class="k2">)</span></td></tr><tr><td class="number">5</td><td>OBJS   <span class="k3">=</span> $<span class="k2">(</span>addsuffix .o, $<span class="k2">(</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_58.html" target="_blank">basename</a> $<span class="k2">(</span>FILES<span class="k2">)</span><span class="k2">)</span><span class="k2">)</span></td></tr><tr><td class="number">6</td><td>&#160;</td></tr><tr><td class="number">7</td><td><span class="p"># binary name</span></td></tr><tr><td class="number">8</td><td>BINARY <span class="k3">=</span> ScreenUpdate.exe</td></tr><tr><td class="number">9</td><td>&#160;</td></tr><tr><td class="number">10</td><td><span class="p"># compiler flags</span></td></tr><tr><td class="number">11</td><td>FLAGS  <span class="k3">=</span> <span class="k3">-</span>Wall <span class="k3">-</span>O2 <span class="k3">-</span>s  <span class="k3">-</span>ffast-math <span class="k3">-</span>fomit-frame-pointer <span class="k3">-</span>funroll-loops</td></tr><tr><td class="number">12</td><td>&#160;</td></tr><tr><td class="number">13</td><td><span class="p"># main rule; compiles and links everything</span></td></tr><tr><td class="number">14</td><td>$<span class="k2">(</span>BINARY<span class="k2">)</span> <span class="k2">:</span> $<span class="k2">(</span>OBJS<span class="k2">)</span></td></tr><tr><td class="number">15</td><td>  $<span class="k2">(</span>CXX<span class="k2">)</span> <span class="k3">-</span>o $<span class="k2">(</span>BINARY<span class="k2">)</span> $<span class="k2">(</span>OBJS<span class="k2">)</span> $<span class="k2">(</span>FLAGS<span class="k2">)</span> <span class="k3">-</span>mwindows <span class="k3">-</span>lalleg</td></tr><tr><td class="number">16</td><td>&#160;</td></tr><tr><td class="number">17</td><td><span class="p"># compiles all .cpp files, recompiles all if a header has changed,</span></td></tr><tr><td class="number">18</td><td><span class="p"># and redirects errors to a log (if need be)</span></td></tr><tr><td class="number">19</td><td>%.o <span class="k2">:</span> %.c <span class="k3">*</span>.h</td></tr><tr><td class="number">20</td><td>  $<span class="k2">(</span>CXX<span class="k2">)</span> <span class="k3">-</span>o $@ <span class="k3">-</span>c $<span class="k3">&lt;</span> $<span class="k2">(</span>CFLAGS<span class="k2">)</span></td></tr></tbody></table></div></div><p>

That did it. main.cpp and screen.c compile and link perfectly; thanks.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Sun, 15 Aug 2004 22:39:53 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I would use some different makefile, that creates a library and/or the example, like:</p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td>LIBSRCS <span class="k3">=</span> screen.c</td></tr><tr><td class="number">2</td><td>LIBOBJS <span class="k3">=</span> $<span class="k2">(</span>addsuffix .o, $<span class="k2">(</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_58.html" target="_blank">basename</a> $<span class="k2">(</span>LIBSRCS<span class="k2">)</span><span class="k2">)</span><span class="k2">)</span></td></tr><tr><td class="number">3</td><td>LIBNAME <span class="k3">=</span> libscr.a</td></tr><tr><td class="number">4</td><td>&#160;</td></tr><tr><td class="number">5</td><td>EXASRCS <span class="k3">=</span> main.cpp</td></tr><tr><td class="number">6</td><td>EXAOBJS <span class="k3">=</span> $<span class="k2">(</span>addsuffix .o, $<span class="k2">(</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_58.html" target="_blank">basename</a> $<span class="k2">(</span>EXASRCS<span class="k2">)</span><span class="k2">)</span><span class="k2">)</span></td></tr><tr><td class="number">7</td><td>EXANAME <span class="k3">=</span> ScreenUpdate.exe</td></tr><tr><td class="number">8</td><td>&#160;</td></tr><tr><td class="number">9</td><td>CFLAGS  <span class="k3">=</span> <span class="k3">-</span>Wall <span class="k3">-</span>O2 <span class="k3">-</span>s <span class="k3">-</span>ffast-math <span class="k3">-</span>fomit-frame-pointer <span class="k3">-</span>funroll-loops</td></tr><tr><td class="number">10</td><td>&#160;</td></tr><tr><td class="number">11</td><td>all <span class="k2">:</span> library example</td></tr><tr><td class="number">12</td><td>&#160;</td></tr><tr><td class="number">13</td><td>library <span class="k2">:</span> $<span class="k2">(</span>LIBNAME<span class="k2">)</span></td></tr><tr><td class="number">14</td><td>&#160;</td></tr><tr><td class="number">15</td><td>example <span class="k2">:</span> $<span class="k2">(</span>LIBNAME<span class="k2">)</span> $<span class="k2">(</span>EXANAME<span class="k2">)</span></td></tr><tr><td class="number">16</td><td>&#160;</td></tr><tr><td class="number">17</td><td>$<span class="k2">(</span>LIBNAME<span class="k2">)</span> <span class="k2">:</span> $<span class="k2">(</span>LIBOBJS<span class="k2">)</span></td></tr><tr><td class="number">18</td><td>  ar ru $@ $<span class="k3">&lt;</span></td></tr><tr><td class="number">19</td><td>  ranlib $@</td></tr><tr><td class="number">20</td><td>&#160;</td></tr><tr><td class="number">21</td><td>$<span class="k2">(</span>EXANAME<span class="k2">)</span> <span class="k2">:</span> $<span class="k2">(</span>EXAOBJS<span class="k2">)</span></td></tr><tr><td class="number">22</td><td>  $<span class="k2">(</span>CXX<span class="k2">)</span> <span class="k3">-</span>o $@ $<span class="k2">(</span>EXAOBJS<span class="k2">)</span> $<span class="k2">(</span>CFLAGS<span class="k2">)</span> <span class="k3">-</span>mwindows $<span class="k2">(</span>LIBNAME<span class="k2">)</span> <span class="k3">-</span>lalleg</td></tr><tr><td class="number">23</td><td>&#160;</td></tr><tr><td class="number">24</td><td>%.o <span class="k2">:</span> %.c <span class="k3">*</span>.h</td></tr><tr><td class="number">25</td><td>  $<span class="k2">(</span>CXX<span class="k2">)</span> <span class="k3">-</span>o $@ <span class="k3">-</span>c $<span class="k3">&lt;</span> $<span class="k2">(</span>CFLAGS<span class="k2">)</span></td></tr><tr><td class="number">26</td><td>&#160;</td></tr><tr><td class="number">27</td><td>%.o <span class="k2">:</span> %.cpp <span class="k3">*</span>.h</td></tr><tr><td class="number">28</td><td>  $<span class="k2">(</span>CXX<span class="k2">)</span> <span class="k3">-</span>o $@ <span class="k3">-</span>c $<span class="k3">&lt;</span> $<span class="k2">(</span>CFLAGS<span class="k2">)</span></td></tr></tbody></table></div></div><p>

Also, my mistake in your previous makefile: Use all <i>FLAGS</i> or all <i>CFLAGS</i>, otherwise it would compile and link with different flags. Convention says you should use CFLAGS for C and CXXFLAGS for C++, but in this case it is up to you.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (ReyBrujo)</author>
		<pubDate>Sun, 15 Aug 2004 22:50:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>axilmar: bad puppy. If you want to present your api, create your own thread. Stop that BAFism now.</p></div></div><p>

Ok, if that&#39;s the proper way.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (axilmar)</author>
		<pubDate>Mon, 16 Aug 2004 01:18:05 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>o_O there is competiton today of screen updaters <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" />  I would post mine... but nah.  Anyway my question is what is the advantage/reason for using enum instead of #define?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Steve Terry)</author>
		<pubDate>Mon, 16 Aug 2004 05:08:47 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>..edit..</p><p>Oh, and it just looks cooler to boot <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kanzure)</author>
		<pubDate>Mon, 16 Aug 2004 05:25:18 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>#define is pre processor based. they get replaced inline with the values before the compiler even gets the code.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Mon, 16 Aug 2004 05:28:11 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
..edit..
</p></div></div><p>
You should think more before posting; too many edits to save your donkey, lately <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Oscar Giner)</author>
		<pubDate>Mon, 16 Aug 2004 05:47:34 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Uhm that still doesn&#39;t answer it... other than what I already knew about #define...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Steve Terry)</author>
		<pubDate>Mon, 16 Aug 2004 06:02:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>With defines your error messages often won&#39;t match you code.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Mars)</author>
		<pubDate>Mon, 16 Aug 2004 19:48:18 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Pfft I NEVER get errors <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Steve Terry)</author>
		<pubDate>Mon, 16 Aug 2004 20:48:35 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> Anyway my question is what is the advantage/reason for using enum instead of #define?</p></div></div><p>

It&#39;s mainly a style question. It also allows you to see the name of the constant instead of it&#39;s name in case of any errors. Another reason is that  if you use enums, you have a better compile time control.</p><p>If you use defines, your constants could change values (by using defines and undefs).</p><p>But mainly style. The discussion started as part of the C vs C++ vars.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (spellcaster)</author>
		<pubDate>Tue, 17 Aug 2004 01:20:29 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It&#39;s not mainly style! Macros can silently change the behavior of your program without the compiler giving a peep!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rash)</author>
		<pubDate>Tue, 17 Aug 2004 01:55:50 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The API should be consistant with Allegro&#39;s if you want it to be considered an &quot;add-on&quot; lib. (Ie, underscores instead of MixedCaps.)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Tue, 17 Aug 2004 03:06:54 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Yup; that was the first thing that occured to me. Just curious if anyone else had any ideas ...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Tue, 17 Aug 2004 03:14:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
The only thing I can think of is a change_update function which acts as a wrapper around the shutdown and the setup update functions. It would only take 4 lines, but I use something similar..
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Richard Phipps)</author>
		<pubDate>Tue, 17 Aug 2004 03:18:47 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Hmmm. It&#39;s true that it&#39;s trivial ... I wouldn&#39;t have to worry about video bitmaps getting destroyed or any crap like that, would I?</p><p>Nah. Just make the end user call two functions instead of one. <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Tue, 17 Aug 2004 03:27:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Don&#39;t you have the option to change the screen update system ingame in TMS?</p><p>I don&#39;t think it&#39;s trivial, when you have a function to toggle the vsync variable, or return it. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Richard Phipps)</author>
		<pubDate>Tue, 17 Aug 2004 03:29:34 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Don&#39;t you have the option to change the screen update system ingame in TMS?</p></div></div><p>

Sure, and then you restart, and forget the option ever existed. It&#39;s not like you have to switch between update methods 20 times per game or something. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /></p><p>The vsync setup is mostly for testing. Besides, since the waitforvsync variable is static, I really have no choice there. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Tue, 17 Aug 2004 03:37:00 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Well it&#39;s up to you, people would only use it once in a program, but I personally would include it. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Richard Phipps)</author>
		<pubDate>Tue, 17 Aug 2004 03:40:25 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Looks good Chris (from what I saw in the headerfile at least)!<br />Depending on what is going to happen with Allegro&#39;s GFX API in the near future, I&#39;d say this could be merged with Allegro rather than being offered as an add-on.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Tue, 17 Aug 2004 22:53:34 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Okay, here&#39;s the final version AFAIAC. I&#39;ve added support for triple buffering and page flipping with a memory bitmap buffer, for those who might be reading from said buffer and don&#39;t want it to be a video bitmap. If triple buffering fails, it tries for page flipping. If triple buffering with a buffer fails, it tries for page flipping with a buffer. If either page flipping setup fails, it tries for system buffering, and then double buffering. I had to change the internals a bit to make that work, but I don&#39;t think I introduced any bugs. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><p>Also, I switched to allegro_naming_conventions.</p><p>I guess that&#39;s that then. Anything else? <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Fri, 20 Aug 2004 06:31:57 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Again, looks good. I&#39;ll forward this to AD to see if we want it included. This depends on where we want to go with the graphics API I guess...</p><p>Some nitpicking in case it is merged with Allegro (not saying I have issues with your coding style, just pointing out where Allegro&#39;s conventions differ).<br />I won&#39;t comment on indentation and other source layout issues because those are not as important unless it actually is included.</p><div class="source-code snippet"><div class="inner"><pre><span class="p">#ifndef __cplusplus</span>
  <span class="k1">extern</span> <span class="s">"C"</span> <span class="k2">{</span>
<span class="p">#endif</span>
</pre></div></div><p>
That actually is an error. It should be #ifdef __cplusplus</p><p><span class="source-code"><span class="k1">enum</span> <span class="k2">{</span></span><br />I think that&#39;d have to be changed to use #defines. Maybe change the names too.</p><p><span class="source-code"><span class="k1">char</span>    initialize_screen_updating<span class="k2">(</span><span class="k1">char</span> i<span class="k2">)</span><span class="k2">;</span></span><br />char -&gt; int, in all three functions.</p><p><span class="source-code"><a href="http://www.allegro.cc/manual/alert" target="_blank"><span class="a">alert</span></a><span class="k2">(</span><span class="s">"Well ... crap!"</span>, NULL, NULL, <span class="s">"dsjkd"</span>, <span class="s">"sdkffd"</span>, <span class="n">1</span>, <span class="n">1</span><span class="k2">)</span><span class="k2">;</span></span><br /><img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /><br />Well, a popup box when a function fails is evil. It should probably also return NOUPDATEMETHOD on error. Better yet, in your code you could use a named emum instead of int for the return or argument type.</p><p><span class="source-code"><span class="k1">if</span><span class="k2">(</span>active_page<span class="k2">)</span> active_page <span class="k3">=</span> EraseBitmap<span class="k2">(</span>active_page<span class="k2">)</span><span class="k2">;</span></span><br />You can lose the if(...) on this one and it&#39;s brethern.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Fri, 20 Aug 2004 11:47:19 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>That actually is an error. It should be #ifdef __cplusplus</p></div></div><p>

Oops. I just copied spellcaster&#39;s post above. <img src="http://www.allegro.cc/forums/smileys/embarassed.gif" alt=":-[" />
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Well, a popup box when a function fails is evil ...</p></div></div><p>

Aw, right. I was having a bit of trouble last night and was trying to get it to tell me why. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /> That shouldn&#39;t still be in there; I&#39;ll remove it ...
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>char -&gt; int, in all three functions.</p></div></div><p>
Does it matter?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Fri, 20 Aug 2004 15:48:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">23 said:</div><div class="quote"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>char -&gt; int, in all three functions.</p></div></div><p>
Does it matter?</p></div></div><p>
It&#39;s cleaner, looks better, and is more CPU friendly. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /> The memory difference is negligible.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kitty Cat)</author>
		<pubDate>Fri, 20 Aug 2004 15:51:07 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Like I said before, there&#39;s no need to set the values explicitly with the enum. Otherwise, it might seem those values are somehow relevant in some way possibly leading to confusion and/or errors:</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">enum</span> <span class="k2">{</span>
        NOUPDATEMETHOD,
        TRIPLEBUFFER,
        PAGEFLIP,
        SYSTEMBUFFER,
        DOUBLEBUFFER,
        TRIPLEBUFFERWMB,
        PAGEFLIPWMB
<span class="k2">}</span><span class="k2">;</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rash)</author>
		<pubDate>Fri, 20 Aug 2004 16:01:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Yeah; I&#39;m just being paranoid, I guess. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /> I&#39;m assuming enum&#39;s are guarenteed to start at 0? If so, I&#39;ll remove that bit ...
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>You can lose the if(...) on this one and it&#39;s brethern.</p></div></div><p>

What happens if I destroy_bitmap() on a NULL pointer?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Fri, 20 Aug 2004 16:15:23 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">the Allegro manual said:</div><div class="quote"><p>
void destroy_bitmap(BITMAP *bitmap);</p><p>Destroys a memory bitmap, sub-bitmap, video memory bitmap, or system bitmap when you are finished with it. <b>If you pass a NULL pointer this function won&#39;t do anything</b>. See above for the restrictions as to when you are allowed to destroy the various types of bitmaps.
</p></div></div><p>
Emphasis mine.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rash)</author>
		<pubDate>Fri, 20 Aug 2004 16:21:11 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Okay, I fixed everything but changing the enum back to defines. Rash said he&#39;d blow my brains out above. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><p>Anything else?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Sat, 21 Aug 2004 05:27:29 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yes, add a dummy value at the end of the enum and use that for comparison. Makes the code clearer and less error prone.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rash)</author>
		<pubDate>Sat, 21 Aug 2004 05:32:23 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Could you be a little clearer? Comparing what?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Sat, 21 Aug 2004 05:33:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Something like this:
</p><div class="source-code snippet"><div class="inner"><pre><span class="c">// in screen.h</span>
<span class="k1">enum</span> <span class="k2">{</span>
        NOUPDATEMETHOD,
        TRIPLEBUFFER,
        PAGEFLIP,
        SYSTEMBUFFER,
        DOUBLEBUFFER,
        TRIPLEBUFFERWMB,
        PAGEFLIPWMB,
        LASTVALUE
<span class="k2">}</span><span class="k2">;</span>
<span class="c">// in screen.c</span>
<span class="k1">if</span><span class="k2">(</span>i <span class="k3">&lt;</span><span class="k3">=</span> NOUPDATEMETHOD <span class="k3">|</span><span class="k3">|</span> i <span class="k3">&gt;</span><span class="k3">=</span> LASTVALUE<span class="k2">)</span> i <span class="k3">=</span> TRIPLEBUFFER<span class="k2">;</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rash)</author>
		<pubDate>Sat, 21 Aug 2004 05:41:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
I guess it&#39;s worth the effort. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /> Last attachment updated.</p><p>Anything else?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Sat, 21 Aug 2004 05:45:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>A couple of style issues:</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">do</span> <span class="k2">{</span> <span class="k2">}</span> <span class="k1">while</span> <span class="k2">(</span><a href="http://www.allegro.cc/manual/poll_scroll" target="_blank"><span class="a">poll_scroll</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>Is this deliberately chosen instead of just a while statement?</p><div class="source-code snippet"><div class="inner"><pre>active_page <span class="k3">=</span> active_page <span class="k3">=</span><span class="k3">=</span> pages<span class="k2">[</span><span class="n">0</span><span class="k2">]</span> ? pages<span class="k2">[</span><span class="n">1</span><span class="k2">]</span> <span class="k2">:</span> pages<span class="k2">[</span><span class="n">0</span><span class="k2">]</span><span class="k2">;</span>
buffer <span class="k3">=</span> active_page <span class="k3">=</span> active_page <span class="k3">=</span><span class="k3">=</span> pages<span class="k2">[</span><span class="n">0</span><span class="k2">]</span> ? pages<span class="k2">[</span><span class="n">1</span><span class="k2">]</span> <span class="k2">:</span> pages<span class="k2">[</span><span class="n">0</span><span class="k2">]</span><span class="k2">;</span>
</pre></div></div><p>I would have put the RHS between parentheses.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rash)</author>
		<pubDate>Sat, 21 Aug 2004 05:56:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
That while (poll_scroll()); with just a terminator at the end always looks suspicious to me. <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" /> Sorry; that&#39;s just me. I implemented both style suggestions, even thought the RHS evaluates just fine (I guess it&#39;s clearer now). Updated attachment.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Sat, 21 Aug 2004 06:03:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Actually I was looking for the parentheses being put around the assigned expressions instead. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rash)</author>
		<pubDate>Sat, 21 Aug 2004 06:06:39 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
... Why?</p><p>Also, I caught a bug; destroying all the bitmaps like that in shutdown_screen_updating() is a bad move because buffer and active_page could be pointing at the same bitmap. Calling destroy_bitmap() on both would be bad, yes? Fixed up.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Sat, 21 Aug 2004 06:09:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
... Why?
</p></div></div><p>
The way I see it, you would want to draw attention to the fact that the statement is in fact an assignment.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Also, I caught a bug; destroying all the bitmaps like that in shutdown_screen_updating() is a bad move because buffer and active_page could be pointing at the same bitmap. Calling destroy_bitmap() on both would be bad, yes?
</p></div></div><p>
Just like calling delete or free twice on the same value.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rash)</author>
		<pubDate>Sat, 21 Aug 2004 06:15:43 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If you are assuming the first update method is 0, I&#39;d suggest for clarity, simply explicitly setting the first item in the enum:
</p><div class="source-code snippet"><div class="inner"><pre>
<span class="k1">enum</span> <span class="k2">{</span>
        NOUPDATEMETHOD <span class="k3">=</span> <span class="n">0</span>,
        TRIPLEBUFFER,
        PAGEFLIP,
        SYSTEMBUFFER,
        DOUBLEBUFFER,
        TRIPLEBUFFERWMB,
        PAGEFLIPWMB,
        LASTVALUE
<span class="k2">}</span><span class="k2">;</span>
</pre></div></div><p>

And personally I&#39;d add underscores in those, cause they&#39;re kinda hard to read.  Or in this case, since they&#39;re global constants, perhaps:
</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">enum</span> <span class="k2">{</span>
        UPDATE_NONE <span class="k3">=</span> <span class="n">0</span>,
        UPDATE_DOUBLE_BUFFER, <span class="c">// Or take out _BUFFER?</span>
        UPDATE_TRIPLE_BUFFER,
        UPDATE_PAGE_FLIP,
        UPDATE_SYSTEM_BUFFER,
        UPDATE_TRIPLE_WMB,    <span class="c">// WMB is a bit odd... maybe MEM or MEMORY instead</span>
        UPDATE_PAGEFLIP_WMB,
        UPDATE_MAX            <span class="c">// this is just personal style for me when doing enums</span>
<span class="k2">}</span><span class="k2">;</span>
</pre></div></div><p>

Marcello
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Marcello)</author>
		<pubDate>Sat, 21 Aug 2004 06:25:55 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>do { } while (poll_scroll());<br />Is this deliberately chosen instead of just a while statement?</p></div></div><p>
Allegro tends to use
</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">do</span> <span class="k2">{</span>
<span class="k2">}</span> <span class="k1">while</span> <span class="k2">(</span>...<span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>though I personalyl prefer doing
</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">while</span><span class="k2">(</span>...<span class="k2">)</span>
   <span class="k2">;</span>
</pre></div></div><p>Personal preference, though.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>active_page = active_page == pages[0] ? pages[1] : pages[0];<br />buffer = active_page = active_page == pages[0] ? pages[1] : pages[0];</p></div></div><p>
And I thought *ptr++ was bad. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /> I&#39;d clarrify that to:
</p><div class="source-code snippet"><div class="inner"><pre>active_page <span class="k3">=</span> <span class="k2">(</span><span class="k2">(</span>active_page <span class="k3">=</span><span class="k3">=</span> pages<span class="k2">[</span><span class="n">0</span><span class="k2">]</span><span class="k2">)</span> ? pages<span class="k2">[</span><span class="n">1</span><span class="k2">]</span> <span class="k2">:</span> pages<span class="k2">[</span><span class="n">0</span><span class="k2">]</span><span class="k2">)</span><span class="k2">;</span>
buffer <span class="k3">=</span> active_page <span class="k3">=</span> <span class="k2">(</span><span class="k2">(</span>active_page <span class="k3">=</span><span class="k3">=</span> pages<span class="k2">[</span><span class="n">0</span><span class="k2">]</span><span class="k2">)</span> ? pages<span class="k2">[</span><span class="n">1</span><span class="k2">]</span> <span class="k2">:</span> pages<span class="k2">[</span><span class="n">0</span><span class="k2">]</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>The ?: operators are generally quite anal when it comes to operator precedence, so I prefer to leave little room for errors (I would even put parenthesis around the two &quot;return&quot; values, though when it&#39;s just a single word like that I usually omit it).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kitty Cat)</author>
		<pubDate>Sat, 21 Aug 2004 06:41:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
I like Marcello&#39;s enum name suggestions. I&#39;m gonna keep the WMB (With Memory Buffer) though.</p><p>New update; you can now toggle vsync by pressing 2, and cycle through screen update methods by pressing 1 (that&#39;s a change to the example code, not the API). Calling the initialization function now let&#39;s you switch update methods with a single function call (it calls the shutdown function internally if there&#39;s already an update method in operation). Also streamlined main.cpp a bit and added more comments. I think it&#39;s bulletproof now ...</p><p>EDIT: Oddly, Double Buffering is twice as fast as System Buffering for me. I thought the latter was supposed to be faster ... maybe I should omit it?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Sat, 21 Aug 2004 06:45:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;m a bit skeptical about the idea of falling back to triple buffering in case an illegal value is supplied by the user. I guess it depends on whether you&#39;re &quot;defensively&quot; or &quot;offensively&quot; minded programming wise.</p><p>How about implementing dirty rectangles too? <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rash)</author>
		<pubDate>Sat, 21 Aug 2004 21:47:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>EDIT: Oddly, Double Buffering is twice as fast as System Buffering for me. I thought the latter was supposed to be faster ... maybe I should omit it?</p></div></div><p>

Maybe, maybe not. I know that for me, page flipping nets worse results both in terms of tearing and flicker than double buffering does. (Disclaimer: I didn&#39;t write the programs referred to here. They might have used some dodgy methods.)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (X-G)</author>
		<pubDate>Sat, 21 Aug 2004 21:49:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>I&#39;m a bit skeptical about the idea of falling back to triple buffering in case an illegal value is supplied by the user. I guess it depends on whether you&#39;re &quot;defensively&quot; or &quot;offensively&quot; minded programming wise.</p></div></div><p>

The return value can be checked, if the programmer definitely wants to avoid triple buffering. Perhaps more wisely, let the user determine what&#39;s best for their system themselves (dirt easy now, isn&#39;t it? <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" />)
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>How about implementing dirty rectangles too?</p></div></div><p>

Firstly, I don&#39;t want to bloat the API too much. Screen updating is fine, especially since a seperate DRS could probably be built seperately. Secondly, I have no need or use for a DRS, so a) I personally won&#39;t waste my time and b) I wouldn&#39;t know where to start anyway. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><p>Let&#39;s just worry about problems with the current setup. Does all look good?</p><p>X-G: Yeah, but page flipping isn&#39;t as comparable to double buffering as system buffering is.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Sat, 21 Aug 2004 21:55:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>One comment of yours fails the spell checker test.<br />Yes, &quot;pedantic&quot; is my middle name.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rash)</author>
		<pubDate>Sat, 21 Aug 2004 22:07:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>omg &quot;seperately&quot;</p><p>Marcello
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Marcello)</author>
		<pubDate>Sat, 21 Aug 2004 22:17:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Can&#39;t see it.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Sat, 21 Aug 2004 22:18:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>&quot;self-explanitory&quot;
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rash)</author>
		<pubDate>Sat, 21 Aug 2004 22:19:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Huh. Thought it was spelt with an &#39;i&#39;. <img src="http://www.allegro.cc/forums/smileys/lipsrsealed.gif" alt=":-X" /></p><p>Oh well. If that&#39;s my worst bug I&#39;m happy.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Sat, 21 Aug 2004 22:20:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Well to be perfectly honest, I haven&#39;t bothered delving into the semantic aspect of the program as I&#39;m not familiar with this aspect of Allegro.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rash)</author>
		<pubDate>Sat, 21 Aug 2004 22:25:06 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Final call ...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Tue, 24 Aug 2004 09:02:20 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Add comments? <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Richard Phipps)</author>
		<pubDate>Tue, 24 Aug 2004 12:14:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>One thing I noticed that could be added is documentation ... even though it&#39;s simple it&#39;s needed anyway for reference whenever you need to use a function, that way you don&#39;t have to go diggin through source code or header files to find something.  Also in screen.h it is best to add:
</p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td><span class="p">#ifndef SCREEN_UPDATE_H</span></td></tr><tr><td class="number">2</td><td><span class="p">#define SCREEN_UPDATE_H</span></td></tr><tr><td class="number">3</td><td>&#160;</td></tr><tr><td class="number">4</td><td><span class="p">#include &lt;allegro.h&gt;</span></td></tr><tr><td class="number">5</td><td>&#160;</td></tr><tr><td class="number">6</td><td><span class="p">#ifdef __cplusplus</span></td></tr><tr><td class="number">7</td><td>  <span class="k1">extern</span> <span class="s">"C"</span> <span class="k2">{</span></td></tr><tr><td class="number">8</td><td><span class="p">#endif</span></td></tr><tr><td class="number">9</td><td>&#160;</td></tr><tr><td class="number">10</td><td><span class="c">// Blah</span></td></tr><tr><td class="number">11</td><td>&#160;</td></tr><tr><td class="number">12</td><td><span class="p">#ifdef __cplusplus</span></td></tr><tr><td class="number">13</td><td>  <span class="k2">}</span></td></tr><tr><td class="number">14</td><td><span class="p">#endif</span></td></tr><tr><td class="number">15</td><td>&#160;</td></tr><tr><td class="number">16</td><td><span class="p">#endif</span></td></tr></tbody></table></div></div><p>

This keeps it from being defined twice if it&#39;s included in multiple files in a project <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /><br />I had to use SCREEN_UPDATE_H because I think allegro already uses SCREEN_H therefore it refused to compile the header file <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" /></p><p>I utilized your screen update code into my little game, which works well since it has the *_WMB ability and I use fades, etc.  That way I get ultra smooth motion with Triple buffering fullscreen and fast fades.  However for some odd reason in windowed mode triple buffering is actually a bit choppy and not smooth, double buffering is excellent windowed and somewhat ok fullscreen, but at least you get to choose <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Steve Terry)</author>
		<pubDate>Wed, 25 Aug 2004 07:58:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
However for some odd reason in windowed mode triple buffering is actually a bit choppy and not smooth
</p></div></div><p>
tripple buffering in windowed mode doesn&#39;t exist. You&#39;re probably getting page flipping (it depends on 23 implementation).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Oscar Giner)</author>
		<pubDate>Wed, 25 Aug 2004 08:08:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ooh just noticed that UPDATE_PAGEFLIP_WMB doesn&#39;t work like it should, somehow I&#39;m getting a video bitmap to draw to, this makes it extremely slow at times.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Steve Terry)</author>
		<pubDate>Wed, 25 Aug 2004 08:20:12 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
You can page flip in windowed mode?</p><p>I haven&#39;t checked to see how the lib reacts to windowed modes. I should check that tomorrow. But like you said, at least you get to choose. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /> Glad to hear it works for you.
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>One thing I noticed that could be added is documentation ... </p></div></div><p>

Well, yeah. But right now it&#39;s pretty easy to read from the code. I&#39;ll make docs once it&#39;s done, fully and completely. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Ooh just noticed that UPDATE_PAGEFLIP_WMB doesn&#39;t work like it should, somehow I&#39;m getting a video bitmap to draw to, this makes it extremely slow at times.</p></div></div><p>

Huh? That shouldn&#39;t be ... from the code that&#39;s impossible. is_video_bitmap() == true?!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Wed, 25 Aug 2004 08:22:06 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="source-code snippet"><div class="inner"><pre><span class="k1">if</span><span class="k2">(</span><a href="http://www.allegro.cc/manual/is_video_bitmap" target="_blank"><span class="a">is_video_bitmap</span></a><span class="k2">(</span>get_buffer<span class="k2">(</span><span class="k2">)</span><span class="k2">)</span><span class="k2">)</span><span class="k2">{</span>
  <a href="http://www.allegro.cc/manual/allegro_message" target="_blank"><span class="a">allegro_message</span></a><span class="k2">(</span><span class="s">"OMG VIDEO BITMAP!!!!!DIEKTHXBYE"</span><span class="k2">)</span><span class="k2">;</span>
  <a href="http://www.delorie.com/djgpp/doc/libc/libc_298.html" target="_blank">exit</a><span class="k2">(</span><span class="n">1</span><span class="k2">)</span><span class="k2">;</span>
<span class="k2">}</span>
</pre></div></div><p>
You can guess what pops up on the screen <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" /><br />That&#39;s using the update method of page flip WMB so somehow I&#39;m getting a video buffer <img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Steve Terry)</author>
		<pubDate>Thu, 26 Aug 2004 03:04:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
In chris&#39;s code it&#39;s :</p><p><span class="source-code">buffer <span class="k3">=</span> <a href="http://www.allegro.cc/manual/create_bitmap" target="_blank"><span class="a">create_bitmap</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/SCREEN_W" target="_blank"><span class="a">SCREEN_W</span></a>, <a href="http://www.allegro.cc/manual/SCREEN_H" target="_blank"><span class="a">SCREEN_H</span></a><span class="k2">)</span><span class="k2">;</span></span><br />And so it should work. I don&#39;t know why it doesn&#39;t. However buffer itself is not being checked to see if it was created properly. Or indeed cleared of any old data..
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Richard Phipps)</author>
		<pubDate>Thu, 26 Aug 2004 03:09:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>However buffer itself is not being checked to see if it was created properly. Or indeed cleared of any old data.</p></div></div><p>


</p><div class="source-code snippet"><div class="inner"><pre>    buffer <span class="k3">=</span> <a href="http://www.allegro.cc/manual/create_bitmap" target="_blank"><span class="a">create_bitmap</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/SCREEN_W" target="_blank"><span class="a">SCREEN_W</span></a>, <a href="http://www.allegro.cc/manual/SCREEN_H" target="_blank"><span class="a">SCREEN_H</span></a><span class="k2">)</span><span class="k2">;</span>
      
    <span class="k1">if</span><span class="k2">(</span>pages<span class="k2">[</span><span class="n">0</span><span class="k2">]</span> <span class="k3">&amp;</span><span class="k3">&amp;</span> pages<span class="k2">[</span><span class="n">1</span><span class="k2">]</span> <span class="k3">&amp;</span><span class="k3">&amp;</span> buffer<span class="k2">)</span>
    <span class="k2">{</span>
      <a href="http://www.allegro.cc/manual/clear_bitmap" target="_blank"><span class="a">clear_bitmap</span></a><span class="k2">(</span>pages<span class="k2">[</span><span class="n">0</span><span class="k2">]</span><span class="k2">)</span><span class="k2">;</span>
      <a href="http://www.allegro.cc/manual/clear_bitmap" target="_blank"><span class="a">clear_bitmap</span></a><span class="k2">(</span>pages<span class="k2">[</span><span class="n">1</span><span class="k2">]</span><span class="k2">)</span><span class="k2">;</span>
      <a href="http://www.allegro.cc/manual/clear_bitmap" target="_blank"><span class="a">clear_bitmap</span></a><span class="k2">(</span>buffer<span class="k2">)</span><span class="k2">;</span>

      ...
</pre></div></div><p>
<img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /></p><p>Anyway, I&#39;m going to check this now ...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Thu, 26 Aug 2004 03:12:02 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
In the zip I downloaded it is:</p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td><span class="k1">if</span><span class="k2">(</span><span class="k2">(</span><a href="http://www.allegro.cc/manual/gfx_capabilities" target="_blank"><span class="a">gfx_capabilities</span></a> <span class="k3">&amp;</span> GFX_CAN_TRIPLE_BUFFER<span class="k2">)</span><span class="k2">)</span></td></tr><tr><td class="number">2</td><td>      <span class="k2">{</span></td></tr><tr><td class="number">3</td><td>        pages<span class="k2">[</span><span class="n">0</span><span class="k2">]</span> <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><a href="http://www.allegro.cc/manual/SCREEN_W" target="_blank"><span class="a">SCREEN_W</span></a>, <a href="http://www.allegro.cc/manual/SCREEN_H" target="_blank"><span class="a">SCREEN_H</span></a><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">4</td><td>        pages<span class="k2">[</span><span class="n">1</span><span class="k2">]</span> <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><a href="http://www.allegro.cc/manual/SCREEN_W" target="_blank"><span class="a">SCREEN_W</span></a>, <a href="http://www.allegro.cc/manual/SCREEN_H" target="_blank"><span class="a">SCREEN_H</span></a><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">5</td><td>        pages<span class="k2">[</span><span class="n">2</span><span class="k2">]</span> <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><a href="http://www.allegro.cc/manual/SCREEN_W" target="_blank"><span class="a">SCREEN_W</span></a>, <a href="http://www.allegro.cc/manual/SCREEN_H" target="_blank"><span class="a">SCREEN_H</span></a><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">6</td><td>        <span class="k1">if</span><span class="k2">(</span>pages<span class="k2">[</span><span class="n">0</span><span class="k2">]</span> <span class="k3">&amp;</span><span class="k3">&amp;</span> pages<span class="k2">[</span><span class="n">1</span><span class="k2">]</span> <span class="k3">&amp;</span><span class="k3">&amp;</span> pages<span class="k2">[</span><span class="n">2</span><span class="k2">]</span><span class="k2">)</span></td></tr><tr><td class="number">7</td><td>        <span class="k2">{</span></td></tr><tr><td class="number">8</td><td>          <a href="http://www.allegro.cc/manual/clear_bitmap" target="_blank"><span class="a">clear_bitmap</span></a><span class="k2">(</span>pages<span class="k2">[</span><span class="n">0</span><span class="k2">]</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">9</td><td>          <a href="http://www.allegro.cc/manual/clear_bitmap" target="_blank"><span class="a">clear_bitmap</span></a><span class="k2">(</span>pages<span class="k2">[</span><span class="n">1</span><span class="k2">]</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">10</td><td>          <a href="http://www.allegro.cc/manual/clear_bitmap" target="_blank"><span class="a">clear_bitmap</span></a><span class="k2">(</span>pages<span class="k2">[</span><span class="n">2</span><span class="k2">]</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">11</td><td>          active_page <span class="k3">=</span> pages<span class="k2">[</span><span class="n">0</span><span class="k2">]</span><span class="k2">;</span></td></tr><tr><td class="number">12</td><td>          buffer <span class="k3">=</span> <a href="http://www.allegro.cc/manual/create_bitmap" target="_blank"><span class="a">create_bitmap</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/SCREEN_W" target="_blank"><span class="a">SCREEN_W</span></a>, <a href="http://www.allegro.cc/manual/SCREEN_H" target="_blank"><span class="a">SCREEN_H</span></a><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">13</td><td>          <a href="http://www.allegro.cc/manual/show_video_bitmap" target="_blank"><span class="a">show_video_bitmap</span></a><span class="k2">(</span>pages<span class="k2">[</span><span class="n">2</span><span class="k2">]</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">14</td><td>          updatemethod <span class="k3">=</span> TRIPLEBUFFERWMB<span class="k2">;</span></td></tr><tr><td class="number">15</td><td>          <span class="k1">return</span> updatemethod<span class="k2">;</span></td></tr><tr><td class="number">16</td><td>        <span class="k2">}</span></td></tr></tbody></table></div></div><p>

So I must have an earlier version. Sorry about that..
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Richard Phipps)</author>
		<pubDate>Thu, 26 Aug 2004 03:18:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
That&#39;s both old, and the triple buffering code. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Thu, 26 Aug 2004 03:19:10 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
But you still have:<br /><span class="source-code">buffer <span class="k3">=</span> <a href="http://www.allegro.cc/manual/create_bitmap" target="_blank"><span class="a">create_bitmap</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/SCREEN_W" target="_blank"><span class="a">SCREEN_W</span></a>, <a href="http://www.allegro.cc/manual/SCREEN_H" target="_blank"><span class="a">SCREEN_H</span></a><span class="k2">)</span><span class="k2">;</span></span><br />In the middle of there. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><p>Your new code looks much better. <img src="http://www.allegro.cc/forums/smileys/cheesy.gif" alt=":D" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Richard Phipps)</author>
		<pubDate>Thu, 26 Aug 2004 03:20:51 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
I&#39;ll be buggered. Steve was right; something I copied and pasted over from PAGE_FLIP to PAGEFLIP_WMB assigned a video bitmap to the buffer (after it had already been assigned the memory buffer) in the drawing code. The main program now reports the type of buffer for any given mode, but now that it&#39;s working correctly it&#39;s kind of not necessary. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><p>Fixed and attached.</p><p>Page flipping is indeed choppy for me in windowed mode too, but I don&#39;t think you can get away from that ...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Thu, 26 Aug 2004 03:33:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
I think page flipping in a window is just choppy what ever you do. Glad to see you fixed the code. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Richard Phipps)</author>
		<pubDate>Thu, 26 Aug 2004 03:49:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Cool it works now <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />  I still suggest doing the #ifndef UPDATE_SCREEN_H part for multiple file projects... otherwise you are going to get errors.</p><p>Hey do I get to go on the beta tester list now I found and helped fix a bug <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Steve Terry)</author>
		<pubDate>Thu, 26 Aug 2004 03:52:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>I still suggest doing the #ifndef UPDATE_SCREEN_H part for multiple file projects ...</p></div></div><p>

Right; I forgot that. Added.
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Hey do I get to go on the beta tester list now I found and helped fix a bug</p></div></div><p>

List? There&#39;s a list?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Thu, 26 Aug 2004 04:01:32 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Chris, would you be prepared to add in a DRS system if Axilmar or someone else was to code it?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Richard Phipps)</author>
		<pubDate>Thu, 26 Aug 2004 04:08:34 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You need at least a README in there for those who wish to use it, not everyone is inclined to dig through .c files to figure out how to use it <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Steve Terry)</author>
		<pubDate>Thu, 26 Aug 2004 04:10:02 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Chris, would you be prepared to add in a DRS system if Axilmar or someone else was to code it?</p></div></div><p>

Depends on how its done. I have no idea what a DRS system entails and I don&#39;t know what it&#39;ll do to the API. If can be written to work alongside my API, bodacious. I&#39;m definitely open to the idea.
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>You need at least a README in there for those who wish to use it</p></div></div><p>

Well, yeah. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /> But that&#39;s when it&#39;s ready to be &quot;released&quot;, and especially after a bug like you found, it ain&#39;t. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /> Plus a DRS might muck up the API, so ...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Thu, 26 Aug 2004 04:10:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
It shouldn&#39;t mess up the API or your system at all if done right. Maybe Axilmar can help with this. I&#39;m going to be a bit busy setting everything up..
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Richard Phipps)</author>
		<pubDate>Thu, 26 Aug 2004 04:25:10 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yes, a DRS system is completely independent from what Chris does. It is only conceptually that they belong together.</p><p>EDIT: as for me doing it, come on people! activate yourselves! I am busy designing the gui! I can&#39;t do it all!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (axilmar)</author>
		<pubDate>Thu, 26 Aug 2004 17:56:29 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
I&#39;ve had my say. I don&#39;t know how and I don&#39;t care how. <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" /></p><p>Haven&#39;t a few of you guys already made DRS systems? Clean it up and post it ...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Fri, 27 Aug 2004 03:46:54 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
There are plenty of people here who unlike me aren&#39;t busy.. <b>cough</b> X-G, <b>cough</b>.. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Richard Phipps)</author>
		<pubDate>Fri, 27 Aug 2004 03:48:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I have mine, axilmar has his, both are completely independent of a screen update API, however if you want mine just copy nas_drs.h and nas_drs.c from the NAS library <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Steve Terry)</author>
		<pubDate>Fri, 27 Aug 2004 03:48:39 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
DOKUMINTASHUN!!1</p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td>&#160;</td></tr><tr><td class="number">2</td><td><span class="k1">int</span> initialize_screen_updating<span class="k2">(</span><span class="k1">int</span> i<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">3</td><td>Initializes the <a href="http://www.allegro.cc/manual/screen" target="_blank"><span class="a">screen</span></a> update system. This function must be called after <a href="http://www.allegro.cc/manual/set_gfx_mode" target="_blank"><span class="a">set_gfx_mode</span></a><span class="k2">(</span><span class="k2">)</span> <span class="k1">and</span> can be called with the following values:</td></tr><tr><td class="number">4</td><td>&#160;</td></tr><tr><td class="number">5</td><td>      UPDATE_TRIPLE_BUFFER    <span class="k3">-</span> standard triple buffering setup</td></tr><tr><td class="number">6</td><td>      UPDATE_PAGE_FLIP        <span class="k3">-</span> standard page flipping setup</td></tr><tr><td class="number">7</td><td>      UPDATE_SYSTEM_BUFFER    <span class="k3">-</span> <span class="k1">double</span> buffering <a href="http://www.delorie.com/djgpp/doc/libc/libc_802.html" target="_blank">system</a> <span class="k1">using</span> a <a href="http://www.delorie.com/djgpp/doc/libc/libc_802.html" target="_blank">system</a> bitmap</td></tr><tr><td class="number">8</td><td>      UPDATE_DOUBLE_BUFFER    <span class="k3">-</span> <span class="k1">double</span> buffering <a href="http://www.delorie.com/djgpp/doc/libc/libc_802.html" target="_blank">system</a> <span class="k1">using</span> a memory bitmap</td></tr><tr><td class="number">9</td><td>      UPDATE_TRIPLE_WMB       <span class="k3">-</span> triple buffering, but with a memory bitmap buffer instead of a video bitmap</td></tr><tr><td class="number">10</td><td>      UPDATE_PAGEFLIP_WMB     <span class="k3">-</span> page flipping, but with a memory bitmap buffer instead of a video bitmap</td></tr><tr><td class="number">11</td><td>&#160;</td></tr><tr><td class="number">12</td><td>UPDATE_TRIPLE_WMB <span class="k1">and</span> UPDATE_PAGEFLIP_WMB are <span class="k1">for</span> <a href="http://www.delorie.com/djgpp/doc/libc/libc_822.html" target="_blank">times</a> you<span class="s">'re using a lot of blending or whatnot, and don'</span>t want your program slowed</td></tr><tr><td class="number">13</td><td>down due to reading from video memory. UPDATE_SYSTEM_BUFFER <span class="k1">and</span> UPDATE_DOUBLE_BUFFER don<span class="s">'t synchronize to the vertical retrace of the</span></td></tr><tr><td class="number">14</td><td><span class="s">screen unless vsync is enabled (by calling enable_vsync()). Note that these two mode alone are affected by the vsync functions; the</span></td></tr><tr><td class="number">15</td><td><span class="s">triple buffering and page flipping modes automatically handle vertical retrace synchronisation.</span></td></tr><tr><td class="number">16</td><td><span class="s"></span></td></tr><tr><td class="number">17</td><td><span class="s">You can call this function multiple times in one program. So if you want the user to be able to switch between update methods to find</span></td></tr><tr><td class="number">18</td><td><span class="s">one best suited to their system, it'</span>s as easy as calling initialize_screen_updating<span class="k2">(</span><span class="k2">)</span> again.</td></tr><tr><td class="number">19</td><td>&#160;</td></tr><tr><td class="number">20</td><td>&#160;</td></tr><tr><td class="number">21</td><td><span class="k1">void</span> shutdown_screen_updating<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">22</td><td>Does what it says. Call <span class="k1">this</span> at the end of your program to prevent memory leaks.</td></tr><tr><td class="number">23</td><td>&#160;</td></tr><tr><td class="number">24</td><td>&#160;</td></tr><tr><td class="number">25</td><td><a href="http://www.allegro.cc/manual/BITMAP" target="_blank"><span class="a">BITMAP</span></a><span class="k3">*</span> get_buffer<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">26</td><td>This function returns the drawing surface. Do all your drawing to <span class="k1">this</span> bitmap during your drawing code. It doesn<span class="s">'t affect the screen</span></td></tr><tr><td class="number">27</td><td><span class="s">until you call update_screen().</span></td></tr><tr><td class="number">28</td><td><span class="s"></span></td></tr><tr><td class="number">29</td><td><span class="s"></span></td></tr><tr><td class="number">30</td><td><span class="s">void update_screen();</span></td></tr><tr><td class="number">31</td><td><span class="s">Blits the buffer to the screen.</span></td></tr><tr><td class="number">32</td><td><span class="s"></span></td></tr><tr><td class="number">33</td><td><span class="s"></span></td></tr><tr><td class="number">34</td><td><span class="s">int get_update_method();</span></td></tr><tr><td class="number">35</td><td><span class="s">Returns the update method in the form of one of the six values listed under initialize_screen_updating().</span></td></tr><tr><td class="number">36</td><td><span class="s"></span></td></tr><tr><td class="number">37</td><td><span class="s"></span></td></tr><tr><td class="number">38</td><td><span class="s">void enable_vsync();</span></td></tr><tr><td class="number">39</td><td><span class="s">Makes update_screen() wait for a vertical retrace to end before updating the screen. Note this only affects UPDATE_SYSTEM_BUFFER and</span></td></tr><tr><td class="number">40</td><td><span class="s">UPDATE_DOUBLE_BUFFER.</span></td></tr><tr><td class="number">41</td><td><span class="s"></span></td></tr><tr><td class="number">42</td><td><span class="s"></span></td></tr><tr><td class="number">43</td><td><span class="s">void disable_vsync();</span></td></tr><tr><td class="number">44</td><td><span class="s">Disables vertical retrace synchronisation for UPDATE_SYSTEM_BUFFER and UPDATE_DOUBLE_BUFFER modes.</span></td></tr><tr><td class="number">45</td><td><span class="s"></span></td></tr><tr><td class="number">46</td><td><span class="s"></span></td></tr><tr><td class="number">47</td><td><span class="s">void toggle_vsync();</span></td></tr><tr><td class="number">48</td><td><span class="s">Toggles vertical retrace synchronisation for UPDATE_SYSTEM_BUFFER and UPDATE_DOUBLE_BUFFER modes.</span></td></tr><tr><td class="number">49</td><td><span class="s"></span></td></tr><tr><td class="number">50</td><td><span class="s"></span></td></tr><tr><td class="number">51</td><td><span class="s">int vsync_is_enabled();</span></td></tr><tr><td class="number">52</td><td><span class="s">Returns whether vertical retrace synchronisation is enabled.</span></td></tr></tbody></table></div></div><p>
Anything to add?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Sat, 28 Aug 2004 01:53:35 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Excellent!</p><p>You&#39;ve been busy. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Richard Phipps)</author>
		<pubDate>Sat, 28 Aug 2004 02:00:02 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ah yes, I meant to ask about this:
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>UPDATE_TRIPLE_WMB and UPDATE_PAGEFLIP_WMB are for times you&#39;re using a lot of blending or whatnot</p></div></div><p>
What&#39;s the advantage over using a plain double buffer for this case? I don&#39;t see any, to be honest.</p><p>I have yet to merge the code with the current Allegro tree and API, although I have integrated it with a start for an improved graphics API (with a few changes - the initialization fails if a mode isn&#39;t supported rather than trying another one, for instance).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Sat, 28 Aug 2004 02:00:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>What&#39;s the advantage over using a plain double buffer for this case? I don&#39;t see any, to be honest.</p></div></div><p>

Neither do I. I just put it in at the request of others, and the more I think about it the dumber it seems. <img src="http://www.allegro.cc/forums/smileys/rolleyes.gif" alt="::)" />
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>the initialization fails if a mode isn&#39;t supported rather than trying another one, for instance</p></div></div><p>

What?! I was so proud of that! <img src="http://www.allegro.cc/forums/smileys/cry.gif" alt=":&#39;(" /> <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /></p><p>PS: Would it be safe to install shutdown_screen_updating() as one of those atexit() function calls?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Sat, 28 Aug 2004 02:02:05 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
I use it. Trust me it&#39;s very good. Especially with a scrolling screen as you have the advantages of a memory bitmap with smooth updating without flickering. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Richard Phipps)</author>
		<pubDate>Sat, 28 Aug 2004 02:03:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>What?! I was so proud of that! <img src="http://www.allegro.cc/forums/smileys/cry.gif" alt=":&#39;(" /> <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /></p></div></div><p>
Well, it went into what is basically a replacement for set_gfx_mode(), and it felt a bit too complicated. My take here was to have the function do what it&#39;s asked to do and not try to be smart if it can&#39;t do it. <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /><br />Anyway, for the curious, my initial draft sitting on top of Allegro&#39;s current API is attached. This&#39;ll be post 4.2 material though.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Especially with a scrolling screen as you have the advantages of a memory bitmap with smooth updating without flickering.</p></div></div><p>
I still don&#39;t really see the advantage over a plain double buffer, actually...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Sat, 28 Aug 2004 02:56:23 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Oh, okay. You&#39;ve made some huge changes there. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><p>I&#39;ll submit it as is to the code resource then.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Sat, 28 Aug 2004 02:59:41 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I plan to backport it to 4.1 though. Don&#39;t let that stop you anyway. <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Sat, 28 Aug 2004 03:01:32 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>I still don&#39;t really see the advantage over a plain double buffer, actually...</p></div></div><p>

If you scroll with a double buffer you sometimes get tearing, even with vsync which can sometimes make it worse. Normally you would use page flipping or triple buffering but then normally you would have to use video memory which would slow down some kinds of gfx.</p><p>With a memory buffer and video memory you have the advantages of a memory bitmap without tearing.</p><p>You&#39;re going to have to trust me on this one. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /> Don&#39;t drop it, it&#39;s very useful.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Richard Phipps)</author>
		<pubDate>Sat, 28 Aug 2004 03:04:27 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ah... I see. With normal double buffering, you can still get tearing when you draw the backbuffer to the screen. By drawing the backbuffer to a second screenpage and using page flipping, you don&#39;t get tearing at all.</p><p>Ok, guess I&#39;ll put it back in for page flipping. I still don&#39;t see the use with triple buffering though...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Sat, 28 Aug 2004 03:13:05 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Triple Buffering doesn&#39;t force you to wait for an update to complete like page flipping does.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Richard Phipps)</author>
		<pubDate>Sat, 28 Aug 2004 03:14:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Actually, I don&#39;t see the use with page flipping (my update API doesn&#39;t have this one).  since page flipping usually works worse than double buffer (specially in windowed mode).</p><p>But with tripple buffer you have the advantage RP just mentioned.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
the initialization fails if a mode isn&#39;t supported rather than trying another one, for instance
</p></div></div><p>
I agree here. I&#39;d suggest an autodetect mode (however, without any extra info, it wouldn&#39;t know if it should use *_WMB or not, that&#39;s why mine has the hw_accel flag).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Oscar Giner)</author>
		<pubDate>Sat, 28 Aug 2004 03:46:18 +0000</pubDate>
	</item>
</rss>

