| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // fall through | 89 // fall through |
| 90 case Sampler::ANISOTROPIC: // Anisotropy is handled in SetTextureAndStates | 90 case Sampler::ANISOTROPIC: // Anisotropy is handled in SetTextureAndStates |
| 91 case Sampler::LINEAR: | 91 case Sampler::LINEAR: |
| 92 if (mip_filter == Sampler::NONE) | 92 if (mip_filter == Sampler::NONE) |
| 93 return GL_LINEAR; | 93 return GL_LINEAR; |
| 94 else if (mip_filter == Sampler::POINT) | 94 else if (mip_filter == Sampler::POINT) |
| 95 return GL_LINEAR_MIPMAP_NEAREST; | 95 return GL_LINEAR_MIPMAP_NEAREST; |
| 96 else if (mip_filter == Sampler::LINEAR) | 96 else if (mip_filter == Sampler::LINEAR) |
| 97 return GL_LINEAR_MIPMAP_LINEAR; | 97 return GL_LINEAR_MIPMAP_LINEAR; |
| 98 } | 98 } |
| 99 DCHECK(false); |
| 100 return GL_NONE; |
| 99 } | 101 } |
| 100 | 102 |
| 101 unsigned int GLMagFilter(Sampler::FilterType o3d_filter) { | 103 unsigned int GLMagFilter(Sampler::FilterType o3d_filter) { |
| 102 switch (o3d_filter) { | 104 switch (o3d_filter) { |
| 103 case Sampler::POINT: | 105 case Sampler::POINT: |
| 104 return GL_NEAREST; | 106 return GL_NEAREST; |
| 105 case Sampler::LINEAR: | 107 case Sampler::LINEAR: |
| 106 return GL_LINEAR; | 108 return GL_LINEAR; |
| 107 default: | 109 default: |
| 108 DLOG(ERROR) << "Unknown filter " << static_cast<int>(o3d_filter); | 110 DLOG(ERROR) << "Unknown filter " << static_cast<int>(o3d_filter); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 // time. | 194 // time. |
| 193 GLenum target = GLTextureTarget(the_texture); | 195 GLenum target = GLTextureTarget(the_texture); |
| 194 if (target) { | 196 if (target) { |
| 195 GLenum texture_unit = cgGLGetTextureEnum(cg_param); | 197 GLenum texture_unit = cgGLGetTextureEnum(cg_param); |
| 196 glActiveTextureARB(texture_unit); | 198 glActiveTextureARB(texture_unit); |
| 197 glBindTexture(target, 0); | 199 glBindTexture(target, 0); |
| 198 } | 200 } |
| 199 } | 201 } |
| 200 } | 202 } |
| 201 } // namespace o3d | 203 } // namespace o3d |
| OLD | NEW |