mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-02 04:37:54 +08:00
Pass shader by reference on mesh/model classes.
This commit is contained in:
@@ -51,7 +51,7 @@ public:
|
||||
}
|
||||
|
||||
// render the mesh
|
||||
void Draw(Shader shader)
|
||||
void Draw(Shader &shader)
|
||||
{
|
||||
// bind appropriate textures
|
||||
unsigned int diffuseNr = 1;
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
}
|
||||
|
||||
// draws the model, and thus all its meshes
|
||||
void Draw(Shader shader)
|
||||
void Draw(Shader &shader)
|
||||
{
|
||||
for(unsigned int i = 0; i < meshes.size(); i++)
|
||||
meshes[i].Draw(shader);
|
||||
|
||||
Reference in New Issue
Block a user