@ -503,7 +503,6 @@ void OpenGLState::ApplySamplers() const {
}
}
void OpenGLState : : ApplyFramebufferState ( ) const {
void OpenGLState : : ApplyFramebufferState ( ) const {
// Framebuffer
if ( draw . read_framebuffer ! = cur_state . draw . read_framebuffer ) {
if ( draw . read_framebuffer ! = cur_state . draw . read_framebuffer ) {
glBindFramebuffer ( GL_READ_FRAMEBUFFER , draw . read_framebuffer ) ;
glBindFramebuffer ( GL_READ_FRAMEBUFFER , draw . read_framebuffer ) ;
}
}
@ -512,6 +511,12 @@ void OpenGLState::ApplyFramebufferState() const {
}
}
}
}
void OpenGLState : : ApplyVertexArrayState ( ) const {
if ( draw . vertex_array ! = cur_state . draw . vertex_array ) {
glBindVertexArray ( draw . vertex_array ) ;
}
}
void OpenGLState : : ApplyDepthClamp ( ) const {
void OpenGLState : : ApplyDepthClamp ( ) const {
if ( depth_clamp . far_plane = = cur_state . depth_clamp . far_plane & &
if ( depth_clamp . far_plane = = cur_state . depth_clamp . far_plane & &
depth_clamp . near_plane = = cur_state . depth_clamp . near_plane ) {
depth_clamp . near_plane = = cur_state . depth_clamp . near_plane ) {
@ -529,11 +534,7 @@ void OpenGLState::ApplyDepthClamp() const {
void OpenGLState : : Apply ( ) const {
void OpenGLState : : Apply ( ) const {
ApplyFramebufferState ( ) ;
ApplyFramebufferState ( ) ;
ApplyVertexArrayState ( ) ;
// Vertex array
if ( draw . vertex_array ! = cur_state . draw . vertex_array ) {
glBindVertexArray ( draw . vertex_array ) ;
}
// Shader program
// Shader program
if ( draw . shader_program ! = cur_state . draw . shader_program ) {
if ( draw . shader_program ! = cur_state . draw . shader_program ) {