Skip to content

Commit

Permalink
Could not render more than Renderer2DData::MaxTextureSlots different …
Browse files Browse the repository at this point in the history
…textures (TheCherno#218)
  • Loading branch information
LovelySanta authored Apr 20, 2020
1 parent b6669e1 commit 3d5068b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Hazel/src/Hazel/Renderer/Renderer2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ namespace Hazel {

if (textureIndex == 0.0f)
{
if (s_Data.TextureSlotIndex >= Renderer2DData::MaxTextureSlots)
FlushAndReset();

textureIndex = (float)s_Data.TextureSlotIndex;
s_Data.TextureSlots[s_Data.TextureSlotIndex] = texture;
s_Data.TextureSlotIndex++;
Expand Down Expand Up @@ -301,6 +304,9 @@ namespace Hazel {

if (textureIndex == 0.0f)
{
if (s_Data.TextureSlotIndex >= Renderer2DData::MaxTextureSlots)
FlushAndReset();

textureIndex = (float)s_Data.TextureSlotIndex;
s_Data.TextureSlots[s_Data.TextureSlotIndex] = texture;
s_Data.TextureSlotIndex++;
Expand Down

0 comments on commit 3d5068b

Please sign in to comment.