<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Allegro Beginner questions</title>
		<link>http://www.allegro.cc/forums/view/614217</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Fri, 23 May 2014 22:54:29 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hello,</p><p>I have the project to make my own FPS with my own engine (WOlF3d style) with allegro this time, in fact I am really disappointed by SDL 2.0 library so I decided due to the time waisting to move to this library, I had have mouse movement problems and I was too lazy to fix myself these bugged functions.</p><p>However before installing this library, I searched for known bugs and I saw that there are still plenty of problems with displaying (bugs seems to appear with allegro 5 and 4.22)and the same problem with mouse movement which is limited by the edge of screen...</p><p>&quot; //Quote not from me picked on <a href="http://freecode.com/projects/allegro/releases/258252">http://freecode.com/projects/allegro/releases/258252</a><br />Release note of version 4.2.2 :A new mouse cursor API is used, but it doesn&#39;t work in Windows fullscreen modes. <br />&quot;</p><p>So my questions are :</p><p>with allegro :</p><p>- Which version of allegro should I use if I want that my program run under windows ?<br />- Which version of allegro got no mouse problems and full-screen displaying bugs ?<br />- or even better, what is the last version outdated but fully fonctionnal that works for sure, (I can even use dosbox to launch the game, that&#39;s not a problem ! <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" />) ?<br />- Can i manually set my screen pixels, that is to say, allegro allows me to have a pointer to the screen pixel, then I can modify, then I imagine I must refresh the screen, can allegro do that ? (I don&#39;t want to have a fonction that modify 1 pixel, it would be too long to modify the whole_screen)</p><p>Thanks a lot, and anyway well done to all contributors of allegro even if there are some bugs
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (the_cake)</author>
		<pubDate>Tue, 06 May 2014 04:14:39 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hi! First of all, you&#39;ll be best off with Allegro 5. Allegro 4.x is and old, legacy version of Allegro and not actively developed anymore. And because you want to do 3D graphics, the latest version of Allegro 5.1 will probably be best since it has functionality that helps with drawing 3D graphics that isn&#39;t there yet in Allegro 5.0.</p><p>There is no version of Allegro without bugs since almost all software has bugs, but AFAICS both fullscreen and the mouse work fine with Allegro 5 under Windows. And if you have any problems, then please report the problem here and we&#39;ll do what we can to help you.</p><p>You can set pixels manualy to the screen, but nowadays this isn&#39;t done anymore since almost all desktop PC&#39;s and most handheld devices have a graphics processor (GPU) that can and should be used for drawing 2D or 3D graphics. To do that you use OpenGL, or use the Primitives (<a href="https://www.allegro.cc/manual/5/al_draw_prim">https://www.allegro.cc/manual/5/al_draw_prim</a>, etc) Allegro 5 API to render (draw) the 3D world of your game. The following thread gives an example of how to do that: <a href="https://www.allegro.cc/forums/thread/614194">https://www.allegro.cc/forums/thread/614194</a>.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (beoran)</author>
		<pubDate>Tue, 06 May 2014 10:43:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thank for your answer but you probably misunderstanding me, I wrote :</p><p>&quot;I have the project to make my own FPS with my own engine (WOlF3d style)&quot;</p><p>Do you know what wolf3d refers to ? It&#39;s wolfenstein 3d 1992, it uses raycasting rendering method, there is no high level implementation like open_gl or direct_x, so the problem is that I don&#39;t want to use any 3d implentation, I will build myself one as I already begun with SDL 2.0. In fact I just want a pointer to the pixel then maybe call an allegro function to load them into the gpu and give order to refresh the screen with an allegro function. Can allegro do that ? SDL 2.0 allows that. Of course my engine will not use the power of the gpu, but that is not a problem for me.</p><p>And all software doesn&#39;t have major bugs ! By major bugs I mean that when I was SDL 2.0 programming, my project stopped only because of this library that was buggy, and as I said I was too lazy to contribute to the fix of this problem. Yeah, I am a simple studient with limited time and ressources, I got my own problems, my parents, my studies, my duties, papers managing you know <img src="http://www.allegro.cc/forums/smileys/cry.gif" alt=":&#39;(" />...</p><p>PS: Are you sure that allegro 5 is the best choice ? I mean because if I am not wrong the community with 5 version improve allegro OS targets ? isn&#39;t it ? And as I say I don&#39;t want to make a portable program, I&#39;m only a little windows user...</p><p>PS2: I will try today with allegro 5 to see if I got the limited mouse movement in windows fullscreen mode bug. If I got this problem, I will be maybe forced to see the allegro sources to fix this bug, but I already look to the sources and I must admit that it is pretty difficult to understand the allegro library structure especially when I have never use it <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" />. So if I have no bugs I will close this thread. thank again.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (the_cake)</author>
		<pubDate>Tue, 06 May 2014 16:53:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/614217/1000268#target">the_cake</a> said:</div><div class="quote"><p> and the same problem with mouse movement which is limited by the edge of screen...</p></div></div><p>What is that problem? I&#39;m curios, can you elaborate a bit more? <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (AMCerasoli)</author>
		<pubDate>Tue, 06 May 2014 16:58:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>to amcerasoli : here a link to a bug with ALLegro, the same I got under SDL 2.0 but Allegro seems to have exactly the same problem :<a href="https://www.allegro.cc/forums/thread/608627/0">https://www.allegro.cc/forums/thread/608627/0</a></p><p>I have tested now allegro 5 and I can affirm that low resolution are no more taken in charge : 320*200 and 320*240 doesn&#39;t work at all in fullscreen mode, I remember that it can work but I imagine allegro 5 will not concentrate effort on it, and that is normal, anyway there is no problem because I can put a 640*480 with a 320*240 by duplicate value of the pixel, however it take a little of cpu time for that and In my case this is a little bit critical.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (the_cake)</author>
		<pubDate>Tue, 06 May 2014 18:29:26 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/614217/1000283#target">the_cake</a> said:</div><div class="quote"><p>
In fact I just want a pointer to the pixel then maybe call an allegro function to load them into the gpu and give order to refresh the screen with an allegro function. Can allegro do that ? 
</p></div></div><p>
If this raycasting stuff is really what you&#39;re after, I think the appropriate function might be <a href="https://www.allegro.cc/manual/5/al_lock_bitmap"><tt>al_lock_bitmap</tt></a> with the <tt>ALLEGRO_LOCK_WRITEONLY</tt> flag.<br />You will receive a <a href="https://www.allegro.cc/manual/5/allegro_locked_region"><tt>AL_LOCKED_REGION</tt></a>, which essentially provides raw memory access to pixel data. Note that you have to fill in the whole bitmap before uploading it to the GPU with <a href="https://www.allegro.cc/manual/5/al_unlock_bitmap"><tt>al_unlock_bitmap</tt></a>. You can also use <a href="https://www.allegro.cc/manual/5/al_put_pixel"><tt>al_put pixel</tt></a> if you don&#39;t want do deal with raw memory access. </p><p>I don&#39;t know about its speed, but as long as you don&#39;t read back any pixel data (<tt>ALLEGRO_LOCK_WRITEONLY</tt>)and since you seem to intend to use low resolutions anyway, I don&#39;t think this&#39;ll be a problem. </p><p>If you fill in the pixels and unlock your 320x200 bitmap, you can draw it normally using <tt>al_draw_bitmap</tt>. You could even enable antialiasing (use <tt>ALLEGRO_MAG_LINEAR</tt> with <a href="https://www.allegro.cc/manual/5/al_set_new_bitmap_flags"><tt>al_set_new_bitmap_flags</tt></a> when creating) and draw it scaled to your window/screen resolution (<tt>al_draw_scaled_bitmap</tt>).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Polybios)</author>
		<pubDate>Tue, 06 May 2014 19:09:47 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yeah polybios, I have searched for pixel direct acces but all the proposed mehtod are too slow, and the fonction put_pixel ? Arg, a joke this function, I just saw the sources, it is so unoptimised, and the process of locking then unlocking every frame too. SDL 2.0 system of direct acces is much powerfull. The contributors should look to SDL 2.0. In fact I think that I will be forced to program in assembly using modified versions of int 10h fonctions and launching the game via a dosbox. So I will leave you now <img src="http://www.allegro.cc/forums/smileys/cry.gif" alt=":&#39;(" />. Anyway good luck ! admin can close the trhead.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (the_cake)</author>
		<pubDate>Tue, 06 May 2014 20:22:23 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Low res modes just aren&#39;t supported by newer windows operating systems period. You can fake them by setting a 2x size res, and then scaling your graphics. which is easier to do with allegro 5.</p><p>Assuming Allegro 4:<br />Don&#39;t use put pixel for a lot of drawing. you want either _putpixelNN (8,16, 32), the things mentioned <a href="http://alleg.sourceforge.net/stabledocs/en/alleg022.html">here</a> or just access <span class="source-code">bmp-&gt;line</span> or <span class="source-code">bmp-&gt;data</span> instead. Most people pick <span class="source-code">bmp-&gt;line</span> and <span class="source-code">bmp-&gt;data</span> these days.</p><p>For allegro 5, the bitmap locking will give you direct access to the memory for memory bitmaps. but locking a video bitmap will require a texture download and upload each time you lock/unlock it.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Tue, 06 May 2014 21:43:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ok, but please don&#39;t run away yet, and try to listen to what the people are saying here... I know you&#39;re young and restless, but you should take some time to get to know the libraries you are going to use, whether it is Allegro 5 or not.</p><p>As other people are telling you can write directly to a bitmap in allegro 5 as well, and then draw that to the display. There&#39;s a thread here with more info: <a href="https://www.allegro.cc/forums/thread/612922">https://www.allegro.cc/forums/thread/612922</a></p><p>With contemporary systems it&#39;s normally not possible anymore to switch the screen to such a  full screen low resolution. In stead, you scale up your 320x240 buffer to screen size using transformations or by rendering the bitmap scaled. SDL 2 actually does the same. </p><p>Also, a different approach might be to not draw pixels, but simply draw colored rectangles of the right size to simulate pixels.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (beoran)</author>
		<pubDate>Tue, 06 May 2014 23:25:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ohhhh the people... Sometimes because the library can&#39;t work with 4D and sometimes because the library is not able to simulate a 128X64 display... What&#39;s next?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (AMCerasoli)</author>
		<pubDate>Tue, 06 May 2014 23:33:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/614217/1000297#target">Thomas Fjellstrom</a> said:</div><div class="quote"><p>but locking a video bitmap will require a texture download and upload each time you lock/unlock it.</p></div></div><p>
