add some types and dangerous expressions
This commit is contained in:
@@ -81,6 +81,10 @@ instance GLSLExpression Expression where
|
||||
" = " <>
|
||||
(toGLSLText variable1) <>
|
||||
";\n"
|
||||
toGLSLText
|
||||
(DangerousExpression text) =
|
||||
text <>
|
||||
"\n"
|
||||
|
||||
instance GLSLExpression RequestedGLVersion where
|
||||
toGLSLText i = show i
|
||||
@@ -91,6 +95,7 @@ instance GLSLExpression RequestedGLType where
|
||||
instance GLSLExpression ParameterQualifier where
|
||||
toGLSLText In = "in"
|
||||
toGLSLText Out = "out"
|
||||
toGLSLText Uniform = "uniform"
|
||||
|
||||
instance GLSLExpression Variable where
|
||||
toGLSLText GL_POSITION = "gl_Position"
|
||||
@@ -98,6 +103,9 @@ instance GLSLExpression Variable where
|
||||
|
||||
instance GLSLExpression GLSLType where
|
||||
toGLSLText (GLSLVec4 _) = "vec4"
|
||||
toGLSLText (GLSLVec3 _) = "vec3"
|
||||
toGLSLText (GLSLVec2 _) = "vec2"
|
||||
toGLSLText (GLSLMat4 _) = "mat4"
|
||||
toGLSLText GLSLFloat = "float"
|
||||
|
||||
-- TYPES --
|
||||
@@ -116,6 +124,7 @@ data RequestedGLType
|
||||
data ParameterQualifier
|
||||
= In
|
||||
| Out
|
||||
| Uniform
|
||||
deriving (Eq, Show)
|
||||
|
||||
data LayoutQualifier
|
||||
@@ -135,6 +144,9 @@ data Variable
|
||||
data GLSLType
|
||||
= GLSLFloat
|
||||
| GLSLVec4 GLSLType
|
||||
| GLSLVec3 GLSLType
|
||||
| GLSLVec2 GLSLType
|
||||
| GLSLMat4 GLSLType
|
||||
deriving (Eq, Show)
|
||||
|
||||
-- expressions
|
||||
@@ -153,6 +165,8 @@ data Expression
|
||||
| VariableAssignment
|
||||
Variable
|
||||
Variable
|
||||
| DangerousExpression
|
||||
Text
|
||||
deriving Show
|
||||
|
||||
-- errors
|
||||
|
||||
Reference in New Issue
Block a user