Changed OpenGL-Lvl to 3.30 with Tessellation-Ext
- figured out how to enable extensions refs #471 @1h
This commit is contained in:
parent
7b8201374b
commit
5fc86af233
@ -1,4 +1,4 @@
|
|||||||
#version 400
|
#version 330
|
||||||
|
|
||||||
//#include "3rdParty/noise.glsl"
|
//#include "3rdParty/noise.glsl"
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#version 400
|
#version 330
|
||||||
|
#extension GL_ARB_tessellation_shader : require
|
||||||
|
|
||||||
layout(vertices = 3) out;
|
layout(vertices = 3) out;
|
||||||
in vec3 vPosition[];
|
in vec3 vPosition[];
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
#version 400
|
#version 330
|
||||||
|
|
||||||
|
#extension GL_ARB_tessellation_shader : require
|
||||||
|
|
||||||
layout(triangles, equal_spacing, cw) in;
|
layout(triangles, equal_spacing, cw) in;
|
||||||
in vec3 tcPosition[];
|
in vec3 tcPosition[];
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#version 400
|
#version 330
|
||||||
|
|
||||||
//vertex-data
|
//vertex-data
|
||||||
in vec4 Color;
|
in vec4 Color;
|
||||||
|
11
src/Main.hs
11
src/Main.hs
@ -24,7 +24,6 @@ import Control.Lens ((^.), (.~), (%~))
|
|||||||
import Linear as L
|
import Linear as L
|
||||||
|
|
||||||
-- GUI
|
-- GUI
|
||||||
import qualified Graphics.UI.SDL as SDL (Position)
|
|
||||||
import Graphics.UI.SDL as SDL
|
import Graphics.UI.SDL as SDL
|
||||||
--import Graphics.UI.SDL.TTF as TTF
|
--import Graphics.UI.SDL.TTF as TTF
|
||||||
--import Graphics.UI.SDL.TTF.Types
|
--import Graphics.UI.SDL.TTF.Types
|
||||||
@ -32,7 +31,7 @@ import Graphics.UI.SDL as SDL
|
|||||||
-- Render
|
-- Render
|
||||||
import qualified Graphics.Rendering.OpenGL.GL as GL
|
import qualified Graphics.Rendering.OpenGL.GL as GL
|
||||||
import Graphics.Rendering.OpenGL.Raw.Core31
|
import Graphics.Rendering.OpenGL.Raw.Core31
|
||||||
import Data.Time (getCurrentTime, UTCTime, diffUTCTime)
|
import Data.Time (getCurrentTime, diffUTCTime)
|
||||||
|
|
||||||
import Graphics.Rendering.OpenGL.Raw.ARB.TessellationShader
|
import Graphics.Rendering.OpenGL.Raw.ARB.TessellationShader
|
||||||
-- Our modules
|
-- Our modules
|
||||||
@ -73,6 +72,13 @@ main = do
|
|||||||
--font <- TTF.openFont "fonts/ttf-04B_03B_/04B_03B_.TTF" 10
|
--font <- TTF.openFont "fonts/ttf-04B_03B_/04B_03B_.TTF" 10
|
||||||
--TTF.setFontStyle font TTFNormal
|
--TTF.setFontStyle font TTFNormal
|
||||||
--TTF.setFontHinting font TTFHNormal
|
--TTF.setFontHinting font TTFHNormal
|
||||||
|
{-winRenderer <- getRenderer window
|
||||||
|
hudTex <- createTexture
|
||||||
|
winRenderer -- where
|
||||||
|
PixelFormatRGBA8888 -- RGBA32-bit
|
||||||
|
TextureAccessStreaming -- change occasionally
|
||||||
|
1024 -- width
|
||||||
|
600 -- height-}
|
||||||
|
|
||||||
let zDistClosest = 1
|
let zDistClosest = 1
|
||||||
zDistFarthest = zDistClosest + 30
|
zDistFarthest = zDistClosest + 30
|
||||||
@ -145,6 +151,7 @@ main = do
|
|||||||
}
|
}
|
||||||
, _gl = GLState
|
, _gl = GLState
|
||||||
{ _glMap = glMap
|
{ _glMap = glMap
|
||||||
|
, _hudTexture = Nothing
|
||||||
}
|
}
|
||||||
, _game = GameState
|
, _game = GameState
|
||||||
{
|
{
|
||||||
|
@ -3,7 +3,7 @@ module Types where
|
|||||||
|
|
||||||
import Control.Concurrent.STM (TQueue)
|
import Control.Concurrent.STM (TQueue)
|
||||||
import qualified Graphics.Rendering.OpenGL.GL as GL
|
import qualified Graphics.Rendering.OpenGL.GL as GL
|
||||||
import Graphics.UI.SDL as SDL (Event, Window)
|
import Graphics.UI.SDL as SDL (Event, Window, Texture)
|
||||||
import Foreign.C (CFloat)
|
import Foreign.C (CFloat)
|
||||||
import Data.Time (UTCTime)
|
import Data.Time (UTCTime)
|
||||||
import Linear.Matrix (M44)
|
import Linear.Matrix (M44)
|
||||||
@ -88,6 +88,7 @@ data GLMapState = GLMapState
|
|||||||
|
|
||||||
data GLState = GLState
|
data GLState = GLState
|
||||||
{ _glMap :: !GLMapState
|
{ _glMap :: !GLMapState
|
||||||
|
, _hudTexture :: Maybe Texture
|
||||||
}
|
}
|
||||||
|
|
||||||
data State = State
|
data State = State
|
||||||
|
Loading…
Reference in New Issue
Block a user