1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-10-04 13:27:14 +00:00

Improvements to shader API; use handles instead of raw pointers.

This commit is contained in:
fgenesis 2013-06-15 04:11:11 +02:00
commit 6962a3e3ab
5 changed files with 145 additions and 67 deletions

View file

@ -108,11 +108,23 @@ public:
int screenWidth, screenHeight;
int textureWidth, textureHeight;
std::vector<Shader*> scriptShader;
Vector ** drawGrid;
Vector ** drawGrid;
// returns handle > 0 on success
int loadShaderFile(const char *vert, const char *frag);
int loadShaderSrc(const char *vert, const char *frag);
Shader *getShaderPtr(int handle);
void setShaderPipelineSize(size_t size);
bool setShaderPipelinePos(int handle, size_t pos);
void unloadShader(int handle);
protected:
int _insertShader(Shader *sh);
std::vector<Shader*> shaderPipeline; // Shaders are applied in this order. Can contain the same pointer more than once.
std::vector<Shader*> loadedShaders;
FrameBuffer backupBuffer;
};