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