[AD] min/mag filters

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


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).

-- 
Elias Pschernig <elias.pschernig@xxxxxxxxxx>





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