void FrameBufferObjectSurface::AttachTexture(Texture& texture, GLenum attachment, int mipmapLevel) { SafeBind(); glFramebufferTexture2D( GL_FRAMEBUFFER, attachment, texture.getTargetType(), texture.getTextureID(), mipmapLevel ); SafeUnbind(); }
void Shader::PrepareUniform(string name) { SafeBind(); if (uniforms.Find(name) == -1) { uniforms.Add(name); } GetUniformLocation(name); SafeUnbind(); }
void Asset::UnbindIfNeeded() { if (isBound) SafeUnbind(); }
void Asset::UnbindIfNeeded(bool check) { if (check) SafeUnbind(); }