Advertisement
Delfigamer

Untitled

Mar 10th, 2015
480
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.55 KB | None | 0 0
  1. // Exposed constants:
  2. enum {
  3.     MinFilter_Nearest = 0,
  4.     MinFilter_Linear = 1,
  5.     MinFilter_NearestMipNearest = 2,
  6.     MinFilter_NearestMipLinear = 3,
  7.     MinFilter_LinearMipNearest = 4,
  8.     MinFilter_LinearMipLinear = 5,
  9.     MinFilter_Invalid = 6,
  10.     MagFilter_Nearest = 0,
  11.     MagFilter_Linear = 1,
  12.     MagFilter_Invalid = 2,
  13.     WrapMode_Repeat = 0,
  14.     WrapMode_Clamp = 1,
  15.     WrapMode_Invalid = 2
  16. };
  17. // They are the same between both renderers
  18.  
  19. // GLES conversion tables:
  20. static GLint const minfiltertable[] = {
  21.     GL_NEAREST,
  22.     GL_LINEAR,
  23.     GL_NEAREST_MIPMAP_NEAREST,
  24.     GL_NEAREST_MIPMAP_LINEAR,
  25.     GL_LINEAR_MIPMAP_NEAREST,
  26.     GL_LINEAR_MIPMAP_LINEAR
  27. };
  28. static GLint const magfiltertable[] = {
  29.     GL_NEAREST,
  30.     GL_LINEAR
  31. };
  32. static GLint const wrapmodetable[] = {
  33.     GL_REPEAT,
  34.     GL_CLAMP_TO_EDGE
  35. };
  36.  
  37. // D3D conversion tables:
  38. static int const minfiltertable[] = {
  39.     D3DTEXF_POINT,
  40.     D3DTEXF_LINEAR,
  41.     D3DTEXF_POINT,
  42.     D3DTEXF_LINEAR,
  43.     D3DTEXF_POINT,
  44.     D3DTEXF_LINEAR
  45. };
  46. static int const mipfiltertable[] = {
  47.     D3DTEXF_NONE,
  48.     D3DTEXF_NONE,
  49.     D3DTEXF_POINT,
  50.     D3DTEXF_POINT,
  51.     D3DTEXF_LINEAR,
  52.     D3DTEXF_LINEAR
  53. };
  54. static int const magfiltertable[] = {
  55.     D3DTEXF_POINT,
  56.     D3DTEXF_LINEAR
  57. };
  58. static int const wrapmodetable[] = {
  59.     D3DTADDRESS_WRAP,
  60.     D3DTADDRESS_CLAMP
  61. };
  62.  
  63. // Where both my module and GLES use a single state variable for minification filtering, D3D exposes two different variables: D3DSAMP_MINFILTER controls how a single particular mip-level is sampled and D3DSAMP_MIPFILTER controls whether mip-levels are used and whether neighbouring mip-levels are blended together.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement