Skip to content

Commit 17b0d5c

Browse files
committed
Added support for EXT_texture_compression_s3tc extension.
1 parent 072deec commit 17b0d5c

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
3.0.2.0
22
-------
3-
* Added `PixelInternalFormat` constructors for S3_s3tc extension.
3+
* Added `PixelInternalFormat` constructors for S3_s3tc and EXT_texture_compression_s3tc extensions.
44

55
3.0.1.0
66
-------

src/Graphics/Rendering/OpenGL/GL/Texturing/PixelInternalFormat.hs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ data PixelInternalFormat =
139139
| RGBA4S3TC
140140
| RGBADXT5S3TC
141141
| RGBA4DXT5S3TC
142+
| CompressedRGBAS3TCDXT1
143+
| CompressedRGBAS3TCDXT3
144+
| CompressedRGBAS3TCDXT5
145+
| CompressedRGBS3TCDXT1
142146
deriving ( Eq, Ord, Show )
143147

144148
marshalPixelInternalFormat :: PixelInternalFormat -> GLint
@@ -259,6 +263,10 @@ marshalPixelInternalFormat x = fromIntegral $ case x of
259263
RGBA4S3TC -> GL_RGBA4_S3TC
260264
RGBADXT5S3TC -> GL_RGBA_DXT5_S3TC
261265
RGBA4DXT5S3TC -> GL_RGBA4_DXT5_S3TC
266+
CompressedRGBAS3TCDXT1 -> GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
267+
CompressedRGBAS3TCDXT3 -> GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
268+
CompressedRGBAS3TCDXT5 -> GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
269+
CompressedRGBS3TCDXT1 -> GL_COMPRESSED_RGB_S3TC_DXT1_EXT
262270

263271
-- *sigh* The OpenGL API is sometimes a bit creative in its usage of types...
264272
marshalPixelInternalFormat' :: PixelInternalFormat -> GLenum
@@ -377,6 +385,10 @@ unmarshalPixelInternalFormat x
377385
| y == GL_RGBA4_S3TC = RGBA4S3TC
378386
| y == GL_RGBA_DXT5_S3TC = RGBADXT5S3TC
379387
| y == GL_RGBA4_DXT5_S3TC = RGBA4DXT5S3TC
388+
| y == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT = CompressedRGBAS3TCDXT1
389+
| y == GL_COMPRESSED_RGBA_S3TC_DXT3_EXT = CompressedRGBAS3TCDXT3
390+
| y == GL_COMPRESSED_RGBA_S3TC_DXT5_EXT = CompressedRGBAS3TCDXT5
391+
| y == GL_COMPRESSED_RGB_S3TC_DXT1_EXT = CompressedRGBS3TCDXT1
380392
-- legacy values
381393
| y == 1 = Luminance'
382394
| y == 2 = LuminanceAlpha'

0 commit comments

Comments
 (0)