Copyright | (C) 2015 Dimitri Sabadie |
---|---|
License | BSD3 |
Maintainer | Dimitri Sabadie <dimitri.sabadie@gmail.com> |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Graphics.Luminance.Shader.Stage
Description
- data Stage
- data StageType
- stageID :: Stage -> GLuint
- createStage :: (HasStageError e, MonadError e m, MonadIO m, MonadResource m) => StageType -> String -> m Stage
- data StageError
- class HasStageError a where
- fromStageError :: StageError -> a
Shader stage creation
A shader Stage
type.
createStage :: (HasStageError e, MonadError e m, MonadIO m, MonadResource m) => StageType -> String -> m Stage Source
Create a shader stage from a String
representation of its source code and its type.
Note: on some hardware and backends, tessellation shaders aren’t available. That function
throws UnsupportedStage
error in such cases.
Error handling
data StageError Source
Error type of shaders.
'CompilationFailed reason' occurs when a shader fails to compile, and the String
reason
contains a description of the failure.
'UnsupportedStage stage' occurs when you try to create a shader which type is not supported on the current hardware.
Constructors
CompilationFailed String | |
UnsupportedStage StageType |
Instances
class HasStageError a where Source
Types that can handle StageError
.
Methods
fromStageError :: StageError -> a Source