Re: [AD] min/mag filters

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On August 12, 2010, Elias Pschernig wrote:
> Right now min/mag filters for drawing images can only be set in the
> config file. But looking at this in ex_haiku:
> 
>    cfg = al_get_system_config();
>    if (cfg) {
>       /* This should probably become a display option. */
>       default_cfg_value(cfg, "graphics", "min_filter", "linear");
>       default_cfg_value(cfg, "graphics", "mag_filter", "linear");
>    }
> 
> I completely agree with the comment. I was just going to remove those
> two options and add a few new flags you can pass to
> al_set_new_bitmap_flags:
> 
> ALLEGRO_MIN_FILTER_LINEAR
> ALLEGRO_MIN_FILTER_ANISOTROPIC
> ALLEGRO_MAG_FILTER_LINEAR
> ALLEGRO_MAG_FILTER_ANISOTROPIC
> 
> For OpenGL the implementation is trivial as we can just pass them to
> glTexParameter:
> http://www.khronos.org/opengles/sdk/1.1/docs/man/glTexParameter.xml
> 
> For D3D I found this so it should be easy as well:
> http://msdn.microsoft.com/en-us/library/bb172602%28v=VS.85%29.aspx
> 
> But not sure, maybe we want this as a display flag instead of bitmap
> flag? So I better ask here before I go ahead.
> 
> Also, we might want to add another flag:
> 
> ALLEGRO_MIPMAP
> 
> When you scale bitmaps out then that's almost a must to use. Mipmaps are
> automatically updated with opengl es 1 when you use glTexImage2d so it's
> just another flag to add to glTexParameter. (I don't know what happens
> when you modify the texture with FBO, or how it works in other opengl
> versions or in D3D though).

I'm pretty much of the opinion that anything that can be set in the config 
file should be settable with the api. No exceptions. There should be no need 
to pre set the config value before initializing allegro under any 
circumstance.

-- 
Thomas Fjellstrom
tfjellstrom@xxxxxxxxxx




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/