aboutsummaryrefslogtreecommitdiff
path: root/Graphics/Glyph/Textures.hs
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2022-12-02 01:52:24 -0700
committerJosh Rahm <joshuarahm@gmail.com>2022-12-02 01:53:24 -0700
commit0d8449f6632038ac38385bae8254f769333edc28 (patch)
tree4494b01784b6840e205c22a1ba6288852ca9a3fe /Graphics/Glyph/Textures.hs
parenta006a8dfc1d30a12160346da3c0ece4460b49966 (diff)
downloadearths-ring-0d8449f6632038ac38385bae8254f769333edc28.tar.gz
earths-ring-0d8449f6632038ac38385bae8254f769333edc28.tar.bz2
earths-ring-0d8449f6632038ac38385bae8254f769333edc28.zip
Update this ancient project to work with modern Haskell.
Thsi is a big change, particularly with the SDL library. Not all the original functionality is restored yet, but it's pretty close. As a part of this reworking, I have moved the project to Stack.
Diffstat (limited to 'Graphics/Glyph/Textures.hs')
-rw-r--r--Graphics/Glyph/Textures.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Graphics/Glyph/Textures.hs b/Graphics/Glyph/Textures.hs
index 7e86d2a..55b18fc 100644
--- a/Graphics/Glyph/Textures.hs
+++ b/Graphics/Glyph/Textures.hs
@@ -3,9 +3,9 @@ module Graphics.Glyph.Textures where
import Data.Array.Storable
import Data.Word
-import Graphics.Rendering.OpenGL.Raw.Core31
import Graphics.Rendering.OpenGL
import Control.Monad
+import Graphics.GL.Compatibility30
data Pixels =
PixelsRGB (Int,Int) (StorableArray Int Word8) |
@@ -32,8 +32,8 @@ attachPixelsToTexture pixels tex =
withStorableArray (pixelsArray pixels) $ \ptr -> do
textureBinding Texture2D $= Just tex
case pixels of
- PixelsRGB (w,h) _ -> glTexImage2D gl_TEXTURE_2D 0 3 (f w) (f h) 0 gl_RGB gl_UNSIGNED_BYTE ptr
- PixelsRGBA (w,h) _ -> glTexImage2D gl_TEXTURE_2D 0 4 (f w) (f h) 0 gl_RGBA gl_UNSIGNED_BYTE ptr
+ PixelsRGB (w,h) _ -> glTexImage2D GL_TEXTURE_2D 0 3 (f w) (f h) 0 GL_RGB GL_UNSIGNED_BYTE ptr
+ PixelsRGBA (w,h) _ -> glTexImage2D GL_TEXTURE_2D 0 4 (f w) (f h) 0 GL_RGBA GL_UNSIGNED_BYTE ptr
where f = fromIntegral