I'm creating a game where I'm going in the direction of hardcore pixel art. I might even go as far as to run the game in less than 100 * 100 resolution. The thing is, I still want people to make things out on the screen. 
As far as my newly discovered a5 skills go, I have two options:
- Use a separate buffer and scale/stretch it when blitting to the Allegro backbuffer
- Find the screen resolution before the game starts, and scale every bitmap and every number accordingly.
I'm scared of the first one because of the anticipated speed hit, since: 1) It's scale/stretching a huge bitmap the entire time, and 2) It's slower drawing things with alpha to memory bitmaps than it is to the backbuffer. I'm scared of the second one because it would require me to use nothing but floats (which in itself makes me cringe) and just sounds like bug city.
Is there a magical third option I don't know about, or is there a better way to do either of the above?
There are two main things, which you've outlined:
use a small buffer and scale only the final blit
use a full screen buffer and scale every call
The first is better for bitmap oriented games. The second is better if you are drawing everything with primitives, because you'll get higher resolution.
You can do the latter via the transformation API. Just use (0,0)-(1,1) in your code and set up a transformation that scales by (w,h).
I'm hoping that's it? Most of what I read in the docs went straight over my head.
That's pretty much it, but watch the integer math in those divisions. You could end up with some non-exact fitting images.
float scaleX = al_get_display_width(currentDisplay)/(float)currentResW; float scaleY = al_get_display_height(currentDisplay)/(float)currentResH; ALLEGRO_TRANSFORM trans; al_identity_transform(&trans); al_scale_transform(&trans, scaleX, scaleY); al_use_transform(&trans);
That's pretty much it, but watch the integer math in those divisions. You could end up with some non-exact fitting images.
You, uh, you lost me there. Does that mean it's better to do:
?
Because if so, then I learned something (else) new today.
I assume you also need to initialize it to the identity first. See my previous post.
Yeah Matthew nailed it.
I assume you also need to initialize it to the identity first. See my previous post.
Whoa, yeah, that. I also didn't notice that I shouldn't be passing trans directly, thanks.
(float)currentResH;
(float)
-.- duh. Thanks a ton.
FYI, the attributes to the <quote> and <code> tags are optional and usually not necessary.
<quote name="Matthew Leverton">FYI, the attributes to the
and <code> tags are optional and usually not necessary.
Oh, I know. I'm just super OCD and stuff.
[edit]
iseewhatyoudidthere.jpg
-_-