Widescreen correction
Blitz3D Forums/Blitz3D Programming/Widescreen correction
| ||
Hey, Say I wanted to do a retro-style game, rendered in the standard 4:3 aspect ratio, how would I correct for widescreen monitors? In other words, say the game's drawn at 320x240. To bring that to a 640x480 mode is easy; just blit each pixel as a 2x2 square. To correct for those weird 5:4 1280x1024 monitor, use a 1280x1024 screen mode, blit each pixel as a 4x4 square, making a 1280x960 image. Start drawing at 0,32, of course, to get the image centered. But what about widescreen monitors? To get a 4:3 image centered in widescreen, what resolution should I use, and how big should the pixels be? I don't have ANY widescreen experience, so I'm hoping some of you can help me out. |
| ||
use sprites. :) i learned my lesson the hard way lol! :P |
| ||
2D graphics only, no 3D rendering. I'm even using a custom 256-color palette. Like I said, retro-style. |
| ||
then use rects :) |
| ||
;top rect rect 0,0,graphicswidth(),"4:3 formula",1 ;bottom rect rect 0,graphicsheight()-y#,graphicswidth(),"4:3 formula",1 |
| ||
Are you using fullscreen-mode? Then, on most systems, the resolution will be scaled automatically to fit the screen. How you are going to double the pixels in b3d? On older systems, the pixel commands are pretty slow. Still, if you want to use letterbox scaling, this code might help: |
| ||
Oh, wait a second, 800x450 is a valid fullscreen resolution? Oh, then my problems are solved; I can work from there. Yes, I know most screens will scale it automatically; that's the whole problem. A 4:3 picture stretched to fit a 16:9 screen is UUUG-LY. As far as pixel operations being too slow: any system that requires the game to be run at a mimimum res of 640x480 should be more than fast enough to handle the required amount of pixel operations. The 640 option is only there for modern cards without legacy <640 support, since either way the game'll still only be drawing 320x240 pixels. Anyway, thanks Warner, that's just what I needed to know! :D |
| ||
Erm, I don't know if that is a valid resolution. But here you can find some info: http://en.wikipedia.org/wiki/Computer_display_standard |
| ||
Oh, excellent! I'll base widescreen correction on 1280x720. Rendering each pixel as a 3x3, 320x240 works out to 960x720, so start the final screen blitting at 160,0 and everything's perfect again. Thanks a bunch for the link! :D |
| ||
Needed this, here's a fix for Blitz3D: Guy Fawkes |
| ||
I didn't dive into the code to see what's going on, but I don't see a thing, or.. is that intentional? |
| ||
You're supposed to see a non-filled, purple rectangle. |