![]() |
|
Scaling look likes junk. |
nshade
Member #4,372
February 2004
|
So I'm making a 2D game that runs at 1920x1080, and I want to scale the screen down a bit so it works on other 16x9/16:10 resolutions while keeping the "Base" at my native size. I have the following code ran that scales the screen down depending on the resolution chosen. //This scales the display to any resolution (Native is 1920x1080 however, when I run my game at, say. 1280x720 everything looks all jaggy and gross. (Attached us a text example) Is there a way to scale down without it looking like butt? |
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
You can use either ALLEGRO_MIN_LINEAR or not to use linear scaling when scaling down. It's a new bitmap flag. Try both options first. It looks fine to my poor eyes. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
nshade
Member #4,372
February 2004
|
I'm not following --- Where do I use this flag. I'm not scaling my bitmap, I'm transforming the whole display. I'm looking fro something that effects al_scale_transform that has some filtering in it. Will I have to draw to a memory bitmap and then do a al_draw_scaled_bitmap() to a smaller backbuffer? |
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
No, you don't need any memory bitmaps. It can all be done in video. You use al_set_new_bitmap_flags before creating your bitmap with ALLEGRO_MIN_LINEAR to use linear filtering when drawing smaller versions of the bitmap. So you'll need a buffer at your native resolution which you draw scaled to the screen. al_set_new_bitmap_flags(ALLEGRO_VIDEO_BITMAP | ALLEGRO_MIN_LINEAR); ALLEGRO_BITMAP* buffer = al_create_bitmap(1920,1080);// make the native resolution buffer /// Draw at full resolution ALLEGRO_TRANSFORM t = al_create_transform(); al_identity_transform(&t); al_scale_transform(al_get_display_width(display) / 1920.0f , al_get_display_height(display)/1080.0f); al_use_transform(&t); al_draw_bitmap(buffer , 0 , 0);
My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
nshade
Member #4,372
February 2004
|
That's what I was looking for! Thank you so much! |
|