[A5] Exempt Bitmap from Transform
Eric Johnson

Hi there. I'm using a run-of-the-mill transform that doubles the scale of the display.

void Routines::stretchDisplay(const int stretch_amount) {

  ALLEGRO_TRANSFORM transform;

  al_identity_transform(&transform);

  // Prepare to stretch the display by the given amount
  al_scale_transform(&transform, stretch_amount, stretch_amount);

  // Apply stretch
  al_use_transform(&transform);

  // EXAMPLE use: Routines.stretchDisplay(2); This doubles the scale (duh)
}

What I'd like to do is exempt a particular bitmap from said transform; everything but X bitmap would be scaled. Would you mind pointing me in the right directory in achieving this? Thank you kindly. 8-)

Thomas Fjellstrom

You can temporarily store that transform using al_store_state, set up an identity or ortho transform, use that, draw the bitmap, and then restore the state after.

There may be another way, but I think that works.

Peter Wang

Another fun thing to do is create a sub-bitmap, which would have an independent transform.

Thread #613928. Printed from Allegro.cc