You, the Allegro developers have let me down.
j/k
Okay, so oddly enough right after talking about rarely finding bugs. I've got a curiosity that may be Allegro 5 related.
Saving a bitmap of the screen seems to change the brightness in Linux. It might not be respecting gamma or something.
{"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"}
The "space" background in that picture, on my screen, is black or almost black. But the screenshot I see uploaded to github is very very bright
http://www.allegro.cc/files/attachment/613209
https://www.allegro.cc/files/attachment/613209
al_save_bitmap("screen.png", al_get_backbuffer(al_display));
[edit] It's dumping the ALPHA CHANNEL of the screen. git issue now here:
Interesting. al_get_backbuffer returns the actual backbuffer so if there is an alpha channel then the bitmap will have it. And al_save_bitmap should save an alpha channel if there is one. So it's undesirable but I can'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.
ps that's a groovy looking screenshot, what is it?
Still very prototype stage. But it's exploring a game akin to Asteroids and/or Gravity Well.
Public repo for the time, because there's nothing really proprietary in there yet. Just lots of sweet D code.
https://github.com/katastic/dgravity
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.
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.
That is actually really smart! I may wind up doing something similar in future projects.
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'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'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'm not quite sure how I'd even start to debug this.
You can work around it, I've got a D language version in my github repo in file main.d above.
I mostly converted it to C/C++. (took all of like 30 seconds) Use whatever string (or c-string) you want for the path: