Cogs.Core
EffectsGLES30.h
1#pragma once
2
3#include "../Base/EffectsCommon.h"
4
5#include "CommonGLES30.h"
6
7#include "../Base/Utilities.h"
8
9namespace Cogs
10{
11 struct ContextGLES30;
12
14 {
15 void initialize(ContextGLES30* context);
16
17 EffectHandle load(const ProcessedContent & vsSource,
18 const ProcessedContent & hsSource,
19 const ProcessedContent & dsSource,
20 const ProcessedContent & gsSource,
21 const ProcessedContent & psSource,
22 const StringView & vsEntryPoint,
23 const StringView & hsEntryPoint,
24 const StringView & dsEntryPoint,
25 const StringView & gsEntryPoint,
26 const StringView & psEntryPoint,
27 const EffectDescription & desc) override;
28
29 void releaseEffect(EffectHandle handle);
30
31 EffectVariableHandle getEffectVariable(EffectHandle effectHandle, const StringView & name) override;
33
34 TextureBindingHandle getTextureBinding(EffectHandle effectHandle, const StringView & name, const unsigned int slot) override;
35 SamplerStateBindingHandle getSamplerStateBinding(EffectHandle effectHandle, const StringView & name, const unsigned int slot) override;
36
37 void releaseResources();
38
40
41 // Inherited via EffectsCommon
42 virtual EffectHandle loadComputeEffect(const StringView & fileName, EffectFlags::EEffectFlags effectFlags) override;
43 virtual EffectHandle loadComputeEffect(const StringView & fileName, const PreprocessorDefinitions & definitions, EffectFlags::EEffectFlags effectFlags) override;
44 private:
45 ContextGLES30* context = nullptr;
46 EffectHandle loadEffect(const char* pVertexSource, const char* pFragmentSource, const PreprocessorDefinitions& definitions, EffectFlags::EEffectFlags effectFlags);
47 GLint loadShader(GLenum shaderType, const char* pSource, PreprocessorDefinitions definitions);
48
49 };
50}
Provides a weakly referenced view over the contents of a string.
Definition: StringView.h:24
Contains all Cogs related functionality.
Definition: FieldSetter.h:23
std::vector< PreprocessorDefinition > PreprocessorDefinitions
A set of preprocessor definitions.
Definition: IEffects.h:13
Contains an effect description used to load a single effect.
Definition: IEffects.h:55
EEffectFlags
Effect source flags.
Definition: IEffects.h:20
SamplerStateBindingHandle getSamplerStateBinding(EffectHandle effectHandle, const StringView &name, const unsigned int slot) override
Get a handle to a sampler state object binding, mapping how to bind the sampler state to the given ef...
EffectVariableHandle getEffectVariable(EffectHandle effectHandle, const StringView &name) override
Get a handle to the variable with the given name in the effect with the given effectHandle.
virtual EffectHandle loadComputeEffect(const StringView &fileName, EffectFlags::EEffectFlags effectFlags) override
Load the compute shader with the given file name and create an effect.
void releaseResources()
Release all allocated effect resources.
TextureBindingHandle getTextureBinding(EffectHandle effectHandle, const StringView &name, const unsigned int slot) override
Get a handle to a texture object binding, mapping how to bind textures to the given effect.
ConstantBufferBindingHandle getConstantBufferBinding(EffectHandle effectHandle, const StringView &name) override
Get a handle to a constant buffer binding, mapping how to bind a constant buffer to the given effect.
void releaseEffect(EffectHandle handle)
Release the effect with the given handle, freeing all resources generated during program loading.