I suggested <tt>ALLEGRO_LOCK_WRITEONLY</tt> because I thought there was only an upload.</p><p>By the way, adding one/more layer(s) of indirection (DosBox, int 10h emulation etc.) won&#39;t be much faster, I guess.<br />But if you&#39;re after retro stuff, have fun with int 10h and 16 bit asm.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Polybios)</author>
		<pubDate>Wed, 07 May 2014 02:41:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/614217/1000315#target">Polybios</a> said:</div><div class="quote"><p>I suggested ALLEGRO_LOCK_WRITEONLY because I thought there was only an upload.</p></div></div><p>Technically it should be that. Not 100% sure if it is enforced.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Wed, 07 May 2014 02:44:50 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/614217/1000315#target">Polybios</a> said:</div><div class="quote"><p> By the way, adding one/more layer(s) of indirection (DosBox, int 10h emulation etc.) won&#39;t be much faster, I guess.</p></div></div><p>That was exactly my first tought.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (pkrcel)</author>
		<pubDate>Wed, 07 May 2014 13:32:57 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Actually it will be slower because dosbox runs on SDL... Might as well use SDL or Allegro directly.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (beoran)</author>
		<pubDate>Wed, 07 May 2014 13:39:57 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If you&#39;re going to compile for DosBox, be sure to compile for 586 or less, it&#39;ll barf if you use SIMD or other more advanced instructions.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Arthur Kalliokoski)</author>
		<pubDate>Wed, 07 May 2014 13:42:06 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><b>to beoran :</b></p><p>&quot;<br />Ok, but please don&#39;t run away yet, and try to listen to what the people are saying here... I know you&#39;re young and restless, but you should take some time to get to know the libraries you are going to use, whether it is Allegro 5 or not.</p><p>As other people are telling you can write directly to a bitmap in allegro 5 as well, and then draw that to the display. There&#39;s a thread here with more info: <a href="https://www.allegro.cc/forums/thread/612922">https://www.allegro.cc/forums/thread/612922</a></p><p>With contemporary systems it&#39;s normally not possible anymore to switch the screen to such a full screen low resolution. In stead, you scale up your 320x240 buffer to screen size using transformations or by rendering the bitmap scaled. SDL 2 actually does the same.</p><p>Also, a different approach might be to not draw pixels, but simply draw colored rectangles of the right size to simulate pixels.<br />&quot;</p><p>Sorry I know that. As I said, I have already tested the purposed methods... and this is so slow that I cannot stop laughing <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" />.  </p><p>&quot; Actually it will be slower because dosbox runs on SDL... Might as well use SDL or Allegro directly. &quot;</p><p>Oug ! What a joke ! maybe written with SDL but it will be a lot faster !</p><p><b>to Thomas Fjellstrom :</b></p><p>I suggest you to read my post again : </p><p>I wrote :<br />&quot;[...]anyway there is no problem because I can put a 640*480 with a 320*240 by duplicate value of the pixel[...]&quot; <img src="http://www.allegro.cc/forums/smileys/shocked.gif" alt=":o" /></p><p><b>to AMCerasoli</b></p><p>I am sorry but I don&#39;t stay with a library that allows me not to do what I want...</p><p><b>to polybios and pkrcel</b><br />Can you post a proof of what you are saying ? It will maybe change my opinion, because in fact I just need to display my bitmap without locking/unlocking each frame. I already tried but I admit that my previos code may be wrong but this one wroks, just tell me how much time you execute this program, it takes 45 secs on my computer and works on a single 3.00 ghz core :</p><p>#define ALLEGRO_STATICLINK<br />#include &lt;stdio.h&gt;<br />#include &lt;stdlib.h&gt;<br />#include &lt;allegro5/allegro.h&gt;</p><p>int main(int argc, char **argv)<br />{<br />    ALLEGRO_DISPLAY *display = NULL;</p><p>    if(!al_init())<br />    {<br />        fprintf(stderr, &quot;failed to initialize allegro!\n&quot;);<br />        return -1;<br />    }</p><p>    //al_set_new_display_flags(ALLEGRO_FULLSCREEN);<br />    display = al_create_display(320, 200);<br />    if(!display)<br />    {<br />        fprintf(stderr, &quot;failed to create display!\n&quot;);<br />        return -1;<br />    }<br />    al_hide_mouse_cursor(display);<br />    ALLEGRO_BITMAP *my_screen = NULL;<br />    my_screen = al_get_backbuffer(display);</p><p>    const int screen_pixels = 320*200;</p><p>    int i, j, w;</p><p>    for(w=0;w&lt;256;w++)<br />    for(j=0;j&lt;256;j++)<br />    {<br />    ALLEGRO_LOCKED_REGION *lr = al_lock_bitmap(my_screen, ALLEGRO_PIXEL_FORMAT_ARGB_8888, ALLEGRO_LOCK_WRITEONLY);<br />    unsigned int *ptr = (unsigned int *)lr-&gt;data; //points to first pixel<br />    for (i=0; i&lt;screen_pixels; i++)<br />        ptr[i]=i+j*256+w*65536;<br />    al_unlock_bitmap(my_screen);<br />    al_flip_display();<br />    //al_rest(0.01);<br />    }</p><p>    al_destroy_display(display);</p><p>    return 0;<br />}</p><p>I never intended to use int 10h functions, just read carefully my post...<br />Obiously, if there are not modified there are too slow...<br />I think that when I will launch my program through dosbox, I may loose 10% compared on if I boot on the programm but in fact I don&#39;t really know... And yeah 2^20 of memory is enough for me ! </p><p><b>to Arthur Kalliokoski</b><br />Of course !
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (the_cake)</author>
		<pubDate>Thu, 08 May 2014 02:23:34 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>edit: nevermind.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Thu, 08 May 2014 02:34:31 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It is possible the format you locked the bitmap in is not the same as the actual format of the bitmap. That would cause conversion slowdowns.</p><p>The manual entry for <span class="source-code"><a href="http://www.allegro.cc/manual/al_lock_bitmap"><span class="a">al_lock_bitmap</span></a></span> says :
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
&#39;format&#39; indicates the pixel format that the returned buffer will be in. To lock in the same format as the bitmap stores it&#39;s data internally, call with al_get_bitmap_format(bitmap) as the format or use ALLEGRO_PIXEL_FORMAT_ANY. Locking in the native format will usually be faster.
</p></div></div><p>

This means you would have to adjust your pixel access based on the actual format of the bitmap.</p><p>What are you trying to accomplish exactly anyway?</p><p>I rewrote your example to fix the mistakes and ran it and I got 65536 frames at 320x200 in 65 seconds. That&#39;s 1000fps, on my laptop no less. Not fast enough for you?</p><p>Here&#39;s the code I used (just the important bits) :
</p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">  1</span>   
<span class="number">  2</span>   <span class="k1">for</span> <span class="k2">(</span><span class="k1">int</span> r <span class="k3">=</span> <span class="n">0</span> <span class="k2">;</span> r <span class="k3">&lt;</span> <span class="n">64</span> <span class="k2">;</span> <span class="k3">+</span><span class="k3">+</span>r<span class="k2">)</span> <span class="k2">{</span>
<span class="number">  3</span>      <span class="k1">for</span> <span class="k2">(</span><span class="k1">int</span> g <span class="k3">=</span> <span class="n">0</span> <span class="k2">;</span> g <span class="k3">&lt;</span> <span class="n">64</span> <span class="k2">;</span> <span class="k3">+</span><span class="k3">+</span>g<span class="k2">)</span> <span class="k2">{</span>
<span class="number">  4</span>         <a href="http://www.allegro.cc/manual/screen"><span class="a">screen</span></a> <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_get_backbuffer"><span class="a">al_get_backbuffer</span></a><span class="k2">(</span>display<span class="k2">)</span><span class="k2">;</span>
<span class="number">  5</span>         <a href="http://www.allegro.cc/manual/ALLEGRO_LOCKED_REGION"><span class="a">ALLEGRO_LOCKED_REGION</span></a><span class="k3">*</span> lr <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_lock_bitmap"><span class="a">al_lock_bitmap</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/screen"><span class="a">screen</span></a> , <a href="http://www.allegro.cc/manual/al_get_bitmap_format"><span class="a">al_get_bitmap_format</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/screen"><span class="a">screen</span></a><span class="k2">)</span> , ALLEGRO_LOCK_WRITEONLY<span class="k2">)</span><span class="k2">;</span>
<span class="number">  6</span>         <span class="k1">for</span> <span class="k2">(</span><span class="k1">int</span> nlines <span class="k3">=</span> <span class="n">0</span> <span class="k2">;</span> nlines <span class="k3">&lt;</span> SCREEN_HEIGHT <span class="k2">;</span> <span class="k3">+</span><span class="k3">+</span>nlines<span class="k2">)</span> <span class="k2">{</span>
<span class="number">  7</span>            <span class="k1">unsigned</span> <span class="k1">int</span><span class="k3">*</span> dat <span class="k3">=</span> <span class="k2">(</span><span class="k1">unsigned</span> <span class="k1">int</span><span class="k3">*</span><span class="k2">)</span><span class="k2">(</span><span class="k2">(</span><span class="k1">unsigned</span> <span class="k1">char</span><span class="k3">*</span><span class="k2">)</span>lr-&gt;data <span class="k3">+</span> lr-&gt;pitch<span class="k3">*</span>nlines<span class="k2">)</span><span class="k2">;</span>
<span class="number">  8</span>            <span class="k1">for</span> <span class="k2">(</span><span class="k1">int</span> pixel <span class="k3">=</span> <span class="n">0</span> <span class="k2">;</span> pixel <span class="k3">&lt;</span> SCREEN_WIDTH <span class="k2">;</span> <span class="k3">+</span><span class="k3">+</span>pixel<span class="k2">)</span> <span class="k2">{</span>
<span class="number">  9</span>               dat<span class="k2">[</span>pixel<span class="k2">]</span> <span class="k3">=</span> <span class="k2">(</span>nlines%<span class="n">256</span><span class="k2">)</span><span class="k3">*</span><span class="n">256</span> <span class="k3">+</span> g<span class="k3">*</span><span class="n">4</span><span class="k3">*</span><span class="n">256</span><span class="k3">*</span><span class="n">256</span> <span class="k3">+</span> r<span class="k3">*</span><span class="n">4</span><span class="k3">*</span><span class="n">256</span><span class="k3">*</span><span class="n">65536</span><span class="k2">;</span>
<span class="number"> 10</span>            <span class="k2">}</span>
<span class="number"> 11</span>         <span class="k2">}</span>
<span class="number"> 12</span>         <a href="http://www.allegro.cc/manual/al_unlock_bitmap"><span class="a">al_unlock_bitmap</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/screen"><span class="a">screen</span></a><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 13</span>         <a href="http://www.allegro.cc/manual/al_flip_display"><span class="a">al_flip_display</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 14</span>         <a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"n = %d\n"</span> , r<span class="k3">*</span><span class="n">64</span> <span class="k3">+</span> g<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 15</span>      <span class="k2">}</span>
<span class="number"> 16</span>   <span class="k2">}</span>
<span class="number"> 17</span>   <a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"Total time taken : %f\n"</span> , <a href="http://www.allegro.cc/manual/al_get_time"><span class="a">al_get_time</span></a><span class="k2">(</span><span class="k2">)</span> <span class="k3">-</span> start_time<span class="k2">)</span><span class="k2">;</span>
</div></div><p>

With this test, it took 34.66 seconds for 4095 frames, roughly 118 FPS at 800x600.</p><p>And this entire argument is moot anyway, because with A5 you could use shaders for direct pixel access, and then it would be GPU bound, and not CPU bound.</p><p>Edit<br />Just so you know, you can use &lt;code&gt;code goes here...&lt;/code&gt; tags to make our lives easier. See <a href="https://www.allegro.cc/mockup.html">https://www.allegro.cc/mockup.html</a> for details.</p><p>Edit2<br />Running fullscreen instead of windowed at 800x600 it took 19.3 seconds for 4096 frames, well over 200 FPS.</p><p>Allegro is not slow. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Thu, 08 May 2014 03:44:57 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>the_cake, like Edgar said, the problem is that there is a logical error in your code. You are locking, unlocking and flipping the backbuffer <i>every time</i> you write a pixel, which is of course very slow. </p><p>In stead, you need to first lock the backbuffer, outside of your rendering loop, then do all your rendering and pixel setting, then finally unlock and flip the bitmap. Then your program will be blazing fast. So yes, you can use Allegro 5 for your purposes! <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><p>Edit: This goes to show that he concept of locking a bitmap is not always intuitive to everyone. I checked the documentation of al_lock_bitmap and it doesn&#39;t quite mention that you are supposed to lock the bitmap only once and then do your pixel twiddling. I&#39;ll make a patch to modify the docs of that function later on.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (beoran)</author>
		<pubDate>Thu, 08 May 2014 11:15:18 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>There was another error as well, that of assuming pitch to be equal to pixel_size*width. Pitch can be negative or memory aligned and padded so it isn&#39;t guaranteed to be pixel_size*width. And you also can&#39;t expect the color order to be the same across systems unless you are very specific with your new display options. <span class="source-code"><a href="http://www.allegro.cc/manual/al_set_new_display_option"><span class="a">al_set_new_display_option</span></a></span></p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/614217/1000407#target">beoran</a> said:</div><div class="quote"><p>
