How to deactivate Pixel smoothing in Fullscreen???

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
neo
Posts: 7
Joined: July 26th, 2017, 9:27 pm

How to deactivate Pixel smoothing in Fullscreen???

Post by neo » July 26th, 2017, 9:39 pm

Hey guys!

Quick question from a noob here:

Is there a way to deactivate the Pixelsmoothing in Fullscreen Mode?
Messing around with Chilis Framework, love it!, and want to try some retro 320x200 Game shit ;)
But once I enter Fullscreen it's all smoothed out..... I guess the answer is not as easy as I might hope but please hit me! ;)

Thanks!!!!
Amstrad CPC 464 Masterrace (+greenscreen)

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: How to deactivate Pixel smoothing in Fullscreen

Post by albinopapa » July 27th, 2017, 2:14 am

One problem you are going to run into is the Desktop Window Manager of Windows. It's what manages the window drawing and what not, if your just making a small window then maximizing it, you are going to get stretching and smoothing.

What I would do is make my own custom drawing surface. So for instance, instead of using chili's gfx object, you'd pass around your scaled_gfx object. When you call scaled_gfx.putpixel(x,y,color) it would fill in a rectangle of pixels by calling chili's gfx.PutPixe(x,y,color);

For starters, you'd want to make the Graphics::ScreenWidth the same as the resolution as your monitor ( 1920x1080 for example ). You might want to make a way to set this at runtime by taking away the static constexpr portion and just make them static.

You'll probably want the render centered so you'll need some offset from the left hand side if you are using a 16x9 or 16x10 monitor.

You want to make a ScaledGraphics class and have the ScreenWidth and ScreenHeight a multiple of 320 and the ScreenHeight a multiple of 200 ( 1600x1000 for example scale by 5 ).

Then when you draw something, you'd want to call the scaled_gfx.PutPixel(x,y,color), which will add the left offset to the x and scale the X and Y by 5 to get the starting location for the scaled pixel.

Then in a nested for loop, you call the normal gfx.PutPixel for each of the 5x5 pixels in the scaled pixel.


My monitor or OS doesn't even support 320x200 resolution, so you'd have to scale to at least 640x480
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

neo
Posts: 7
Joined: July 26th, 2017, 9:27 pm

Re: How to deactivate Pixel smoothing in Fullscreen???

Post by neo » July 27th, 2017, 11:19 am

Nice thank you for the tipps, sounds legit!
8-)
Amstrad CPC 464 Masterrace (+greenscreen)

Post Reply