123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- #pragma once
- struct ID3D10Blob;
- struct ID3D11PixelShader;
- struct ID3D11VertexShader;
- struct ID3D11Device;
- struct ID3D11DeviceContext;
- struct D3D11_INPUT_ELEMENT_DESC;
- struct ID3D11Buffer;
- struct ID3D11InputLayout;
- namespace Framework
- {
- class Text;
- enum ShaderType
- {
- UNBEKANNT,
- VERTEX,
- PIXEL
- };
-
- class Shader
- {
- protected:
- Text *shader;
- ID3D10Blob *shaderBuffer;
- ShaderType type;
- ID3D11Buffer *constBuffers[ 14 ];
- int buffLen[ 14 ];
- int buffAnz;
- int ref;
- public:
-
- Shader();
-
- ~Shader();
-
-
-
- bool ladeAusDatei( const char *pfad );
-
-
- void setShaderCode( Text *zCode );
-
-
-
-
-
- virtual bool compile( ID3D11Device *zD3d11Device, const char *einstiegsFunktion, const char *type );
-
-
- virtual void benutzeShader( ID3D11DeviceContext *zD3d11Context );
-
-
-
-
-
- bool erstelleConstBuffer( ID3D11Device *zD3d11Device, int size, int index );
-
-
- bool removeConstBuffer( int index );
-
-
-
-
-
- bool füllConstBuffer( ID3D11DeviceContext *zD3d11Context, char *data, int index, int len = -1 );
-
-
- int getConstBufferLänge( int index ) const;
-
- ShaderType getType() const;
-
-
- Shader *getThis();
-
-
- virtual Shader *release();
- };
-
- class PixelShader : public Shader
- {
- private:
- ID3D11PixelShader *pixelShader;
- public:
-
- PixelShader();
-
- ~PixelShader();
-
-
-
-
-
- bool compile( ID3D11Device *zD3d11Device, const char *einstiegsFunktion, const char *version ) override;
-
-
- void benutzeShader( ID3D11DeviceContext *zD3d11Context );
-
-
- Shader *release();
- };
-
- class VertexShader : public Shader
- {
- private:
- ID3D11VertexShader *vertexShader;
- ID3D11InputLayout *inputLayout;
- public:
-
- VertexShader();
-
- ~VertexShader();
-
-
-
-
-
- bool compile( ID3D11Device *zD3d11Device, const char *einstiegsFunktion, const char *version ) override;
-
-
-
-
-
- bool erstelleInputLayout( ID3D11Device *zD3d11Device, D3D11_INPUT_ELEMENT_DESC *descArray, int anz );
-
-
- void benutzeShader( ID3D11DeviceContext *zD3d11Context );
-
-
- Shader *release();
- };
- }
|