You are locking, unlocking and flipping the backbuffer every time you write a pixel, which is of course very slow. 
</p></div></div><p>
No, his code doesn&#39;t do that. The inner for loop is a one liner.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Thu, 08 May 2014 11:43:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">  1</span><span class="k1">int</span> i, j, w<span class="k2">;</span>
<span class="number">  2</span>
<span class="number">  3</span><span class="k1">for</span><span class="k2">(</span>w<span class="k3">=</span><span class="n">0</span><span class="k2">;</span>w<span class="k3">&lt;</span><span class="n">256</span><span class="k2">;</span>w<span class="k3">+</span><span class="k3">+</span><span class="k2">)</span>
<span class="number">  4</span><span class="k1">for</span><span class="k2">(</span>j<span class="k3">=</span><span class="n">0</span><span class="k2">;</span>j<span class="k3">&lt;</span><span class="n">256</span><span class="k2">;</span>j<span class="k3">+</span><span class="k3">+</span><span class="k2">)</span>
<span class="number">  5</span><span class="k2">{</span>
<span class="number">  6</span><a href="http://www.allegro.cc/manual/ALLEGRO_LOCKED_REGION"><span class="a">ALLEGRO_LOCKED_REGION</span></a> <span class="k3">*</span>lr <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_lock_bitmap"><span class="a">al_lock_bitmap</span></a><span class="k2">(</span>my_screen, ALLEGRO_PIXEL_FORMAT_ARGB_8888, ALLEGRO_LOCK_WRITEONLY<span class="k2">)</span><span class="k2">;</span>
<span class="number">  7</span><span class="k1">unsigned</span> <span class="k1">int</span> <span class="k3">*</span>ptr <span class="k3">=</span> <span class="k2">(</span><span class="k1">unsigned</span> <span class="k1">int</span> <span class="k3">*</span><span class="k2">)</span>lr-&gt;data<span class="k2">;</span> <span class="c">//points to first pixel</span>
<span class="number">  8</span><span class="k1">for</span> <span class="k2">(</span>i<span class="k3">=</span><span class="n">0</span><span class="k2">;</span> i<span class="k3">&lt;</span>screen_pixels<span class="k2">;</span> i<span class="k3">+</span><span class="k3">+</span><span class="k2">)</span>
<span class="number">  9</span>ptr<span class="k2">[</span>i<span class="k2">]</span><span class="k3">=</span>i<span class="k3">+</span>j<span class="k3">*</span><span class="n">256</span><span class="k3">+</span>w<span class="k3">*</span><span class="n">65536</span><span class="k2">;</span>
<span class="number"> 10</span><a href="http://www.allegro.cc/manual/al_unlock_bitmap"><span class="a">al_unlock_bitmap</span></a><span class="k2">(</span>my_screen<span class="k2">)</span><span class="k2">;</span> 
<span class="number"> 11</span><a href="http://www.allegro.cc/manual/al_flip_display"><span class="a">al_flip_display</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 12</span><span class="c">//al_rest(0.01);</span>
<span class="number"> 13</span><span class="k2">}</span>
</div></div><p>

How so? The lock happens inside the double loop, right?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (beoran)</author>
		<pubDate>Thu, 08 May 2014 12:32:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/614217/1000409#target">Edgar Reynaldo</a> said:</div><div class="quote"><p> No, his code doesn&#39;t do that. The inner for loop is a one liner. </p></div></div><p>Yep he couldn&#39;t have done that with <span class="source-code">ALLEGRO_LOCK_WRITEONLY</span> cause he&#39;s bound to write all pixels, as per docs. </p><p>Just so I know, what would happen if one does not write all pixels? </p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/614217/1000390#target">Edgar Reynaldo</a> said:</div><div class="quote"><p> And this entire argument is moot anyway, because with A5 you could use shaders for direct pixel access, and then it would be GPU bound, and not CPU bound.</p></div></div><p>While is true that using shaders would accomplish this better, the argument is not moot since cake stated very clearly that he wants to use this programming technique for his engine and he&#39;s pretty much on track.</p><p>Anyway:</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/614217/1000388#target">the_cake</a> said:</div><div class="quote"><p> Oug ! What a joke ! maybe written with SDL but it will be a lot faster !</p></div></div><p>You know, I don&#39;t get your going around in circles, but this doesn&#39;t stand to logic...at least to me; SDL ha sa but that prevents your pixel access to be as fast as it should be, but usign an emulated blit over SDL itself should? </p><p>I admit I am not really clear on what you are going to do since I am n00b, but still I have difficulties in grasp this.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> Can you post a proof of what you are saying ?</p></div></div><p>Of course not, mine was a speculation under the aforementioned logic.</p><p>EDIT: adding vertical spacing</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">int</span> i, j, w<span class="k2">;</span>
<span class="k1">for</span><span class="k2">(</span>w<span class="k3">=</span><span class="n">0</span><span class="k2">;</span>w<span class="k3">&lt;</span><span class="n">256</span><span class="k2">;</span>w<span class="k3">+</span><span class="k3">+</span><span class="k2">)</span><span class="k2">{</span>
   <span class="k1">for</span><span class="k2">(</span>j<span class="k3">=</span><span class="n">0</span><span class="k2">;</span>j<span class="k3">&lt;</span><span class="n">256</span><span class="k2">;</span>j<span class="k3">+</span><span class="k3">+</span><span class="k2">)</span><span class="k2">{</span> 
      <a href="http://www.allegro.cc/manual/ALLEGRO_LOCKED_REGION"><span class="a">ALLEGRO_LOCKED_REGION</span></a> <span class="k3">*</span>lr <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_lock_bitmap"><span class="a">al_lock_bitmap</span></a><span class="k2">(</span>my_screen, ALLEGRO_PIXEL_FORMAT_ARGB_8888, ALLEGRO_LOCK_WRITEONLY<span class="k2">)</span><span class="k2">;</span>
      <span class="k1">unsigned</span> <span class="k1">int</span> <span class="k3">*</span>ptr <span class="k3">=</span> <span class="k2">(</span><span class="k1">unsigned</span> <span class="k1">int</span> <span class="k3">*</span><span class="k2">)</span>lr-&gt;data<span class="k2">;</span>

<div class="highlight">      <span class="k1">for</span> <span class="k2">(</span>i<span class="k3">=</span><span class="n">0</span><span class="k2">;</span> i<span class="k3">&lt;</span>screen_pixels<span class="k2">;</span> i<span class="k3">+</span><span class="k3">+</span><span class="k2">)</span> ptr<span class="k2">[</span>i<span class="k2">]</span><span class="k3">=</span>i<span class="k3">+</span>j<span class="k3">*</span><span class="n">256</span><span class="k3">+</span>w<span class="k3">*</span><span class="n">65536</span><span class="k2">;</span> </div>
      <a href="http://www.allegro.cc/manual/al_unlock_bitmap"><span class="a">al_unlock_bitmap</span></a><span class="k2">(</span>my_screen<span class="k2">)</span><span class="k2">;</span>
      <a href="http://www.allegro.cc/manual/al_flip_display"><span class="a">al_flip_display</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
   <span class="k2">}</span>
<span class="k2">}</span>
</pre></div></div><p>

he is unlocking after writing all pixels in the bitmap, not after only one, thou he is locking-&gt;unlocking for 655536 frames, to my understanding...am I wrong?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (pkrcel)</author>
		<pubDate>Thu, 08 May 2014 12:50:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Oh yeah, right, can&#39;t believe I missed that <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /> Anyway, there were other bugs, so I hope Edgar&#39;s example is helpful to the_cake.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (beoran)</author>
		<pubDate>Thu, 08 May 2014 13:25:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I like this guy! He writes code with bugs in it which cause lag, and then says &quot;that&#39;s it, I can&#39;t write my game because no library in existence is fast enough&quot;</p><p>Hey, the_cake, why don&#39;t you eff off. Nobhead.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dizzy Egg)</author>
		<pubDate>Thu, 08 May 2014 14:48:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>@Edgar: <br />You assume ALLEGRO_PIXEL_FORMAT_ABGR_8888 as native format, right? Wasn&#39;t that supposed to be &#39;default&#39;/&#39;native&#39; on most platforms? <br />At least that&#39;s what I get when I use ALLEGRO_PIXEL_FORMAT_ANY.</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/614217/1000418#target">pkrcel</a> said:</div><div class="quote"><p>
Just so I know, what would happen if one does not write all pixels? 
</p></div></div><p>
It&#39;s probably &#39;undefined&#39;, which means uninitialized memory I guess.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Polybios)</author>
		<pubDate>Thu, 08 May 2014 14:49:30 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><b>to pkrecl</b></p><p>&quot;<br />Quote:</p><p>Can you post a proof of what you are saying ?</p><p>Of course not, mine was a speculation under the aforementioned logic.<br />&quot;</p><p>Sorry, I wanted a proof that we are not forced to lock/unlock each frames from polybios</p><p><b>to beoran</b></p><p>I don&#39;t want to be bad but you really don&#39;t help, plz stay outside of this thread <img src="http://www.allegro.cc/forums/smileys/sad.gif" alt=":(" />, you are saying that the example provided by Edgar is helpful ? Just compare !</p><p><b>to Edgar Reynaldo</b></p><p>-So what do I need to do to have a bitmap image RGB with 3 bytes per pixel ?, and I would like to have the bitmap in a set of columns, that is to say that each pixel of the bitmap is accesed with ptr[dim_bitmap_y*x+y]...</p><p>-And do you know a method which is more rapid to not locking/unlocking each frames ? In fact it is also very important.</p><p>You don&#39;t really understand that Allegro is slow. I let you remenber that Doom 2 was not supposed to be launched with 3 ghz processor at the time.<br />then my engine will consume cpu time for the graphic calculation, IA, sound, network, events, physics. You have to understand that I need to not waste stupidly my cpu-time with powerless methods...</p><p>Can you post a working complete example ?</p><p><b>But I am also annoyed with that ****** mouse problem !</b></p><p>I saw the Allegro sources and the problem comes with that ClipCursor function :<br /><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms648383%28v=vs.85%29.aspx">http://msdn.microsoft.com/en-us/library/windows/desktop/ms648383%28v=vs.85%29.aspx</a><br />But I think that if I create my own cursor, the al_ungrab_cursor will work because as I understood, the problem is that the windows cursor is shared and we can&#39;t modify easily its state without the autorization of the other applications. I got to study that. <b>I am not the only one who got that problem</b> I am hoping we will solve this.</p><p>Maybe I should try a little longer that Allegro 5.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (the_cake)</author>
		<pubDate>Thu, 08 May 2014 15:21:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/614217/1000423#target">the_cake</a> said:</div><div class="quote"><p>You don&#39;t really understand that Allegro is slow</p></div></div><p>

It&#39;s not, you are.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Maybe I should try a little longer that Allegro 5</p></div></div><p>

