About mipmap algorithm and coding

Hi
i’d like to implememt a function doing rasterization with mipmap texturing. I know some algorithms about mipmap texture level selecting but i don’t know how to implement on coding. i read the Mesa source code and it is too complicated to understand. Does anyone know how to implement it?

thanks

I strongly suggest reading those two papers, they will give you a lot of insights on how mip-mapping is done. If you have more questions feel free to ask them
http://www.sussex.ac.uk/Units/vlsi/mipmap.pdf
http://www.hpl.hp.com/techreports/98/HPL-98-112.pdf