From 2e5a6f34e3c2f958848c830ba2c6f081d5968144 Mon Sep 17 00:00:00 2001 From: Stephan Vedder Date: Mon, 2 May 2022 08:03:49 +0200 Subject: Start replacing some legacy formats --- Libraries/glad/include/glad/glad.h | 15 ++++++++++++--- Libraries/glad/src/glad.c | 9 ++++++--- Source/Images/nv_image_dds.cpp | 28 ++++++++++++++-------------- 3 files changed, 32 insertions(+), 20 deletions(-) diff --git a/Libraries/glad/include/glad/glad.h b/Libraries/glad/include/glad/glad.h index 38b36ad6..16a810cb 100644 --- a/Libraries/glad/include/glad/glad.h +++ b/Libraries/glad/include/glad/glad.h @@ -1,12 +1,13 @@ /* - OpenGL loader generated by glad 0.1.35 on Sun May 1 09:33:40 2022. + OpenGL loader generated by glad 0.1.35 on Mon May 2 06:01:47 2022. Language/Generator: C/C++ Specification: gl APIs: gl=3.2 Profile: core Extensions: + GL_EXT_texture_compression_latc, GL_EXT_texture_compression_s3tc, GL_EXT_texture_sRGB Loader: True @@ -15,9 +16,9 @@ Reproducible: False Commandline: - --profile="core" --api="gl=3.2" --generator="c" --spec="gl" --extensions="GL_EXT_texture_compression_s3tc,GL_EXT_texture_sRGB" + --profile="core" --api="gl=3.2" --generator="c" --spec="gl" --extensions="GL_EXT_texture_compression_latc,GL_EXT_texture_compression_s3tc,GL_EXT_texture_sRGB" Online: - https://glad.dav1d.de/#profile=core&language=c&specification=gl&loader=on&api=gl%3D3.2&extensions=GL_EXT_texture_compression_s3tc&extensions=GL_EXT_texture_sRGB + https://glad.dav1d.de/#profile=core&language=c&specification=gl&loader=on&api=gl%3D3.2&extensions=GL_EXT_texture_compression_latc&extensions=GL_EXT_texture_compression_s3tc&extensions=GL_EXT_texture_sRGB */ @@ -1928,6 +1929,10 @@ typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC)(GLuint maskNumber, GLbitfield mask GLAPI PFNGLSAMPLEMASKIPROC glad_glSampleMaski; #define glSampleMaski glad_glSampleMaski #endif +#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 +#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 +#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 +#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 #define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 #define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 #define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 @@ -1948,6 +1953,10 @@ GLAPI PFNGLSAMPLEMASKIPROC glad_glSampleMaski; #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F +#ifndef GL_EXT_texture_compression_latc +#define GL_EXT_texture_compression_latc 1 +GLAPI int GLAD_GL_EXT_texture_compression_latc; +#endif #ifndef GL_EXT_texture_compression_s3tc #define GL_EXT_texture_compression_s3tc 1 GLAPI int GLAD_GL_EXT_texture_compression_s3tc; diff --git a/Libraries/glad/src/glad.c b/Libraries/glad/src/glad.c index 9badab8f..29e6a268 100644 --- a/Libraries/glad/src/glad.c +++ b/Libraries/glad/src/glad.c @@ -1,12 +1,13 @@ /* - OpenGL loader generated by glad 0.1.35 on Sun May 1 09:33:40 2022. + OpenGL loader generated by glad 0.1.35 on Mon May 2 06:01:47 2022. Language/Generator: C/C++ Specification: gl APIs: gl=3.2 Profile: core Extensions: + GL_EXT_texture_compression_latc, GL_EXT_texture_compression_s3tc, GL_EXT_texture_sRGB Loader: True @@ -15,9 +16,9 @@ Reproducible: False Commandline: - --profile="core" --api="gl=3.2" --generator="c" --spec="gl" --extensions="GL_EXT_texture_compression_s3tc,GL_EXT_texture_sRGB" + --profile="core" --api="gl=3.2" --generator="c" --spec="gl" --extensions="GL_EXT_texture_compression_latc,GL_EXT_texture_compression_s3tc,GL_EXT_texture_sRGB" Online: - https://glad.dav1d.de/#profile=core&language=c&specification=gl&loader=on&api=gl%3D3.2&extensions=GL_EXT_texture_compression_s3tc&extensions=GL_EXT_texture_sRGB + https://glad.dav1d.de/#profile=core&language=c&specification=gl&loader=on&api=gl%3D3.2&extensions=GL_EXT_texture_compression_latc&extensions=GL_EXT_texture_compression_s3tc&extensions=GL_EXT_texture_sRGB */ #include @@ -583,6 +584,7 @@ PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer = NULL; PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer = NULL; PFNGLVIEWPORTPROC glad_glViewport = NULL; PFNGLWAITSYNCPROC glad_glWaitSync = NULL; +int GLAD_GL_EXT_texture_compression_latc = 0; int GLAD_GL_EXT_texture_compression_s3tc = 0; int GLAD_GL_EXT_texture_sRGB = 0; static void load_GL_VERSION_1_0(GLADloadproc load) { @@ -939,6 +941,7 @@ static void load_GL_VERSION_3_2(GLADloadproc load) { } static int find_extensionsGL(void) { if (!get_exts()) return 0; + GLAD_GL_EXT_texture_compression_latc = has_ext("GL_EXT_texture_compression_latc"); GLAD_GL_EXT_texture_compression_s3tc = has_ext("GL_EXT_texture_compression_s3tc"); GLAD_GL_EXT_texture_sRGB = has_ext("GL_EXT_texture_sRGB"); free_exts(); diff --git a/Source/Images/nv_image_dds.cpp b/Source/Images/nv_image_dds.cpp index 8db8922e..d8262148 100644 --- a/Source/Images/nv_image_dds.cpp +++ b/Source/Images/nv_image_dds.cpp @@ -319,7 +319,7 @@ bool Image::readDDS( const char *file, Image& i) { case FOURCC_A8: i._format = GL_ALPHA; - i._internalFormat = GL_ALPHA8; + i._internalFormat = GL_R8; i._type = GL_UNSIGNED_BYTE; bytesPerElement = 1; break; @@ -360,43 +360,43 @@ bool Image::readDDS( const char *file, Image& i) { break; case FOURCC_L8: - i._format = GL_LUMINANCE; - i._internalFormat = GL_LUMINANCE8; + i._format = GL_RED; + i._internalFormat = GL_R8; i._type = GL_UNSIGNED_BYTE; bytesPerElement = 1; break; case FOURCC_A8L8: - i._format = GL_LUMINANCE_ALPHA; - i._internalFormat = GL_LUMINANCE8_ALPHA8; + i._format = GL_RG; + i._internalFormat = GL_RG8; i._type = GL_UNSIGNED_BYTE; bytesPerElement = 2; break; case FOURCC_L16: - i._format = GL_LUMINANCE; - i._internalFormat = GL_LUMINANCE16; + i._format = GL_RED; + i._internalFormat = GL_R16; i._type = GL_UNSIGNED_SHORT; bytesPerElement = 2; break; case FOURCC_R16F: - i._format = GL_LUMINANCE; //should use red, once it is available - i._internalFormat = GL_LUMINANCE16F_ARB; + i._format = GL_RED; //should use red, once it is available + i._internalFormat = GL_R16F; i._type = GL_HALF_FLOAT; bytesPerElement = 2; break; case FOURCC_A16B16G16R16F: i._format = GL_RGBA; - i._internalFormat = GL_RGBA16F_ARB; + i._internalFormat = GL_RGBA16F; i._type = GL_HALF_FLOAT; bytesPerElement = 8; break; case FOURCC_R32F: - i._format = GL_LUMINANCE; //should use red, once it is available - i._internalFormat = GL_LUMINANCE32F_ARB; + i._format = GL_RED; //should use red, once it is available + i._internalFormat = GL_R32F; i._type = GL_FLOAT; bytesPerElement = 4; break; @@ -453,8 +453,8 @@ bool Image::readDDS( const char *file, Image& i) { } else if (ddsh.ddspf.dwRGBBitCount == 8) { - i._format = GL_LUMINANCE; - i._internalFormat = GL_LUMINANCE8; + i._format = GL_RED; + i._internalFormat = GL_R8; i._type = GL_UNSIGNED_BYTE; bytesPerElement = 1; } -- cgit v1.2.3