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