Don&#39;t feel that you have to.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dizzy Egg)</author>
		<pubDate>Thu, 08 May 2014 15:40:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>oh come on Dizzy egg, you are not helping ! Can you understand that ?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (the_cake)</author>
		<pubDate>Thu, 08 May 2014 15:52:27 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;m just here for balance. You have a bunch of people trying to help you, but you don&#39;t want to accept that A5 is blisteringly fast (if you use it properly). This is great forum, full of helpful people....and me. And I say, get yourself a copy of GameMaker and do one, mug.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dizzy Egg)</author>
		<pubDate>Thu, 08 May 2014 15:59:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;m definitively off with that library, that al_ungrab_mouse doesn&#39;t work, there is plenty of other bugs, In fact instead of SDL, or assembly, I will try win32 programming.</p><p><b>to Dizzy Egg</b><br />And how can we progress , if we are not being criticized by ourselves or by the others ?</p><p>&quot;<br />I&#39;m just here for balance. You have a bunch of people trying to help you, but you don&#39;t want to accept that A5 is blisteringly fast (if you use it properly). This is great forum, full of helpful people....and me. And I say, get yourself a copy of GameMaker and do one, mug. <br />&quot;</p><p>You want a medal ? I am your father. No seriously, I really do not think you should take it that way.  <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" /></p><p>Anyway, Have a lot of fun with allegro 5 !
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (the_cake)</author>
		<pubDate>Thu, 08 May 2014 16:24:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;d reply in full but I feel it would be wasted since I understand the_cake won&#39;t come over to see the replys....</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/614217/1000283#target">the_cake</a> said:</div><div class="quote"><p> Yeah, I am a simple studient with limited time and resources, I got my own problems, my parents, my studies, my duties, papers managing you know...</p></div></div><p>...anyway I feel compelled to say that for not having time to contribute you surely have a LOT of time to waste to look for the holy grail.</p><p>And even if I blatantly have less understanding than you in these matters, I am fairly confident that YOU haven&#39;t fully understood what Edgar&#39;s example highlighted.</p><p>I couldn&#39;t try myself Edgar&#39;s example, but I remeber my last usage of <span class="source-code"><a href="http://www.allegro.cc/manual/al_lock_bitmap"><span class="a">al_lock_bitmap</span></a></span> and <span class="source-code"><a href="http://www.allegro.cc/manual/al_put_pixel"><span class="a">al_put_pixel</span></a></span> to create a pixel perfect collision mask would exceed 200FPS performance on my laptop, althou it was on a smaller bitmap than your 320x240 (I think I tested on a 200x200 but can&#39;t be arsed to check), AND CPU usage was not even close to 100% for sure.</p><p>I can&#39;t see on what basis you say that the Lib is not fast enuff for you and I strongly suspect that SDL itself was on par with these performances...</p><p>By the way, I guess asking something to <a href="http://en.wikipedia.org/wiki/John_carmack">this guy</a> can help in there regards.</p><p>Farewell
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (pkrcel)</author>
		<pubDate>Thu, 08 May 2014 16:57:57 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>the_cake ,</p><p>It&#39;s rather rude of you to talk in such a way to people who are trying to help you. You want to dish out criticism but seem unwilling to listen to it. That&#39;s not a good attitude. Also I see you are French? Perhaps you should learn a bit better English. Don&#39;t rely on tools such as google translate too much, that will lead to misunderstandings.</p><p>What exactly is the problem you are having with al_grab_mouse / al_ungrab_mouse? You keep complaining but it&#39;s not very clear what you want to achieve with it. Do you have some example code that demonstrates the problem.</p><p>Finally, since I wanted to show allegro is fast enough for your purposes, I wrote a fully executable example (in attachment). Compile it with `gcc -g -L/usr/local/lib pixel.c -lallegro -lallegro_primitives -o pixel` (on Linux)</p><p>It produces the following output for me`on an ultra cheap AMD laptop: <br />`Drew 500 frames in 5.335397 seconds or 93.713739 fps using al_put_pixel and locking<br />Drew 500 frames in 2.319453 seconds or 215.568067 fps using direct drawing and locking`</p><p>So even with al_put_pixel it is already quite fast. You only need 60 fps anyway, so that means you have a lot of CPU time left. And with direct draws you can even double the speed. </p><p>If you want to go faster on a contemporary system, then you should be doing the drawing using 3D models with OpenGL or DirectX, and not waste time on implementing your own software 3D engine. </p><p>Even if you use the Win32 API, the performance will not be that much faster than if you use Allegro, or SDL , since both libraries, on windows are thin wraper around the Win32 / Directx or OpenGL library (depending on how you compile them). And by using Win32 api directly, you lose portablity of your program and miss out on many convenient features.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (beoran)</author>
		<pubDate>Thu, 08 May 2014 17:39:18 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>While this is completely off topic, I&#39;d point out that this thread pushed me to download wolfstein3D source code.</p><p>I felt so nostalgic to see such old school C, but also I could say that JC wrote such way above-average code but <b>that also made eyes bleed</b> like almost everybody out there (except beoran of course, <tt>pixel.c</tt> is lovely <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /> )</p><p>There I found a useful <a href="ftp://ftp.idsoftware.com/idstuff/doom3/source/CodeStyleConventions.doc">doc</a> also. <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" /> <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" /> <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (pkrcel)</author>
		<pubDate>Thu, 08 May 2014 19:25:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/614217/1000423#target">the_cake</a> said:</div><div class="quote"><p>
to Edgar Reynaldo</p><p>-So what do I need to do to have a bitmap image RGB with 3 bytes per pixel ?, and I would like to have the bitmap in a set of columns, that is to say that each pixel of the bitmap is accesed with ptr[dim_bitmap_y*x+y]...</p><p>-And do you know a method which is more rapid to not locking/unlocking each frames ? In fact it is also very important.</p><p>You don&#39;t really understand that Allegro is slow. I let you remenber that Doom 2 was not supposed to be launched with 3 ghz processor at the time.<br />then my engine will consume cpu time for the graphic calculation, IA, sound, network, events, physics. You have to understand that I need to not waste stupidly my cpu-time with powerless methods...</p><p>Can you post a working complete example ?
</p></div></div><p>
Look up the 24 bit pixel formats and <span class="source-code">al_set_new_display_options</span> for details. It&#39;s in 5.1.</p><p>You could probably get a speed up by making a batched draw call, where you collect all your geometry and use something like <span class="source-code"><a href="http://www.allegro.cc/manual/al_draw_indexed_prim"><span class="a">al_draw_indexed_prim</span></a></span>.</p><p>Alright I made a generic test program called BitmapLocking.exe. Here are my results for a 320 X 200 window in Direct3D and OpenGL modes :
</p><pre>

c:\ctwoplus\progcode\allegro5\test&gt;BitmapLocking.exe 320 200 opengl 1000
Starting BitmapLocking in 320 X 200 windowed opengl with numframes = 1000
Pixel format of screen : 9
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 12.163923
FPS : 82.210321

c:\ctwoplus\progcode\allegro5\test&gt;BitmapLocking.exe 320 200 1000
Starting BitmapLocking in 320 X 200 windowed default with numframes = 1000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 1.051323
FPS : 951.182459
</pre><p>

Direct3D 320 X 200 Window 951FPS<br />OpenGL 320 X 200 Window 82FPS</p><p>Here are my results for 1280 X 800 Fullscreen with Direct3D and OpenGL :
</p><pre>

c:\ctwoplus\progcode\allegro5\test&gt;BitmapLocking.exe 1280 800 fullscreen
Starting BitmapLocking in 1280 X 800 fullscreen default with numframes = 1000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 11.102412
FPS : 90.070521

c:\ctwoplus\progcode\allegro5\test&gt;BitmapLocking.exe 1280 800 fullscreen opengl
Starting BitmapLocking in 1280 X 800 fullscreen opengl with numframes = 1000
Pixel format of screen : 9
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 163.307744
FPS : 6.123408

c:\ctwoplus\progcode\allegro5\test&gt;
</pre><p>

