diff options
| author | Josh Rahm <joshuarahm@gmail.com> | 2022-12-03 01:03:52 -0700 |
|---|---|---|
| committer | Josh Rahm <joshuarahm@gmail.com> | 2022-12-03 01:03:52 -0700 |
| commit | 11fca081b1241e1915f357fa40baa3e97aceb823 (patch) | |
| tree | c0312c145d9133cef5e31b04a71bec050097f0f0 /Graphics/Glyph/ExtendedGL/Framebuffers.hs | |
| parent | 7dd8c59353167e84dab9e7a1afc16e2290b249e3 (diff) | |
| download | terralloc-11fca081b1241e1915f357fa40baa3e97aceb823.tar.gz terralloc-11fca081b1241e1915f357fa40baa3e97aceb823.tar.bz2 terralloc-11fca081b1241e1915f357fa40baa3e97aceb823.zip | |
Start reviving this ancient project. (It's pretty cool).
Got it to compile using Stack.
Skybox works, but nothing else really does. I think this is a problem
with how the program is interpreting the surface pixels when
calculating the map terrain and elevation.
I think some TLC is in order.
Diffstat (limited to 'Graphics/Glyph/ExtendedGL/Framebuffers.hs')
| -rw-r--r-- | Graphics/Glyph/ExtendedGL/Framebuffers.hs | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/Graphics/Glyph/ExtendedGL/Framebuffers.hs b/Graphics/Glyph/ExtendedGL/Framebuffers.hs index abe9756..a6c2891 100644 --- a/Graphics/Glyph/ExtendedGL/Framebuffers.hs +++ b/Graphics/Glyph/ExtendedGL/Framebuffers.hs @@ -6,8 +6,8 @@ module Graphics.Glyph.ExtendedGL.Framebuffers where -import Graphics.Rendering.OpenGL.Raw.ARB -import Graphics.Rendering.OpenGL.Raw.Core31 +import Graphics.GL.Compatibility30 +import Graphics.GL.Core43 import qualified Graphics.Rendering.OpenGL as GL import Graphics.Glyph.ExtendedGL.Base @@ -46,12 +46,12 @@ instance IsGenerable Renderbuffer where glGenRenderbuffers 1 ptr liftM Renderbuffer $ peek ptr instance IsBindable Renderbuffer where - bind = glBindRenderbuffer gl_RENDERBUFFER . unwrap + bind = glBindRenderbuffer GL_RENDERBUFFER . unwrap data RenderbufferArgument = DepthAttachment instance IsWrappedPrimitive GLenum RenderbufferArgument where - unwrap DepthAttachment = gl_DEPTH_ATTACHMENT + unwrap DepthAttachment = GL_DEPTH_ATTACHMENT renderBufferStorageRaw :: (IsGLEnumMarshallable a, IsGLEnumMarshallable b) => a -> b -> Int -> Int -> IO () renderBufferStorageRaw typ enum w h = glRenderbufferStorage (toGLEnum typ) @@ -59,7 +59,7 @@ renderBufferStorageRaw typ enum w h = glRenderbufferStorage (toGLEnum typ) renderBufferStorage :: (IsGLEnumMarshallable a) => Renderbuffer -> SettableStateVar (a,Int,Int) renderBufferStorage buffer = makeSettableStateVar $ \(en,w,h) -> do bind buffer - renderBufferStorageRaw gl_RENDERBUFFER en w h + renderBufferStorageRaw GL_RENDERBUFFER en w h frameBufferRenderBuffer :: forall a b. (IsFramebuffer a,IsGLEnumMarshallable b) => Renderbuffer -> b -> IO a frameBufferRenderBuffer rb e = do @@ -68,7 +68,7 @@ frameBufferRenderBuffer rb e = do unw :: GLuint unw = unwrap rb bind rb - glFramebufferRenderbuffer enum (toGLEnum e) gl_RENDERBUFFER (unwrap rb) + glFramebufferRenderbuffer enum (toGLEnum e) GL_RENDERBUFFER (unwrap rb) return $ wrap unw where test :: a @@ -79,14 +79,14 @@ data FramebufferParameter = DefaultWidth | DefaultHeight instance IsWrappedPrimitive GLenum FramebufferParameter where unwrap p = case p of - DefaultWidth -> gl_FRAMEBUFFER_DEFAULT_WIDTH - DefaultHeight -> gl_FRAMEBUFFER_DEFAULT_HEIGHT - wrap x | x == gl_FRAMEBUFFER_DEFAULT_WIDTH = DefaultWidth - | x == gl_FRAMEBUFFER_DEFAULT_HEIGHT = DefaultHeight + DefaultWidth -> GL_FRAMEBUFFER_DEFAULT_WIDTH + DefaultHeight -> GL_FRAMEBUFFER_DEFAULT_HEIGHT + wrap x | x == GL_FRAMEBUFFER_DEFAULT_WIDTH = DefaultWidth + | x == GL_FRAMEBUFFER_DEFAULT_HEIGHT = DefaultHeight | otherwise = undefined instance HasIntegerParam GLenum DrawFramebuffer where - parami p fb = framebufferBasicParameteri gl_DRAW_FRAMEBUFFER fb p + parami p fb = framebufferBasicParameteri GL_DRAW_FRAMEBUFFER fb p {- Has parameters of type GLuint which are acessable by the data FramebufferParameter for - the type DrawFramebuffer -} @@ -99,11 +99,11 @@ instance IsGenerable DrawFramebuffer where liftM DrawFramebuffer $ peek ptr instance IsBindable DrawFramebuffer where - bind (DrawFramebuffer fb) = glBindFramebuffer gl_DRAW_FRAMEBUFFER fb + bind (DrawFramebuffer fb) = glBindFramebuffer GL_DRAW_FRAMEBUFFER fb instance IsWrappedPrimitive GLuint DrawFramebuffer where unwrap (DrawFramebuffer fb) = fb wrap = DrawFramebuffer instance IsFramebuffer DrawFramebuffer where - getType _ = gl_DRAW_FRAMEBUFFER + getType _ = GL_DRAW_FRAMEBUFFER |