Small Display question

Started by CodeBunny, April 21, 2011, 00:54:07

Previous topic - Next topic

CodeBunny

Is there a way to scale the Display? E.g., can I make a window at 300x200 and then scale it x3 so it is, in effect, a 900x600 window? I've seen this done before and it's an interesting effect - mainly for "pixely" games. (Example: Spelunky.)

kappa

One way you can do this is just create a 900x600 window and scale your small content using GL11.glViewport to stretch and fit window.

CodeBunny

Yeah, and I've done some playing around with that, but it doesn't end up pixelated. It ends up being a 900x600 window where things are 3 times larger but at full resolution.

Example:

This is the method you suggested:


This is how I'd like to get it to look:

Matthias

Then you need to render to texture (RTT) (best using FBO - Frame Buffer Objects). And render that texture to your screen using GL_NEAREST filter.

CodeBunny

Ah. I was hoping there would be a built-in way. *shrug*

Is there any way that this feature could get added in the next release? It seems like it'd be a simple thing to achieve on the Display side - simply show the render results on the screen at a different scale.