Skip to content

Commit

Permalink
Pre OpenGL 3.0 internal texture format enum values supported
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Reid committed Jun 5, 2023
1 parent 026c903 commit 5592666
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/Skybolt/SkyboltVis/OsgImageHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,26 @@ GLuint toSrgbInternalFormat(GLuint format)
case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:
return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;
case 0:
return 0;
case 1: // Prior to OpenGL 3.0, the number of components could be specified explicitly with values 1,2,3,4
case GL_LUMINANCE:
case GL_LUMINANCE8:
return GL_SLUMINANCE8;
case 2:
case GL_LUMINANCE_ALPHA:
case GL_LUMINANCE8_ALPHA8:
return GL_SLUMINANCE8_ALPHA8;
case 3:
case GL_RGB:
case GL_RGB8:
case GL_SRGB8:
return GL_SRGB8;
case 4:
case GL_RGBA:
case GL_RGBA8:
case GL_SRGB8_ALPHA8:
return GL_SRGB8_ALPHA8;
case GL_LUMINANCE:
case GL_LUMINANCE8:
return GL_SLUMINANCE8;
case 0:
return 0;
default:
assert(!"Not implemented");
}
Expand Down

0 comments on commit 5592666

Please sign in to comment.