Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void TTexturesManager::SetFiltering(int filter)
- {
- if (filter<4) //rozmycie przy powiêkszeniu
- {//brak rozmycia z bliska - tych jest 4: 0..3, aby nie by³o przeskoku
- glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
- filter+=4;
- }
- else
- glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
- switch (filter) //rozmycie przy oddaleniu
- {case 4: //najbli¿szy z tekstury
- glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST); break;
- case 5: //œrednia z tekstury
- glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); break;
- case 6: //najbli¿szy z mipmapy
- glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST_MIPMAP_NEAREST); break;
- case 7: //œrednia z mipmapy
- glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST); break;
- case 8: //najbli¿szy z dwóch mipmap
- glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST_MIPMAP_LINEAR); break;
- case 9: //œrednia z dwóch mipmap
- glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR); break;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement