<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>You&#39;re such a disappointment.</title>
		<link>http://www.allegro.cc/forums/view/618672</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sun, 29 May 2022 01:32:25 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You, the Allegro developers have let me down. </p><p>j/k</p><p>Okay, so oddly enough right after talking about rarely finding bugs. I&#39;ve got a curiosity that may be Allegro 5 related.</p><p>Saving a bitmap of the screen seems to change the brightness in Linux. It might not be respecting gamma or something.</p><p><span class="remote-thumbnail"><span class="json">{"name":"screen.png","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/c\/a\/ca53749d909c08577ef83569638f5bcc.png","w":1360,"h":720,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/c\/a\/ca53749d909c08577ef83569638f5bcc"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/c/a/ca53749d909c08577ef83569638f5bcc-240.jpg" alt="screen.png" width="240" height="127" /></span></p><p>The &quot;space&quot; background in that picture, on my screen, is black or almost black. But the screenshot I see uploaded to github is very very bright</p><p>http://www.allegro.cc/files/attachment/613209<br /><a href="https://www.allegro.cc/files/attachment/613209">https://www.allegro.cc/files/attachment/613209</a></p><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/al_save_bitmap"><span class="a">al_save_bitmap</span></a><span class="k2">(</span><span class="s">"screen.png"</span>, <a href="http://www.allegro.cc/manual/al_get_backbuffer"><span class="a">al_get_backbuffer</span></a><span class="k2">(</span>al_display<span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>

[edit] It&#39;s dumping the ALPHA CHANNEL of the screen. git issue now here:</p><p><a href="https://github.com/liballeg/allegro5/issues/1337">https://github.com/liballeg/allegro5/issues/1337</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Chris Katko)</author>
		<pubDate>Mon, 23 May 2022 13:44:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Interesting. <span class="source-code"><a href="http://www.allegro.cc/manual/al_get_backbuffer"><span class="a">al_get_backbuffer</span></a></span> returns the actual backbuffer so if there is an alpha channel then the bitmap will have it. And <span class="source-code"><a href="http://www.allegro.cc/manual/al_save_bitmap"><span class="a">al_save_bitmap</span></a></span> should save an alpha channel if there is one. So it&#39;s undesirable but I can&#39;t see how it could be otherwise. I suppose the solution is to make yourself a bitmap with an opaque black rectangle and blit the backbuffer onto it? Also this may even be quicker - the docs say that operations on the backbuffer may be unaccelerated, so blitting in one go to a memory bitmap may be better.</p><p>ps that&#39;s a groovy looking screenshot, what is it?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Peter Hull)</author>
		<pubDate>Mon, 23 May 2022 15:24:51 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Still very prototype stage. But it&#39;s exploring a game akin to Asteroids and/or Gravity Well.</p><p>Public repo for the time, because there&#39;s nothing really proprietary in there yet. Just lots of sweet D code.</p><p><a href="https://github.com/katastic/dgravity">https://github.com/katastic/dgravity</a></p><p>I have Allegro dump a screenshot every time I load the game, so that github stores it. Then, I could, theoretically, span through hundreds of old commits, and get a history of screenshots as the game progresses.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Chris Katko)</author>
		<pubDate>Tue, 24 May 2022 02:14:41 +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/618672/1052378#target">Chris Katko</a> said:</div><div class="quote"><p>I have Allegro dump a screenshot every time I load the game, so that github stores it. Then, I could, theoretically, span through hundreds of old commits, and get a history of screenshots as the game progresses.</p></div></div><p>

That is actually really smart!  I may wind up doing something similar in future projects.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Samuel Henderson)</author>
		<pubDate>Wed, 25 May 2022 23:48:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I can confirm I have this behavior as well. For some reason I struggle with understanding how blending works in general in Allegro, but it looks to me like I&#39;m doing everything right, like I have for years. Sure enough, screenshot dumping never had this problem on my old laptop, but now that I&#39;m on a new one, it does. I have no idea if this is a graphics card thing, OS thing, or Allegro version thing, and I&#39;m not quite sure how I&#39;d even start to debug this.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (André Silva)</author>
		<pubDate>Sun, 29 May 2022 01:23:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You can work around it, I&#39;ve got a D language version in my github repo in file main.d above.</p><p>I mostly converted it to C/C++. (took all of like 30 seconds) Use whatever string (or c-string) you want for the path:
