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