7 #include "GLStateTypes.h"
23 static const int NumOfTextureUnits = 8;
24 std::vector<GLStateFunc2<GLenum, GLuint> > m_boundTextures;
42 inline void BindTexture2D(
const GLuint textureId)
44 int textureUnit = (ActiveTexture.GetValue() - GL_TEXTURE0);
45 Eegeo_ASSERT(textureUnit < NumOfTextureUnits);
46 m_boundTextures[textureUnit].TrySet(GL_TEXTURE_2D, textureId);
49 inline void BindTextureCubeMap(
const GLuint textureId)
51 int textureUnit = (ActiveTexture.GetValue() - GL_TEXTURE0);
52 Eegeo_ASSERT(textureUnit < NumOfTextureUnits);
53 m_boundTextures[textureUnit].TrySet(GL_TEXTURE_CUBE_MAP, textureId);
59 inline void BindArrayBuffer(GLuint bufferId)
61 Eegeo_GL(glBindBuffer(GL_ARRAY_BUFFER, bufferId));
65 inline void BindElementArrayBuffer(GLuint bufferId)
67 Eegeo_GL(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bufferId));
103 void InvalidateAll();
104 u32 TrySet(
const GLState& stateToSet);
106 void SetDefaultState();
108 void ResetCounters();
109 int GetNumOfAttemptedSets()
const;
110 int GetNumOfActualSets()
const;
111 int GetNumOfValid()
const;
113 void ClearTrySetAttempted();
114 u32 TrySetIfNotAttempted(
const GLState& stateToSet);