Changed OpenGL-Lvl to 3.30 with Tessellation-Ext

- figured out how to enable extensions

refs #471 @1h
This commit is contained in:
Nicole Dresselhaus 2014-03-17 17:04:30 +01:00
parent 7b8201374b
commit 5fc86af233
6 changed files with 18 additions and 7 deletions

View File

@ -1,4 +1,4 @@
#version 400
#version 330
//#include "3rdParty/noise.glsl"

View File

@ -1,4 +1,5 @@
#version 400
#version 330
#extension GL_ARB_tessellation_shader : require
layout(vertices = 3) out;
in vec3 vPosition[];

View File

@ -1,4 +1,6 @@
#version 400
#version 330
#extension GL_ARB_tessellation_shader : require
layout(triangles, equal_spacing, cw) in;
in vec3 tcPosition[];

View File

@ -1,4 +1,4 @@
#version 400
#version 330
//vertex-data
in vec4 Color;

View File

@ -24,7 +24,6 @@ import Control.Lens ((^.), (.~), (%~))
import Linear as L
-- GUI
import qualified Graphics.UI.SDL as SDL (Position)
import Graphics.UI.SDL as SDL
--import Graphics.UI.SDL.TTF as TTF
--import Graphics.UI.SDL.TTF.Types
@ -32,7 +31,7 @@ import Graphics.UI.SDL as SDL
-- Render
import qualified Graphics.Rendering.OpenGL.GL as GL
import Graphics.Rendering.OpenGL.Raw.Core31
import Data.Time (getCurrentTime, UTCTime, diffUTCTime)
import Data.Time (getCurrentTime, diffUTCTime)
import Graphics.Rendering.OpenGL.Raw.ARB.TessellationShader
-- Our modules
@ -73,6 +72,13 @@ main = do
--font <- TTF.openFont "fonts/ttf-04B_03B_/04B_03B_.TTF" 10
--TTF.setFontStyle font TTFNormal
--TTF.setFontHinting font TTFHNormal
{-winRenderer <- getRenderer window
hudTex <- createTexture
winRenderer -- where
PixelFormatRGBA8888 -- RGBA32-bit
TextureAccessStreaming -- change occasionally
1024 -- width
600 -- height-}
let zDistClosest = 1
zDistFarthest = zDistClosest + 30
@ -145,6 +151,7 @@ main = do
}
, _gl = GLState
{ _glMap = glMap
, _hudTexture = Nothing
}
, _game = GameState
{

View File

@ -3,7 +3,7 @@ module Types where
import Control.Concurrent.STM (TQueue)
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 Data.Time (UTCTime)
import Linear.Matrix (M44)
@ -88,6 +88,7 @@ data GLMapState = GLMapState
data GLState = GLState
{ _glMap :: !GLMapState
, _hudTexture :: Maybe Texture
}
data State = State