mirror of
https://github.com/love2d/love.git
synced 2026-08-18 11:44:15 +02:00
made ShaderEffects individully handle texture units for sent images/canvases, added GL helper function for quickly binding a texture to a specific texture unit, hopefully made ShaderEffects load and unload volatile better
This commit is contained in:
@@ -35,7 +35,7 @@ namespace graphics
|
||||
{
|
||||
namespace opengl
|
||||
{
|
||||
// A fragment shader
|
||||
// A GLSL shader
|
||||
class ShaderEffect : public Object, public Volatile
|
||||
{
|
||||
public:
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
virtual bool loadVolatile();
|
||||
virtual void unloadVolatile();
|
||||
|
||||
void attach();
|
||||
void attach(bool temporary = false);
|
||||
static void detach();
|
||||
|
||||
static std::string getGLSLVersion();
|
||||
@@ -75,7 +75,9 @@ private:
|
||||
// texture unit pool for setting images
|
||||
static GLint _current_texture_unit;
|
||||
static GLint _max_texture_units;
|
||||
|
||||
std::map<std::string, GLint> _texture_unit_pool;
|
||||
std::vector<GLuint> _texture_id_list;
|
||||
GLint getTextureUnit(const std::string &name);
|
||||
|
||||
void sendTexture(const std::string &name, GLuint texture);
|
||||
|
||||
Reference in New Issue
Block a user