How to make a big window with a low resolution

BlitzMax Forums/BlitzMax Beginners Area/How to make a big window with a low resolution

lotonah(Posted 2011) [#1]
Hi everyone,

Just getting back into BlitzMax after a haitus where I was doing a fair bit of Atari/Apple ][ programming. I'd like to convert some of those programs, and leave them fairly unmodified.

Anyhow, I was hoping to find out how to make a window that has some low resolution to it, like say a 1280x960, but the graphics mode inside is 320x240.

I've fiddled with SetViewPort, SetVirtualResolution, SetScale and tried figuring out how a frustum worked. Over my head at this point. I just want to get something going.

Any help would be appreciated.


H&K(Posted 2011) [#2]
Draw on a 320x240 texture, then pin this textures vertices to the windows corners.


ima747(Posted 2011) [#3]
SetVirtualResolution should be the easiest path to get a low res program working in a higher res space properly. I've never used it myself so I'm not sure but there may be some limitations, like it may only work in full screen modes... There's plenty of arguably "better" ways to do it but they all will require some amount of major re-working (either setting up render targets and accepting the overhead, or re-working your placement math to accomodate for a SetScale value, etc.)


H&K(Posted 2011) [#4]
Remember to remove the FILTEREDIMAGE flag from relevent images.

@Ima, I assumed that as he said he had tried SetVirtualResolution, that it didnt do what he wanted.
Possibly it was just the version I had but when I tried messing with it as a solution to a "Hud" SetVirtualResolution didnt work the way I expected. (This was back in 1.18, and I cannot even remember why I ended up not using it)


TomToad(Posted 2011) [#5]
I would imagine that if he is converting Apple ][ programs, that he is using pixel plotting routines. SetViewPort will plot the pixel in the correct location, but it still only plots 1 pixel.

One solution, but probably a bit slow, would be to draw the screen on a 320x240 pixel portion of the screen, grab it as an image, then scale it to the full window size.


Edit:Just for fun, here is an animated stick figure using the technique above


Last edited 2011


matibee(Posted 2011) [#6]
SetVirtualResolution should be all you need if you're just plotting pixels..




lotonah(Posted 2011) [#7]
TomToad, your code is pretty cool, I see that being helpful in many ways.

Matibee, your code is likely the solution I'll go with. I like having the best of both worlds :) And it's easy to change the code from being 320 x 240 res to even 40x40 (lo-res on the Apple //).

I'm noticing now that what I was doing was putting the instructions in the wrong order so things weren't working out. But these code examples gave me more than a guide, it gave me solutions to a few problems that I hadn't completely conceptualized yet.