Do we have equivalent of AGK's SetDefaultMagFilter and SetDefaultMinFilter

SimonVD

Member
Tutorial Author
Joined
Dec 22, 2019
Hello...

I'd like to disable filtering (or use nearest neighbor filtering) at application level.

I can see that I have an option to disable image filtering just before loading an image, in Mojo2.graphics library...

Is there a way to achieve nearest neighbor interpolation for all bitmaps displayed on the screen at anytime, using a single command / function?
 
Last edited:

MikeHart

Administrator
Joined
Jun 19, 2017
Location
Germany
Hi and welcome. No we don't, you have to apply it to every image you you load.

The filter flags are used inside mojo2 like this:
Cerberus X:
        If _flags & Filter
            glTexParameteri GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR
        Else
            glTexParameteri GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST
        Endif
        If (_flags & Mipmap) And (_flags & Filter)
            glTexParameteri GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR
        Else If _flags & Mipmap
            glTexParameteri GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST_MIPMAP_NEAREST
        Else If _flags & Filter
            glTexParameteri GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR
        Else
            glTexParameteri GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST
        Endif
Set filter to 0 to achieve nearest neighbor filtering.
 
Top Bottom