How can I make a 320x180 pixel perfect resolution window with fullscreen?

Hi. I am very new to monogame and I wanna know how to make a pixel perfect window that can enable fullscreen.

You have to scale your game by integer increments. Problem is that you cannot always scale your original resolution perfectly. If you don’t want huge black borders, you need to either compromise on pixel quality or change your original resolution to be a perfect fit.
You can have min and max allowed resolution and see if any fractions of the monitor resolution fall under that range. If they do, pick that and scale.

1 Like

Thanks for answering. I found a example of how to make black borders on github and it works well for me.

In actual fullscreen you can only use the resolutions your GPU supports. 320x180 is most likely never supported. (are you talking about mobile?)

So you have to get the closest res which reassembles a multiple of your desired resolution and add black bars for differing ratios - or lock your game to windowed mode.

I am not talking about mobile. I am just trying to make a low-res pong. And I found a example of the black box on github and it works well for me. Thanks you for answering.

What we do over here for pixel art games, is to render the game at the intended pixel resolution into a RenderTarget2D (which can be whatever size you want) and do all the computation for that specific resolution, and when it’s time to present it to the screen, simply draw the render target content stretched to the graphics device resolution with point sampling and voila. Efficient and simple modern pipeline for old-school games.

3 Likes

Thanks for answering.So, it’s like drawing sprites to the render target then scaled up that render target and draw to the window?

Hi @Uniquebeat, Welcome to the Community!

Could you please mark mrhelmut’s post as the answer to your question so future searches can see it has been resolved.

Happy Coding!

1 Like

Sure

1 Like