Render on an image before sending to screen - Printable Version +- NaaLaa (https://www.naalaa.com/forum) +-- Forum: NaaLaa (https://www.naalaa.com/forum/forum-1.html) +--- Forum: NaaLaa 6 Questions (https://www.naalaa.com/forum/forum-5.html) +--- Thread: Render on an image before sending to screen (/thread-190.html) |
Render on an image before sending to screen - bul71 - 01-27-2025 Hi. I'm currently trying to make my drawing logic on an image of logical window dimensions then if the game runs in windowed mode, I just send this image on the window but if the game runs in fullscreen, I try to send this image on an image with the screen dimensions after applying code to calculate vertical or horizontal margins depending on the difference in aspect ratios between the physical screen and the window. My windowed mode works fine. In fullscreen : ----------------- I succefully prepare graphics on the window sized image then send it to physical screen image then on the screen but I'm not able the fit the logical image on the screen size and place it accordingly with the margins. Can you show me the way to do it properlly ? Thank you. RE: Render on an image before sending to screen - Marcus - 01-27-2025 You want "letterboxed" graphics in fullscreen mode? I'll write an example as soon as I get home from work RE: Render on an image before sending to screen - Marcus - 01-27-2025 Here's an example with borders on the left and right, which is what I assume you want: Code: ' Window width and height. RE: Render on an image before sending to screen - bul71 - 01-27-2025 (01-27-2025, 02:48 PM)Marcus Wrote: You want "letterboxed" graphics in fullscreen mode? I'll write an example as soon as I get home from work I'm not sure what you name letterboxed graphies. I want to be able to run my game in fullscreen and the aspect ratio is respected what ever is the aspect ratio of the screen, displaying margins, vertical or horizontal if needed to center the game display area. Like seeing cinema 16/9 films on old 4/3 tv screens. Thank you. RE: Render on an image before sending to screen - Marcus - 01-27-2025 (01-27-2025, 03:27 PM)bul71 Wrote:(01-27-2025, 02:48 PM)Marcus Wrote: You want "letterboxed" graphics in fullscreen mode? I'll write an example as soon as I get home from work This version should work in both cases (vertical and horizontal bars): Code: ' Window width and height. |