src/library/textures.cc
// This function could potentially be called by either glSamplerParameter or glTexParameter:
This function could potentially be called by either glSamplerParameter or glTexParameter.
This function could potentially be called by either glSamplerParameter or glTexParameter .
static inline void
_rsxgl_set_sampler_parameteri(rsxgl_context_t * ctx,sampler_t & sampler,GLenum pname, uint32_t param)
{
  if(pname == GL_TEXTURE_MIN_FILTER) {
    switch(param) {
    case GL_NEAREST:
      sampler.filter_min = RSXGL_NEAREST;
      break;
    case GL_LINEAR:
      sampler.filter_min = RSXGL_LINEAR;
      break;
    case GL_NEAREST_MIPMAP_NEAREST:
      sampler.filter_min = RSXGL_NEAREST_MIPMAP_NEAREST;
      break;
    case GL_LINEAR_MIPMAP_NEAREST:
      sampler.filter_min = RSXGL_LINEAR_MIPMAP_NEAREST;
      break;
    case GL_NEAREST_MIPMAP_LINEAR:
      sampler.filter_min = RSXGL_LINEAR_MIPMAP_LINEAR;
      break;
    case GL_LINEAR_MIPMAP_LINEAR:
      sampler.filter_min = RSXGL_NEAREST_MIPMAP_LINEAR;
      break;
    };
  }
  else if(pname == GL_TEXTURE_MAG_FILTER) {
    switch(param) {
    case GL_NEAREST:
      sampler.filter_mag = RSXGL_NEAREST;
      break;
    case GL_LINEAR:
      sampler.filter_mag = RSXGL_LINEAR;
      break;
    default:
      break;
    };
  }
  else if(pname == GL_TEXTURE_WRAP_S || pname == GL_TEXTURE_WRAP_T || pname == GL_TEXTURE_WRAP_R) {
    uint8_t value = 0;
    switch(param) {
    case GL_REPEAT:
      value = RSXGL_REPEAT;
      break;
    case GL_CLAMP_TO_EDGE:
      value = RSXGL_CLAMP_TO_EDGE;
      break;
    case GL_MIRRORED_REPEAT:
      value = RSXGL_MIRRORED_REPEAT;
      break;
    default:
      break;
    };
    switch(pname) {
    case GL_TEXTURE_WRAP_S:
      sampler.wrap_s = value;
      break;
    case GL_TEXTURE_WRAP_T:
      sampler.wrap_t = value;
      break;
    case GL_TEXTURE_WRAP_R:
      sampler.wrap_r = value;
      break;
    default:
      break;
    };
  }
  else if(pname == GL_TEXTURE_COMPARE_MODE) {
    switch(param) {
    case GL_COMPARE_REF_TO_TEXTURE:
      sampler.compare_mode = 1;
      break;
    case GL_NONE:
      sampler.compare_mode = 0;
    default:
      break;
    }
  }
  else if(pname == GL_TEXTURE_COMPARE_FUNC) {
    switch(param) {
    case GL_NEVER:
      sampler.compare_func = RSXGL_TEXTURE_COMPARE_NEVER;
      break;
    case GL_LESS:
      sampler.compare_func = RSXGL_TEXTURE_COMPARE_LESS;
      break;
    case GL_EQUAL:
      sampler.compare_func = RSXGL_TEXTURE_COMPARE_EQUAL;
      break;
    case GL_LEQUAL:
      sampler.compare_func = RSXGL_TEXTURE_COMPARE_LEQUAL;
      break;
    case GL_GREATER:
      sampler.compare_func = RSXGL_TEXTURE_COMPARE_GREATER;
      break;
    case GL_NOTEQUAL:
      sampler.compare_func = RSXGL_TEXTURE_COMPARE_NOTEQUAL;
      break;
    case GL_GEQUAL:
      sampler.compare_func = RSXGL_TEXTURE_COMPARE_GEQUAL;
      break;
    case GL_ALWAYS:
      sampler.compare_func = RSXGL_TEXTURE_COMPARE_ALWAYS;
      break;
    default:
      break;
    }
  }
}
static inline void _rsxgl_set_sampler_parameteri ( rsxgl_context_t * ctx , sampler_t & sampler , GLenum pname , uint32_t param ) { if ( pname == GL_TEXTURE_MIN_FILTER ) { switch ( param ) { case GL_NEAREST : sampler . filter_min = RSXGL_NEAREST ; break ; case GL_LINEAR : sampler . filter_min = RSXGL_LINEAR ; break ; case GL_NEAREST_MIPMAP_NEAREST : sampler . filter_min = RSXGL_NEAREST_MIPMAP_NEAREST ; break ; case GL_LINEAR_MIPMAP_NEAREST : sampler . filter_min = RSXGL_LINEAR_MIPMAP_NEAREST ; break ; case GL_NEAREST_MIPMAP_LINEAR : sampler . filter_min = RSXGL_LINEAR_MIPMAP_LINEAR ; break ; case GL_LINEAR_MIPMAP_LINEAR : sampler . filter_min = RSXGL_NEAREST_MIPMAP_LINEAR ; break ; } ; } else if ( pname == GL_TEXTURE_MAG_FILTER ) { switch ( param ) { case GL_NEAREST : sampler . filter_mag = RSXGL_NEAREST ; break ; case GL_LINEAR : sampler . filter_mag = RSXGL_LINEAR ; break ; default : break ; } ; } else if ( pname == GL_TEXTURE_WRAP_S || pname == GL_TEXTURE_WRAP_T || pname == GL_TEXTURE_WRAP_R ) { uint8_t value = 0 ; switch ( param ) { case GL_REPEAT : value = RSXGL_REPEAT ; break ; case GL_CLAMP_TO_EDGE : value = RSXGL_CLAMP_TO_EDGE ; break ; case GL_MIRRORED_REPEAT : value = RSXGL_MIRRORED_REPEAT ; break ; default : break ; } ; switch ( pname ) { case GL_TEXTURE_WRAP_S : sampler . wrap_s = value ; break ; case GL_TEXTURE_WRAP_T : sampler . wrap_t = value ; break ; case GL_TEXTURE_WRAP_R : sampler . wrap_r = value ; break ; default : break ; } ; } else if ( pname == GL_TEXTURE_COMPARE_MODE ) { switch ( param ) { case GL_COMPARE_REF_TO_TEXTURE : sampler . compare_mode = 1 ; break ; case GL_NONE : sampler . compare_mode = 0 ; default : break ; } } else if ( pname == GL_TEXTURE_COMPARE_FUNC ) { switch ( param ) { case GL_NEVER : sampler . compare_func = RSXGL_TEXTURE_COMPARE_NEVER ; break ; case GL_LESS : sampler . compare_func = RSXGL_TEXTURE_COMPARE_LESS ; break ; case GL_EQUAL : sampler . compare_func = RSXGL_TEXTURE_COMPARE_EQUAL ; break ; case GL_LEQUAL : sampler . compare_func = RSXGL_TEXTURE_COMPARE_LEQUAL ; break ; case GL_GREATER : sampler . compare_func = RSXGL_TEXTURE_COMPARE_GREATER ; break ; case GL_NOTEQUAL : sampler . compare_func = RSXGL_TEXTURE_COMPARE_NOTEQUAL ; break ; case GL_GEQUAL : sampler . compare_func = RSXGL_TEXTURE_COMPARE_GEQUAL ; break ; case GL_ALWAYS : sampler . compare_func = RSXGL_TEXTURE_COMPARE_ALWAYS ; break ; default : break ; } } }
This function could potentially be called by either glSamplerParameter or glTexParameter:
This function could potentially be called by either glSamplerParameter or glTexParameter :