</p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">  1</span><span class="k1">void</span> al_save_screen<span class="k2">(</span>string path<span class="k2">)</span>
<span class="number">  2</span>  <span class="k2">{</span>
<span class="number">  3</span>  <a href="http://www.allegro.cc/manual/ALLEGRO_BITMAP"><span class="a">ALLEGRO_BITMAP</span></a><span class="k3">*</span> disp <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>al_display<span class="k2">)</span><span class="k2">;</span>
<span class="number">  4</span>  <span class="k1">int</span> w <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_get_bitmap_width"><span class="a">al_get_bitmap_width</span></a><span class="k2">(</span>disp<span class="k2">)</span><span class="k2">;</span>
<span class="number">  5</span>  <span class="k1">int</span> h <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_get_bitmap_height"><span class="a">al_get_bitmap_height</span></a><span class="k2">(</span>disp<span class="k2">)</span><span class="k2">;</span>
<span class="number">  6</span>  <a href="http://www.allegro.cc/manual/ALLEGRO_BITMAP"><span class="a">ALLEGRO_BITMAP</span></a><span class="k3">*</span> temp <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_create_bitmap"><span class="a">al_create_bitmap</span></a><span class="k2">(</span>w, h<span class="k2">)</span><span class="k2">;</span>
<span class="number">  7</span>  <a href="http://www.allegro.cc/manual/al_lock_bitmap"><span class="a">al_lock_bitmap</span></a><span class="k2">(</span>temp, <a href="http://www.allegro.cc/manual/al_get_bitmap_format"><span class="a">al_get_bitmap_format</span></a><span class="k2">(</span>temp<span class="k2">)</span>, ALLEGRO_LOCK_WRITEONLY<span class="k2">)</span><span class="k2">;</span>
<span class="number">  8</span>  <a href="http://www.allegro.cc/manual/al_lock_bitmap"><span class="a">al_lock_bitmap</span></a><span class="k2">(</span>disp, <a href="http://www.allegro.cc/manual/al_get_bitmap_format"><span class="a">al_get_bitmap_format</span></a><span class="k2">(</span>temp<span class="k2">)</span>, ALLEGRO_LOCK_READONLY<span class="k2">)</span><span class="k2">;</span> <span class="c">// makes HUGE difference (6.4 seconds vs 270 milliseconds)</span>
<span class="number">  9</span>  <a href="http://www.allegro.cc/manual/al_set_target_bitmap"><span class="a">al_set_target_bitmap</span></a><span class="k2">(</span>temp<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 10</span>  <span class="k1">for</span><span class="k2">(</span><span class="k1">int</span> j <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span> j <span class="k3">&lt;</span> h<span class="k2">;</span> j<span class="k3">+</span><span class="k3">+</span><span class="k2">)</span>
<span class="number"> 11</span>    <span class="k1">for</span><span class="k2">(</span><span class="k1">int</span> i <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span> i <span class="k3">&lt;</span> w<span class="k2">;</span> i<span class="k3">+</span><span class="k3">+</span><span class="k2">)</span>
<span class="number"> 12</span>      <span class="k2">{</span>
<span class="number"> 13</span>      <a href="http://www.allegro.cc/manual/ALLEGRO_COLOR"><span class="a">ALLEGRO_COLOR</span></a> pixel <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_get_pixel"><span class="a">al_get_pixel</span></a><span class="k2">(</span>disp, i, j<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 14</span>      pixel.a <span class="k3">=</span> <span class="n">1</span>.<span class="n">0</span><span class="k2">;</span> <span class="c">// remove alpha</span>
<span class="number"> 15</span>      <a href="http://www.allegro.cc/manual/al_put_pixel"><span class="a">al_put_pixel</span></a><span class="k2">(</span>i, j, pixel<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 16</span>      <span class="k2">}</span>
<span class="number"> 17</span>  <a href="http://www.allegro.cc/manual/al_unlock_bitmap"><span class="a">al_unlock_bitmap</span></a><span class="k2">(</span>disp<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 18</span>  <a href="http://www.allegro.cc/manual/al_unlock_bitmap"><span class="a">al_unlock_bitmap</span></a><span class="k2">(</span>temp<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 19</span>  <a href="http://www.allegro.cc/manual/al_save_bitmap"><span class="a">al_save_bitmap</span></a><span class="k2">(</span>path, temp<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 20</span>  <a href="http://www.allegro.cc/manual/al_set_target_bitmap"><span class="a">al_set_target_bitmap</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>al_display<span class="k2">)</span><span class="k2">)</span><span class="k2">;</span> <span class="c">//set back to normal screen target</span>
<span class="number"> 21</span>  <a href="http://www.allegro.cc/manual/al_destroy_bitmap"><span class="a">al_destroy_bitmap</span></a><span class="k2">(</span>temp<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 22</span>  <span class="k2">}</span>
</div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Chris Katko)</author>
		<pubDate>Sun, 29 May 2022 01:32:25 +0000</pubDate>
	</item>
</rss>