Direct3D 1280X800 Fullscreen 90FPS<br />OpenGL 1280X800 Fullscreen 6.1FPS</p><p>So there are some major issues with the OpenGL implementation. It is several factors slower than Direct3D when it comes to locking and uploading bitmaps.</p><p>Try the program yourself :
</p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">   1</span>
<span class="number">   2</span><span class="p">#include &lt;stdio.h&gt;</span>
<span class="number">   3</span><span class="p">#include &lt;stdlib.h&gt;</span>
<span class="number">   4</span><span class="p">#include &lt;string.h&gt;</span>
<span class="number">   5</span><span class="p">#include &lt;allegro5/allegro.h&gt;</span>
<span class="number">   6</span>
<span class="number">   7</span>
<span class="number">   8</span><span class="k1">int</span> SCREEN_WIDTH <span class="k3">=</span> <span class="n">800</span><span class="k2">;</span>
<span class="number">   9</span><span class="k1">int</span> SCREEN_HEIGHT <span class="k3">=</span> <span class="n">600</span><span class="k2">;</span>
<span class="number">  10</span><span class="k1">bool</span> fullscreen <span class="k3">=</span> <span class="k1">false</span><span class="k2">;</span>
<span class="number">  11</span><span class="k1">bool</span> opengl <span class="k3">=</span> <span class="k1">false</span><span class="k2">;</span>
<span class="number">  12</span><span class="k1">int</span> numframes <span class="k3">=</span> <span class="n">1000</span><span class="k2">;</span>
<span class="number">  13</span>
<span class="number">  14</span><span class="k1">int</span> main<span class="k2">(</span><span class="k1">int</span> argc, <span class="k1">char</span> <span class="k3">*</span><span class="k3">*</span>argv<span class="k2">)</span>
<span class="number">  15</span><span class="k2">{</span>
<span class="number">  16</span>   <a href="http://www.allegro.cc/manual/ALLEGRO_DISPLAY"><span class="a">ALLEGRO_DISPLAY</span></a> <span class="k3">*</span>display <span class="k3">=</span> NULL<span class="k2">;</span>
<span class="number">  17</span>
<span class="number">  18</span>   <span class="k1">if</span> <span class="k2">(</span>argc <span class="k3">=</span><span class="k3">=</span> <span class="n">1</span> <span class="k3">|</span><span class="k3">|</span> argc <span class="k3">=</span><span class="k3">=</span> <span class="n">3</span> <span class="k3">|</span><span class="k3">|</span> argc <span class="k3">=</span><span class="k3">=</span> <span class="n">4</span> <span class="k3">|</span><span class="k3">|</span> argc <span class="k3">=</span><span class="k3">=</span> <span class="n">5</span> <span class="k3">|</span><span class="k3">|</span> argc <span class="k3">=</span><span class="k3">=</span> <span class="n">6</span><span class="k2">)</span> <span class="k2">{</span>
<span class="number">  19</span>      <span class="k1">if</span> <span class="k2">(</span>argc <span class="k3">=</span><span class="k3">=</span> <span class="n">3</span> <span class="k3">|</span><span class="k3">|</span> argc <span class="k3">=</span><span class="k3">=</span> <span class="n">4</span> <span class="k3">|</span><span class="k3">|</span> argc <span class="k3">=</span><span class="k3">=</span> <span class="n">5</span> <span class="k3">|</span><span class="k3">|</span> argc <span class="k3">=</span><span class="k3">=</span> <span class="n">6</span><span class="k2">)</span> <span class="k2">{</span>
<span class="number">  20</span>         SCREEN_WIDTH <span class="k3">=</span> <a href="http://www.delorie.com/djgpp/doc/libc/libc_54.html" target="_blank">atoi</a><span class="k2">(</span>argv<span class="k2">[</span><span class="n">1</span><span class="k2">]</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  21</span>         SCREEN_HEIGHT <span class="k3">=</span> <a href="http://www.delorie.com/djgpp/doc/libc/libc_54.html" target="_blank">atoi</a><span class="k2">(</span>argv<span class="k2">[</span><span class="n">2</span><span class="k2">]</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  22</span>      <span class="k2">}</span>
<span class="number">  23</span>      <span class="k1">if</span> <span class="k2">(</span>argc <span class="k3">=</span><span class="k3">=</span> <span class="n">4</span> <span class="k3">|</span><span class="k3">|</span> argc <span class="k3">=</span><span class="k3">=</span> <span class="n">5</span> <span class="k3">|</span><span class="k3">|</span> argc <span class="k3">=</span><span class="k3">=</span> <span class="n">6</span><span class="k2">)</span> <span class="k2">{</span>
<span class="number">  24</span>         fullscreen <span class="k3">=</span> <span class="k2">(</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_754.html" target="_blank">strcmp</a><span class="k2">(</span><span class="s">"fullscreen"</span> , argv<span class="k2">[</span><span class="n">3</span><span class="k2">]</span><span class="k2">)</span> <span class="k3">=</span><span class="k3">=</span> <span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  25</span>         <span class="k1">if</span> <span class="k2">(</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_754.html" target="_blank">strcmp</a><span class="k2">(</span><span class="s">"fullscreen"</span> , argv<span class="k2">[</span><span class="n">3</span><span class="k2">]</span> <span class="k2">)</span> <span class="k3">=</span><span class="k3">=</span> <span class="n">0</span><span class="k2">)</span> <span class="k2">{</span>
<span class="number">  26</span>            fullscreen <span class="k3">=</span> <span class="k1">true</span><span class="k2">;</span>
<span class="number">  27</span>         <span class="k2">}</span>
<span class="number">  28</span>         <span class="k1">if</span> <span class="k2">(</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_754.html" target="_blank">strcmp</a><span class="k2">(</span><span class="s">"opengl"</span> , argv<span class="k2">[</span><span class="n">3</span><span class="k2">]</span><span class="k2">)</span> <span class="k3">=</span><span class="k3">=</span> <span class="n">0</span><span class="k2">)</span> <span class="k2">{</span>
<span class="number">  29</span>            opengl <span class="k3">=</span> <span class="k1">true</span><span class="k2">;</span>
<span class="number">  30</span>         <span class="k2">}</span>
<span class="number">  31</span>         <span class="k1">if</span> <span class="k2">(</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_54.html" target="_blank">atoi</a><span class="k2">(</span>argv<span class="k2">[</span><span class="n">3</span><span class="k2">]</span><span class="k2">)</span> <span class="k3">!</span><span class="k3">=</span> <span class="n">0</span><span class="k2">)</span> <span class="k2">{</span>
<span class="number">  32</span>            numframes <span class="k3">=</span> <a href="http://www.delorie.com/djgpp/doc/libc/libc_54.html" target="_blank">atoi</a><span class="k2">(</span>argv<span class="k2">[</span><span class="n">3</span><span class="k2">]</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  33</span>         <span class="k2">}</span>
<span class="number">  34</span>         <span class="k1">if</span> <span class="k2">(</span>argc <span class="k3">=</span><span class="k3">=</span> <span class="n">5</span><span class="k2">)</span> <span class="k2">{</span>
<span class="number">  35</span>            <span class="k1">if</span> <span class="k2">(</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_754.html" target="_blank">strcmp</a><span class="k2">(</span><span class="s">"fullscreen"</span> , argv<span class="k2">[</span><span class="n">4</span><span class="k2">]</span> <span class="k2">)</span> <span class="k3">=</span><span class="k3">=</span> <span class="n">0</span><span class="k2">)</span> <span class="k2">{</span>
<span class="number">  36</span>               fullscreen <span class="k3">=</span> <span class="k1">true</span><span class="k2">;</span>
<span class="number">  37</span>            <span class="k2">}</span>
<span class="number">  38</span>            <span class="k1">if</span> <span class="k2">(</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_754.html" target="_blank">strcmp</a><span class="k2">(</span><span class="s">"opengl"</span> , argv<span class="k2">[</span><span class="n">4</span><span class="k2">]</span><span class="k2">)</span> <span class="k3">=</span><span class="k3">=</span> <span class="n">0</span><span class="k2">)</span> <span class="k2">{</span>
<span class="number">  39</span>               opengl <span class="k3">=</span> <span class="k1">true</span><span class="k2">;</span>
<span class="number">  40</span>            <span class="k2">}</span>
<span class="number">  41</span>            <span class="k1">if</span> <span class="k2">(</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_54.html" target="_blank">atoi</a><span class="k2">(</span>argv<span class="k2">[</span><span class="n">4</span><span class="k2">]</span><span class="k2">)</span> <span class="k3">!</span><span class="k3">=</span> <span class="n">0</span><span class="k2">)</span> <span class="k2">{</span>
<span class="number">  42</span>               numframes <span class="k3">=</span> <a href="http://www.delorie.com/djgpp/doc/libc/libc_54.html" target="_blank">atoi</a><span class="k2">(</span>argv<span class="k2">[</span><span class="n">4</span><span class="k2">]</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  43</span>            <span class="k2">}</span>
<span class="number">  44</span>         <span class="k2">}</span>
<span class="number">  45</span>         <span class="k1">if</span> <span class="k2">(</span>argc <span class="k3">=</span><span class="k3">=</span> <span class="n">6</span><span class="k2">)</span> <span class="k2">{</span>
<span class="number">  46</span>            numframes <span class="k3">=</span> <a href="http://www.delorie.com/djgpp/doc/libc/libc_54.html" target="_blank">atoi</a><span class="k2">(</span>argv<span class="k2">[</span><span class="n">5</span><span class="k2">]</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  47</span>         <span class="k2">}</span>
<span class="number">  48</span>      <span class="k2">}</span>
<span class="number">  49</span>   <span class="k2">}</span>
<span class="number">  50</span>   <span class="k1">else</span> <span class="k2">{</span>
<span class="number">  51</span>      <a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"Usage : BitmapLocking.exe WIDTH HEIGHT [fullscreen] [opengl] [#frames]\n"</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  52</span>   <span class="k2">}</span>
<span class="number">  53</span>
<span class="number">  54</span>   <a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"Starting BitmapLocking in %d X %d %s %s with numframes = %d\n"</span> , SCREEN_WIDTH , SCREEN_HEIGHT ,
<span class="number">  55</span>          fullscreen?<span class="s">"fullscreen"</span><span class="k2">:</span><span class="s">"windowed"</span> , opengl?<span class="s">"opengl"</span><span class="k2">:</span><span class="s">"default"</span> , numframes<span class="k2">)</span><span class="k2">;</span>
<span class="number">  56</span>
<span class="number">  57</span>   <span class="k1">if</span><span class="k2">(</span><span class="k3">!</span><a href="http://www.allegro.cc/manual/al_init"><span class="a">al_init</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">)</span>
<span class="number">  58</span>   <span class="k2">{</span>
<span class="number">  59</span>      <a href="http://www.delorie.com/djgpp/doc/libc/libc_345.html" target="_blank">fprintf</a><span class="k2">(</span>stderr, <span class="s">"failed to initialize allegro!\n"</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  60</span>      <span class="k1">return</span> <span class="k3">-</span><span class="n">1</span><span class="k2">;</span>
<span class="number">  61</span>   <span class="k2">}</span>
<span class="number">  62</span>
<span class="number">  63</span>   <a href="http://www.allegro.cc/manual/al_install_keyboard"><span class="a">al_install_keyboard</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  64</span>
<span class="number">  65</span>   <span class="c">//al_set_new_display_flags(ALLEGRO_FULLSCREEN);</span>
<span class="number">  66</span>   <a href="http://www.allegro.cc/manual/al_set_new_display_option"><span class="a">al_set_new_display_option</span></a><span class="k2">(</span>ALLEGRO_COLOR_SIZE , <span class="n">32</span> , ALLEGRO_REQUIRE<span class="k2">)</span><span class="k2">;</span>
<span class="number">  67</span>   <span class="k1">if</span> <span class="k2">(</span>fullscreen<span class="k2">)</span> <span class="k2">{</span>
<span class="number">  68</span>      <span class="k1">if</span> <span class="k2">(</span>opengl<span class="k2">)</span> <span class="k2">{</span>
<span class="number">  69</span>         <a href="http://www.allegro.cc/manual/al_set_new_display_flags"><span class="a">al_set_new_display_flags</span></a><span class="k2">(</span>ALLEGRO_FULLSCREEN <span class="k3">|</span> ALLEGRO_OPENGL<span class="k2">)</span><span class="k2">;</span>
<span class="number">  70</span>      <span class="k2">}</span>
<span class="number">  71</span>      <span class="k1">else</span> <span class="k2">{</span>
<span class="number">  72</span>         <a href="http://www.allegro.cc/manual/al_set_new_display_flags"><span class="a">al_set_new_display_flags</span></a><span class="k2">(</span>ALLEGRO_FULLSCREEN<span class="k2">)</span><span class="k2">;</span>
<span class="number">  73</span>      <span class="k2">}</span>
<span class="number">  74</span>   <span class="k2">}</span>
<span class="number">  75</span>   <span class="k1">else</span> <span class="k2">{</span>
<span class="number">  76</span>      <span class="k1">if</span> <span class="k2">(</span>opengl<span class="k2">)</span> <span class="k2">{</span>
<span class="number">  77</span>         <a href="http://www.allegro.cc/manual/al_set_new_display_flags"><span class="a">al_set_new_display_flags</span></a><span class="k2">(</span>ALLEGRO_WINDOWED <span class="k3">|</span> ALLEGRO_OPENGL<span class="k2">)</span><span class="k2">;</span>
<span class="number">  78</span>      <span class="k2">}</span>
<span class="number">  79</span>      <span class="k1">else</span> <span class="k2">{</span>
<span class="number">  80</span>         <a href="http://www.allegro.cc/manual/al_set_new_display_flags"><span class="a">al_set_new_display_flags</span></a><span class="k2">(</span>ALLEGRO_WINDOWED<span class="k2">)</span><span class="k2">;</span>
<span class="number">  81</span>      <span class="k2">}</span>
<span class="number">  82</span>   <span class="k2">}</span>
<span class="number">  83</span>   
<span class="number">  84</span>   display <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_create_display"><span class="a">al_create_display</span></a><span class="k2">(</span>SCREEN_WIDTH , SCREEN_HEIGHT<span class="k2">)</span><span class="k2">;</span>
<span class="number">  85</span>   <span class="k1">if</span><span class="k2">(</span><span class="k3">!</span>display<span class="k2">)</span>
<span class="number">  86</span>   <span class="k2">{</span>
<span class="number">  87</span>      <a href="http://www.delorie.com/djgpp/doc/libc/libc_345.html" target="_blank">fprintf</a><span class="k2">(</span>stderr, <span class="s">"failed to create display!\n"</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  88</span>      <span class="k1">return</span> <span class="k3">-</span><span class="n">1</span><span class="k2">;</span>
<span class="number">  89</span>   <span class="k2">}</span>
<span class="number">  90</span>   
<span class="number">  91</span>   <a href="http://www.allegro.cc/manual/ALLEGRO_EVENT_QUEUE"><span class="a">ALLEGRO_EVENT_QUEUE</span></a><span class="k3">*</span> queue <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_create_event_queue"><span class="a">al_create_event_queue</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  92</span>   <a href="http://www.allegro.cc/manual/al_register_event_source"><span class="a">al_register_event_source</span></a><span class="k2">(</span>queue , <a href="http://www.allegro.cc/manual/al_get_display_event_source"><span class="a">al_get_display_event_source</span></a><span class="k2">(</span>display<span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  93</span>   <a href="http://www.allegro.cc/manual/al_register_event_source"><span class="a">al_register_event_source</span></a><span class="k2">(</span>queue , <a href="http://www.allegro.cc/manual/al_get_keyboard_event_source"><span class="a">al_get_keyboard_event_source</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  94</span>   
<span class="number">  95</span>   
<span class="number">  96</span>   
<span class="number">  97</span>   
<span class="number">  98</span>   <a href="http://www.allegro.cc/manual/ALLEGRO_BITMAP"><span class="a">ALLEGRO_BITMAP</span></a><span class="k3">*</span> <a href="http://www.allegro.cc/manual/screen"><span class="a">screen</span></a> <span class="k3">=</span> NULL<span class="k2">;</span>
<span class="number">  99</span>   
<span class="number"> 100</span>   <span class="k1">double</span> start_time <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_get_time"><span class="a">al_get_time</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 101</span>   
<span class="number"> 102</span>   <a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"Pixel format of screen : %d\n"</span> , <a href="http://www.allegro.cc/manual/al_get_bitmap_format"><span class="a">al_get_bitmap_format</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/al_get_backbuffer"><span class="a">al_get_backbuffer</span></a><span class="k2">(</span>display<span class="k2">)</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 103</span>   <a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : %d\n"</span> , ALLEGRO_PIXEL_FORMAT_ARGB_8888<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 104</span>   <a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : %d\n"</span> , ALLEGRO_PIXEL_FORMAT_RGBA_8888<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 105</span>   <a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : %d\n"</span> , ALLEGRO_PIXEL_FORMAT_ABGR_8888<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 106</span>   <a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : %d\n"</span> , ALLEGRO_PIXEL_FORMAT_XBGR_8888<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 107</span>   <a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : %d\n"</span> , ALLEGRO_PIXEL_FORMAT_RGBX_8888<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 108</span>   <a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : %d\n"</span> , ALLEGRO_PIXEL_FORMAT_XRGB_8888<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 109</span>   
<span class="number"> 110</span>   <span class="k1">bool</span> quit <span class="k3">=</span> <span class="k1">false</span><span class="k2">;</span>
<span class="number"> 111</span>   
<span class="number"> 112</span>   <span class="k1">int</span> n <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span>
<span class="number"> 113</span>   
<span class="number"> 114</span>   <span class="k1">do</span> <span class="k2">{</span>
<span class="number"> 115</span>      <a href="http://www.allegro.cc/manual/screen"><span class="a">screen</span></a> <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_get_backbuffer"><span class="a">al_get_backbuffer</span></a><span class="k2">(</span>display<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 116</span>      <a href="http://www.allegro.cc/manual/ALLEGRO_LOCKED_REGION"><span class="a">ALLEGRO_LOCKED_REGION</span></a><span class="k3">*</span> lr <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_lock_bitmap"><span class="a">al_lock_bitmap</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/screen"><span class="a">screen</span></a> , <a href="http://www.allegro.cc/manual/al_get_bitmap_format"><span class="a">al_get_bitmap_format</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/screen"><span class="a">screen</span></a><span class="k2">)</span> , ALLEGRO_LOCK_WRITEONLY<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 117</span>      <span class="k1">for</span> <span class="k2">(</span><span class="k1">int</span> nlines <span class="k3">=</span> <span class="n">0</span> <span class="k2">;</span> nlines <span class="k3">&lt;</span> SCREEN_HEIGHT <span class="k2">;</span> <span class="k3">+</span><span class="k3">+</span>nlines<span class="k2">)</span> <span class="k2">{</span>
<span class="number"> 118</span>         <span class="k1">unsigned</span> <span class="k1">int</span><span class="k3">*</span> dat <span class="k3">=</span> <span class="k2">(</span><span class="k1">unsigned</span> <span class="k1">int</span><span class="k3">*</span><span class="k2">)</span><span class="k2">(</span><span class="k2">(</span><span class="k1">unsigned</span> <span class="k1">char</span><span class="k3">*</span><span class="k2">)</span>lr-&gt;data <span class="k3">+</span> lr-&gt;pitch<span class="k3">*</span>nlines<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 119</span>         <span class="k1">for</span> <span class="k2">(</span><span class="k1">int</span> pixel <span class="k3">=</span> <span class="n">0</span> <span class="k2">;</span> pixel <span class="k3">&lt;</span> SCREEN_WIDTH <span class="k2">;</span> <span class="k3">+</span><span class="k3">+</span>pixel<span class="k2">)</span> <span class="k2">{</span>
<span class="number"> 120</span>            <span class="k1">int</span> r <span class="k3">=</span> <span class="k2">(</span>nlines%<span class="n">256</span><span class="k2">)</span><span class="k3">*</span><span class="n">256</span><span class="k2">;</span>
<span class="number"> 121</span>            <span class="k1">int</span> g <span class="k3">=</span> <span class="k2">(</span>n%<span class="n">256</span><span class="k2">)</span><span class="k3">*</span><span class="n">65536</span><span class="k2">;</span>
<span class="number"> 122</span>            <span class="k1">int</span> b <span class="k3">=</span> <span class="k2">(</span>pixel%<span class="n">256</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 123</span>            dat<span class="k2">[</span>pixel<span class="k2">]</span> <span class="k3">=</span> r <span class="k3">+</span> g <span class="k3">+</span> b<span class="k2">;</span>
<span class="number"> 124</span>         <span class="k2">}</span>
<span class="number"> 125</span>      <span class="k2">}</span>
<span class="number"> 126</span>      <a href="http://www.allegro.cc/manual/al_unlock_bitmap"><span class="a">al_unlock_bitmap</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/screen"><span class="a">screen</span></a><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 127</span>      <a href="http://www.allegro.cc/manual/al_flip_display"><span class="a">al_flip_display</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 128</span><span class="c">//      printf("n = %d\n" , n);</span>
<span class="number"> 129</span>      <span class="k3">+</span><span class="k3">+</span>n<span class="k2">;</span>
<span class="number"> 130</span>   
<span class="number"> 131</span>      <span class="k1">do</span> <span class="k2">{</span>
<span class="number"> 132</span>         <a href="http://www.allegro.cc/manual/ALLEGRO_EVENT"><span class="a">ALLEGRO_EVENT</span></a> ev<span class="k2">;</span>
<span class="number"> 133</span>         <span class="k1">if</span> <span class="k2">(</span>n <span class="k3">&gt;</span><span class="k3">=</span> numframes<span class="k2">)</span> <span class="k2">{</span>quit <span class="k3">=</span> <span class="k1">true</span><span class="k2">;</span><span class="k2">}</span>
<span class="number"> 134</span>         <span class="k1">if</span> <span class="k2">(</span><a href="http://www.allegro.cc/manual/al_get_next_event"><span class="a">al_get_next_event</span></a><span class="k2">(</span>queue , <span class="k3">&amp;</span>ev<span class="k2">)</span><span class="k2">)</span> <span class="k2">{</span>
<span class="number"> 135</span>            <span class="k1">if</span> <span class="k2">(</span>ev.type <span class="k3">=</span><span class="k3">=</span> ALLEGRO_EVENT_KEY_DOWN <span class="k3">&amp;</span><span class="k3">&amp;</span> ev.keyboard.keycode <span class="k3">=</span><span class="k3">=</span> ALLEGRO_KEY_ESCAPE<span class="k2">)</span> <span class="k2">{</span>
<span class="number"> 136</span>               quit <span class="k3">=</span> <span class="k1">true</span><span class="k2">;</span>
<span class="number"> 137</span>            <span class="k2">}</span>
<span class="number"> 138</span>            <span class="k1">else</span> <span class="k1">if</span> <span class="k2">(</span>ev.type <span class="k3">=</span><span class="k3">=</span> ALLEGRO_EVENT_DISPLAY_CLOSE<span class="k2">)</span> <span class="k2">{</span>quit <span class="k3">=</span> <span class="k1">true</span><span class="k2">;</span><span class="k2">}</span>
<span class="number"> 139</span>            
<span class="number"> 140</span>         <span class="k2">}</span>
<span class="number"> 141</span>         <span class="k1">else</span> <span class="k2">{</span>
<span class="number"> 142</span>            <span class="k1">break</span><span class="k2">;</span>
<span class="number"> 143</span>         <span class="k2">}</span>
<span class="number"> 144</span>      <span class="k2">}</span> <span class="k1">while</span> <span class="k2">(</span><span class="n">1</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 145</span>   <span class="k2">}</span> <span class="k1">while</span> <span class="k2">(</span><span class="k3">!</span>quit<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 146</span>   
<span class="number"> 147</span>   <span class="k1">double</span> total_time <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_get_time"><span class="a">al_get_time</span></a><span class="k2">(</span><span class="k2">)</span> <span class="k3">-</span> start_time<span class="k2">;</span>
<span class="number"> 148</span>   <a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"Total time taken : %f\n"</span> , total_time<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 149</span>   <a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"FPS : %f\n"</span> , n<span class="k3">/</span>total_time<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 150</span>
<span class="number"> 151</span>   <span class="k1">return</span> <span class="n">0</span><span class="k2">;</span>
<span class="number"> 152</span><span class="k2">}</span>
</div></div><p>

<a href="https://www.allegro.cc/files/attachment/608563">BitmapLocking.7z</a> Binaries + dlls + source</p><p>Run from command line :
</p><pre>
Usage : BitmapLocking.exe WIDTH HEIGHT [fullscreen] [opengl] [#frames]
c:&gt;
</pre><p>

Direct3D should be more than fast enough for you. OpenGL seems to need some work though.</p><p><span class="remote-thumbnail"><span class="json">{"name":"608564","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/9\/7\/9711a31e166b4088f77e46336e5cb0ba.png","w":1280,"h":800,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/9\/7\/9711a31e166b4088f77e46336e5cb0ba"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/9/7/9711a31e166b4088f77e46336e5cb0ba-240.jpg" alt="608564" width="240" height="150" /></span>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Fri, 09 May 2014 07:12:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>A side not: Edgar, you don&#39;t need OpenAL on Windows. Your test program is missing that .dll.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (AMCerasoli)</author>
		<pubDate>Fri, 09 May 2014 14:47:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>That&#39;s a dependency of the monolith I linked to.</p><p>I&#39;ll upload it in a while.</p><p>Edit - here&#39;s the updated 7zip of the binary and source and dlls</p><p><s><a href="https://www.allegro.cc/files/attachment/608575">BitmapLocking.7z</a></s><br />Fixed a bug in parameter processing :<br /><a href="https://d1cxvcw9gjxu2x.cloudfront.net/attachments/608576">BitmapLocking.7z</a></p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/614217/1000460#target">Edgar Reynaldo</a> said:</div><div class="quote"><p>
Direct3D 320 X 200 Window 951FPS<br />OpenGL 320 X 200 Window 82FPS</p><p>Direct3D 800X600 Fullscreen 192FPS<br />OpenGL 800X600 Fullscreen 13.5FPS</p><p>Direct3D 1280X800 Fullscreen 90FPS<br />OpenGL 1280X800 Fullscreen 6.1FPS
</p></div></div><p>

c:\ctwoplus\progcode\allegro5\test\BitmapLocking&gt;</p><p>Anybody have any idea why bitmap locking is so unbearably slow with OpenGL? Or is it just my crappy laptop with OpenGL 2 again... (Note to self : I have to test this on my desktop.)</p><p><u><b>Edit2</b></u><br />Fixed link to download. All should be good now.</p><p>Tested on my desktop, and OpenGL is still noticeably slower :
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
800 X 600 Direct3D fullscreen 304.3FPS , 3.287 seconds for 1000 frames<br />800 X 600 OpenGL fullscreen 124.9FPS , 8.008 seconds for 1000 frames</p><p>800 X 600 Direct3D window 284.1FPS , 3.52 seconds for 1000 frames<br />800 X 600 OpenGL window 128.6FPS , 7.774 seconds for 1000 frames</p><p>1600 X 1200 Direct3D fullscreen 79.9FPS, 12.51 seconds for 1000 frames<br />1600 X 1200 OpenGL fullscreen 31.3FPS , 31.98 seconds for 1000 frames
</p></div></div><p>

My desktop CPU is noticeably faster, but OpenGL still lags behind by a factor of 2 to 3, which is disappointing.</p><p>Can other people test this, and see what results they get? The source should work as is with Linux and OSX, you just don&#39;t need to specify opengl on the command line.</p><pre>Usage : BitmapLocking.exe WIDTH HEIGHT [fullscreen] [opengl] [#frames]</pre><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Mon, 19 May 2014 07:52:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I don&#39;t know, in my case it looks like something is blocking the framerate when the display is set on fullscreen, I have been messing with Vsync on my graphic card, might be related. Too many 60Hz over there.</p><pre class="terminal scroll">Starting BitmapLocking in 800 X 600 fullscreen default with numframes = 1000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 16.515444
FPS : 60.549388

Starting BitmapLocking in 800 X 600 fullscreen opengl with numframes = 1000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 17.812546
FPS : 56.140205

Starting BitmapLocking in 800 X 600 windowed default with numframes = 1000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 3.498927
FPS : 285.801940

Starting BitmapLocking in 800 X 600 windowed opengl with numframes = 1000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 16.663655
FPS : 60.010845

Starting BitmapLocking in 1600 X 1200 fullscreen default with numframes = 1000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 16.609768
FPS : 60.205537

Starting BitmapLocking in 1600 X 1200 fullscreen opengl with numframes = 1000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 16.815327
FPS : 59.469554</pre><p>

Yep confirmed, My graphic card was blocking the drawing operations. Aww I don&#39;t want to run the tests again.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (AMCerasoli)</author>
		<pubDate>Mon, 19 May 2014 12:15:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Every problem I already have regarding OpenGL performance was a driver related one or a side effect of vsync and buffering.</p><p>I even had to use an outdated version of nvidia laptop pilot due to the new one being crappy with opengl.</p><p>Note that a lot of driver have vsync and triple buffering enable in opengl.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (GullRaDriel)</author>
		<pubDate>Mon, 19 May 2014 18:53:12 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I just tried your example on my system.  It has a GeForce GTX650 which has OpenGl 4.4 and DirectX 11, latest drivers.  With VSync on on my driver settings it got 52FPS with OpenGL, when I shut VSync off I got the following, much better rate.  My monitor refresh is 60hz.</p><pre>
D:\Downloads\Allegro\BitmapLocking&gt;BitmapLocking.exe 1280 800 fullscreen opengl
Starting BitmapLocking in 1280 X 800 fullscreen opengl with numframes = 1000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 8.837769
FPS : 113.150733
</pre><p>

Without OpenGL and no VSync:</p><pre>
D:\Downloads\Allegro\BitmapLocking&gt;BitmapLocking.exe 1280 800 fullscreen
Starting BitmapLocking in 1280 X 800 fullscreen default with numframes = 1000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 4.106563
FPS : 243.512620
</pre><p>

Does seem too shabby.</p><p>Edit: And just for fun, at 1920x1080 (no VSync) <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><pre>
D:\Downloads\Allegro\BitmapLocking&gt;BitmapLocking.exe 1920 1080 fullscreen opengl

Starting BitmapLocking in 1920 X 1080 fullscreen opengl with numframes = 1000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 20.649569
FPS : 48.427161

D:\Downloads\Allegro\BitmapLocking&gt;BitmapLocking.exe 1920 1080 fullscreen
Starting BitmapLocking in 1920 X 1080 fullscreen default with numframes = 1000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 10.109041
FPS : 98.921349
</pre><p>

Again, not too shabby.</p><p>Finally, I tried 320x240, but as already mentioned, it is no longer supported in fullscren (in either DirectX or OpenGL) so I went to the next higher, 640x480 as was suggested and got these results (note: DirectX was so fast I didn&#39;t see it, I think I blinked and it was done! <img src="http://www.allegro.cc/forums/smileys/shocked.gif" alt=":o" /> )</p><pre>
D:\Downloads\Allegro\BitmapLocking&gt;BitmapLocking.exe 640 480 fullscreen opengl
Starting BitmapLocking in 640 X 480 fullscreen opengl with numframes = 1000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 4.968636
FPS : 201.262462

D:\Downloads\Allegro\BitmapLocking&gt;BitmapLocking.exe 640 480 fullscreen
Starting BitmapLocking in 640 X 480 fullscreen default with numframes = 1000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 1.611690
FPS : 620.466638
</pre><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Roy)</author>
		<pubDate>Tue, 20 May 2014 09:01:00 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Well, that&#39;s still about a factor of 2, and a factor of 3 in your last test. If I can get a profiling build working then maybe I can see where all the time is being spent with the opengl driver.</p><p>And I think it&#39;s actually CPU bound, except for the part where it uploads stuff to the gfx card. What kind of CPU were you using on that last test?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Tue, 20 May 2014 09:33:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Maybe you should run with more frames. if it opens and closes that fast, its not much of a test.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Tue, 20 May 2014 18:46:06 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If OpenGL wasn&#39;t so slow I would, but I can use more frames with DirectX though. Really, 1000 frames is a decent sample size, but you&#39;re right some of the tests could use more. You can specify the number of frames as the last parameter in the command line arguments to the program.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Wed, 21 May 2014 03:02:51 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>In all tests I have an &quot;AMD Athlon II X3 440 CPU - 3GHz (3 cores)&quot;</p><p>A fairly inexpensive CPU (around $90 Canadian) when I bought it a few years ago.</p><p>I also have 10Gigs of RAM(64bit system) if that effects anything at all.</p><p>Edit: Okay, I ran the tests again with a sample size of 10000!</p><p>CPU: AMD Athlon II X3 440 CPU - 3GHz (3 cores)<br />Video Card: GeForce GTX650<br />Driver version: 337.5<br />OpenGL Version: 4.4<br />DirectX Version: 11<br />Total RAM: 10Gigs<br />Operating system: Windows 7 - 64bit</p><pre>
D:\Downloads\Allegro\BitmapLocking&gt;BitmapLocking.exe 640 480 fullscreen 10000
Starting BitmapLocking in 640 X 480 fullscreen default with numframes = 10000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 21.037207
FPS : 475.348283

D:\Downloads\Allegro\BitmapLocking&gt;BitmapLocking.exe 640 480 fullscreen opengl 1
0000
Starting BitmapLocking in 640 X 480 fullscreen opengl with numframes = 10000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 57.823506
FPS : 172.940049
</pre><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Roy)</author>
		<pubDate>Wed, 21 May 2014 05:10:31 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>A driver update might help. OpenGL depends on the quality of the drivers for gpu pretty heavily.</p><p>For a long time D3D was done better on windows because most games used it. But OpenGL is starting to gain more traction again due to ease of porting between OSX, mobile and windows (and a little linux, when the dev cares).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Wed, 21 May 2014 05:16:00 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Oh, and because the original poster was insistent on 320x200... <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /></p><pre>
D:\Downloads\Allegro\BitmapLocking&gt;BitmapLocking.exe 320 200
Starting BitmapLocking in 320 X 200 windowed default with numframes = 1000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 0.865257
FPS : 1155.725411
</pre><p>

Could ONLY do it in a Window and any library that states they can do a proper 320x200 or 320x240 fullscreen is just plain lying to you.</p><p>I would say 1155 FPS is pretty damn decent! <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Roy)</author>
		<pubDate>Wed, 21 May 2014 05:27:55 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I ran it on my lappy: core i7 2 Ghz, 6GBDDR3, ATI 7800</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/614217/1000460#target">BitmapLocking tests</a> said:</div><div class="quote"><p>
C:\Users\Gull\Downloads\BitmapLocking&gt;BitmapLocking.exe 320 200 opengl 1000<br />Starting BitmapLocking in 320 X 200 windowed opengl with numframes = 1000<br />Pixel format of screen : 9<br />ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9<br />ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10<br />ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17<br />ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18<br />ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22<br />ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23<br />Total time taken : 0.322209<br />FPS : 3103.580080</p><p>C:\Users\Gull\Downloads\BitmapLocking&gt;BitmapLocking.exe 320 200 1000<br />Starting BitmapLocking in 320 X 200 windowed default with numframes = 1000<br />Pixel format of screen : 23<br />ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9<br />ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10<br />ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17<br />ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18<br />ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22<br />ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23<br />Total time taken : 0.438929<br />FPS : 2278.271015</p><p>C:\Users\Gull\Downloads\BitmapLocking&gt;BitmapLocking.exe 1280 800 fullscreen<br />Starting BitmapLocking in 1280 X 800 fullscreen default with numframes = 1000<br />Pixel format of screen : 23<br />ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9<br />ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10<br />ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17<br />ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18<br />ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22<br />ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23<br />Total time taken : 2.859705<br />FPS : 349.686402</p><p>C:\Users\Gull\Downloads\BitmapLocking&gt;BitmapLocking.exe 1280 800 fullscreen opengl<br />Starting BitmapLocking in 1280 X 800 fullscreen opengl with numframes = 1000<br />Pixel format of screen : 9<br />ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9<br />ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10<br />ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17<br />ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18<br />ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22<br />ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23<br />Total time taken : 4.464054<br />FPS : 224.011619
</p></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (GullRaDriel)</author>
		<pubDate>Thu, 22 May 2014 03:03:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Gully, since your processor is so fast, could you run the test with more frames? It&#39;s hard to tell if the results are useful or not. Just use like 10000 or something. That shouldn&#39;t take too long on your computer. For the 320 X 200 mode you could probably even use 50 or 100 thousand frames as well.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Thu, 22 May 2014 03:15:00 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Wow GullRaDriel, on an ATI your test done much better with OpenGL.  I wonder if this is common for ATI cards, or just due to your CPU?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Roy)</author>
		<pubDate>Thu, 22 May 2014 04:42:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I go the following results using 10000 frames (CPU: i7-3930K @ 3.2Ghz, GPU: GeForce 680):</p><pre>C:\Users\LennyLen\Desktop\bl&gt;BitmapLocking.exe 320 200 10000
Starting BitmapLocking in 320 X 200 windowed default with numframes = 10000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 1.254570
FPS : 7970.855553

C:\Users\LennyLen\Desktop\bl&gt;BitmapLocking.exe 320 200 opengl 10000
Starting BitmapLocking in 320 X 200 windowed opengl with numframes = 10000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 3.439915
FPS : 2907.048658

C:\Users\LennyLen\Desktop\bl&gt;BitmapLocking.exe 1280 720 10000
Starting BitmapLocking in 1280 X 720 windowed default with numframes = 10000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 8.776642
FPS : 1139.387968

C:\Users\LennyLen\Desktop\bl&gt;BitmapLocking.exe 1280 720 opengl 10000
Starting BitmapLocking in 1280 X 720 windowed opengl with numframes = 10000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 28.258398
FPS : 353.877101</pre><p>

The program doesn&#39;t work for me fullscreen.  My monitors flash on and off and I get the following output (no results):</p><pre>C:\Users\LennyLen\Desktop\bl&gt;BitmapLocking.exe 1280 720 10000 fullscreen
Starting BitmapLocking in 1280 X 720 fullscreen default with numframes = 10000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23</pre><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Thu, 22 May 2014 10:54:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/614217/1001014#target">LennyLen</a> said:</div><div class="quote"><p>
The program doesn&#39;t work for me fullscreen. My monitors flash on and off and I get the following output (no results):
</p></div></div><p>
That&#39;s odd. Especially since it doesn&#39;t output the time and FPS - it should do that as long as a display is created, and I know it was because it prints off the pixel format of the screen. Do you normally have problems setting 1280 X 720 fullscreen with Allegro 5? I can&#39;t really explain that behavior. You must have one hell of a cpu and gpu given your high FPS in a 1280 x 720 window.</p><p>I thank everyone for their help testing this, but I can&#39;t really do much unless I can get a profiling build working. And I haven&#39;t been able to find a profiler that works as expected on my Vista laptop. If anyone has any ideas, feel free to <a href="https://www.allegro.cc/forums/thread/614254/1000941#target">drop in on my other thread</a>.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Thu, 22 May 2014 11:31:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The result I got could have been due to my multi monitor setup. I&#39;ll try later with only a single monitor.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Thu, 22 May 2014 14:19:53 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;ve rebuilt your program from your last 7-zip with a fully static monolith Allegro in MSYS2, this is what I get on a test 800x600</p><p>Care that the Allegro lib is a Debug build (not optimized), my specs on the Laptop are:</p><p>Intel core i3-2330M @ 2.2GHz, 4GB RAM, Intel HD graphics 3000 (Opengl 3.1 context max).</p><pre>
$ ./Bitmaplocking
Starting BitmapLocking in 800 X 600 windowed default with numframes = 1000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 4.094687
FPS : 244.218891

$ ./Bitmaplocking 800 600 opengl
Starting BitmapLocking in 800 X 600 windowed opengl with numframes = 1000
Pixel format of screen : 9
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 39.137457
FPS : 25.550970
</pre><p>

A <b>very</b> noticeable difference indeed.</p><p>EDIT: I should add that running fullscreen in d3d mode is fast but i can&#39;t get the specs since the program does not print those out.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (pkrcel)</author>
		<pubDate>Thu, 22 May 2014 18:32:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>So it turns out that it was running multiple monitors that was causing the program to not run properly.  Once I&#39;d disabled all but my main monitor I got the following results:</p><pre>C:\Users\LennyLen\Desktop\bl&gt;BitmapLocking.exe 1280 720 fullscreen 10000
Starting BitmapLocking in 1280 X 720 fullscreen default with numframes = 10000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 15.039495
FPS : 664.915961

C:\Users\LennyLen\Desktop\bl&gt;BitmapLocking.exe 1280 720 fullscreen opengl 10000
Starting BitmapLocking in 1280 X 720 fullscreen opengl with numframes = 10000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 27.325060
FPS : 365.964428</pre><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Thu, 22 May 2014 19:06:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;ve tried it on my home lappy, which is a bit beefier and has two GPUs.</p><p>Specs are:<br />Interl core i7-2670QM @ 2.20GHz, 4GB RAM, </p><p>Running with the NVIDIA GeForce 610M (own 2GB mem, opengl context 4.3)</p><pre>
Starting BitmapLocking in 800 X 600 windowed default with numframes = 1000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 1.448427
FPS : 690.404023

Starting BitmapLocking in 800 X 600 windowed opengl with numframes = 1000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 16.744071
FPS : 59.722633
</pre><p>

There&#39;s STILL a 10x difference in speed...:-/</p><p>and with the integrated Intel HD3000 (Opengl context 3.1)
</p><pre>
Starting BitmapLocking in 800 X 600 windowed default with numframes = 1000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 2.322496
FPS : 430.571225

Starting BitmapLocking in 800 X 600 windowed opengl with numframes = 1000
Pixel format of screen : 9
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 30.003446
FPS : 33.329505
</pre><p>

That&#39;s a big difference also on this &quot;better&quot; platform with the NVIDIA GPU.</p><p>I dare say TOO MUCH of a difference, if ony profiling on windows would prove to be a bit <span class="cuss"><span>goddamn</span></span> easier...&gt;:(
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (pkrcel)</author>
		<pubDate>Fri, 23 May 2014 00:33:32 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>There is clearly something up with windows&#39;s opengl, and our gl code. Some of these tests were probably using MS&#39;s opengl... but still the numbers over all are not great.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Fri, 23 May 2014 00:41:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;ve updated the GFX drivers for the NVIDIA GPU and...weird enuff...fullscreen opengl is now MUCH faster that D3D...and D3D looks awful with some translucent black bars (surely artifacts) popping up. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /></p><pre>
Starting BitmapLocking in 800 X 600 fullscreen default with numframes = 1000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 10.543454
FPS : 94.845576

Starting BitmapLocking in 800 X 600 fullscreen opengl with numframes = 1000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 3.076167
FPS : 325.079932
</pre><p>

Something&#39;s fishy here <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /></p><p>Coounterwise...on the Intel HD3000</p><pre>

D:_user\Pkrcel\coding\BitmapLocking&gt;BitmapLocking.exe 800 600 fullscreen
Starting BitmapLocking in 800 X 600 fullscreen default with numframes = 1000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 0.481809
FPS : 2075.510044

D:_user\Pkrcel\coding\BitmapLocking&gt;BitmapLocking.exe 800 600 fullscreen opengl

Starting BitmapLocking in 800 X 600 fullscreen opengl with numframes = 1000
Pixel format of screen : 9
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 28.388358
FPS : 35.225707
</pre><p>

<img src="http://www.allegro.cc/forums/smileys/shocked.gif" alt=":o" /> <img src="http://www.allegro.cc/forums/smileys/shocked.gif" alt=":o" /> <img src="http://www.allegro.cc/forums/smileys/shocked.gif" alt=":o" /> the D3D code runs....I dare say EXTREMELY fast and OpenGL is an awful slog. </p><p>I wonder how much is Allegro&#39;s &quot;fault&quot; and how dang much is about drivers...</p><p>EDIT: by the way it should be noticed that I didn&#39;t touch Intel&#39;s drivers so I wonder WHAT coudl cause the speed up.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (pkrcel)</author>
		<pubDate>Fri, 23 May 2014 01:37:25 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Some weird opengl conflict with dual gpu setups is my assumption...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Fri, 23 May 2014 02:02:27 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/614217/1001045#target">Thomas Fjellstrom</a> said:</div><div class="quote"><p>Some weird opengl conflict with dual gpu setups is my assumption...</p></div></div><p>

I only have one GPU, one monitor etc and it is very slow for me.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Roy)</author>
		<pubDate>Fri, 23 May 2014 04:27:39 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/614217/1001048#target">NiteHackr</a> said:</div><div class="quote"><p>I only have one GPU, one monitor etc and it is very slow for me.</p></div></div><p>Well that was for the other report... But yeah, some opengl issue here.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Fri, 23 May 2014 05:32:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>In fact I have a combo of intel hd 3000 and ati 7800.</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/614217/1000460#target">The result</a> said:</div><div class="quote"><p>
C:\Users\Gull\Downloads\BitmapLocking&gt;BitmapLocking.exe 320 200 10000<br />Starting BitmapLocking in 320 X 200 windowed default with numframes = 10000<br />Pixel format of screen : 23<br />ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9<br />ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10<br />ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17<br />ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18<br />ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22<br />ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23<br />Total time taken : 4.317373<br />FPS : 2316.223166</p><p>C:\Users\Gull\Downloads\BitmapLocking&gt;BitmapLocking.exe 320 200 opengl 10000<br />Starting BitmapLocking in 320 X 200 windowed opengl with numframes = 10000<br />Pixel format of screen : 9<br />ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9<br />ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10<br />ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17<br />ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18<br />ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22<br />ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23<br />Total time taken : 2.864330<br />FPS : 3491.217494</p><p>C:\Users\Gull\Downloads\BitmapLocking&gt;BitmapLocking.exe 1280 720 10000<br />Starting BitmapLocking in 1280 X 720 windowed default with numframes = 10000<br />Pixel format of screen : 23<br />ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9<br />ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10<br />ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17<br />ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18<br />ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22<br />ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23<br />Total time taken : 45.392228<br />FPS : 220.302032</p><p>C:\Users\Gull\Downloads\BitmapLocking&gt;BitmapLocking.exe 1280 720 10000 fullscreen<br />Starting BitmapLocking in 1280 X 720 fullscreen default with numframes = 10000<br />Pixel format of screen : 23<br />ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9<br />ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10<br />ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17<br />ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18<br />ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22<br />ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23<br />Total time taken : 25.590492<br />FPS : 390.770130</p><p>C:\Users\Gull\Downloads\BitmapLocking&gt;BitmapLocking.exe 1280 720 opengl 10000<br />Starting BitmapLocking in 1280 X 720 windowed opengl with numframes = 10000<br />Pixel format of screen : 9<br />ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9<br />ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10<br />ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17<br />ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18<br />ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22<br />ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23<br />Total time taken : 41.325782<br />FPS : 241.979693</p><p>THE LAST THREE ARE NOT WORKING:</p><p>C:\Users\Gull\Downloads\BitmapLocking&gt;BitmapLocking.exe 1280 720 opengl 10000 fullscreen<br />Starting BitmapLocking in 1280 X 720 windowed opengl with numframes = 0<br />Pixel format of screen : 9<br />ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9<br />ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10<br />ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17<br />ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18<br />ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22<br />ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23<br />Total time taken : 0.049416<br />FPS : 20.236557</p><p>C:\Users\Gull\Downloads\BitmapLocking&gt;BitmapLocking.exe 1280 720 10000 fullscreen opengl<br />Starting BitmapLocking in 1280 X 720 windowed default with numframes = 0<br />Pixel format of screen : 23<br />ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9<br />ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10<br />ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17<br />ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18<br />ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22<br />ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23<br />Total time taken : 0.024095<br />FPS : 41.503173</p><p>C:\Users\Gull\Downloads\BitmapLocking&gt;BitmapLocking.exe 1280 720 10000 fullscreen opengl<br />Starting BitmapLocking in 1280 X 720 windowed default with numframes = 0<br />Pixel format of screen : 23<br />ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9<br />ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10<br />ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17<br />ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18<br />ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22<br />ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23<br />Total time taken : 0.021616<br />FPS : 46.263087
</p></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (GullRaDriel)</author>
		<pubDate>Fri, 23 May 2014 17:31:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
THE LAST THREE ARE NOT WORKING:
</p></div></div><p>
There was a bug in the code. You should be able to use anything for the 6th parameter now - before it was trying to atoi(&quot;fullscreen&quot;) or atoi(&quot;opengl&quot;) for the num of frames.</p><pre>

c:\ctwoplus\progcode\allegro5\test\BitmapLocking&gt;BitmapLocking.exe 800 600 500 fullscreen opengl
Starting BitmapLocking in 800 X 600 fullscreen opengl with numframes = 500
Pixel format of screen : 9
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 36.720223
FPS : 13.616475

c:\ctwoplus\progcode\allegro5\test\BitmapLocking&gt;
</pre><p>

I <a href="https://www.allegro.cc/files/attachment/608613">attached a new 7z archive</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Fri, 23 May 2014 22:54:29 +0000</pubDate>
	</item>
</rss>
