Nearest-Neighbor Scaling (2x)

BlitzMax Forums/BlitzMax Beginners Area/Nearest-Neighbor Scaling (2x)

Mr. Goober(Posted 2014) [#1]
I've dabbled in Blitzmax for some time now and I came across something I am sort of having trouble with. It seems that there isn't a nearest-neighbor scaling option for Max2D commands, unless I am mistaken.

I've looked into setting pixels onto a pixmap using GrabImage() and modifying the pixels using the pixel pointer, but the process is too slow. I'm not sure if I am just doing it wrong, but I would like to know a decent implementation of this.

Upon using SetVirtualResolution(400,300) on an 800x600 GLMax2DDriver() context, everything is filtered (probably bilinnear).




Kryzon(Posted 2014) [#2]
By default, images are loaded or created with the default flags (MASKEDIMAGE | FILTEREDIMAGE).

Try to load or create your TImages without the MIPMAPPEDIMAGE and FILTEREDIMAGE tags, and see if this solves the problem.


Mr. Goober(Posted 2014) [#3]
Oh wow, you know what? I was calling AutoImageFlags after loading all of my images, and no matter what I put into AutoImageFlags(), nothing seemed to work, obviously. I went into my image loading code and changed the flags for LoadImage() and now it works perfectly, with nice, crisp images. Thanks a bunch man.