|
|
@ -21,6 +21,8 @@ OpenGLState::OpenGLState() {
|
|
|
|
depth.test_enabled = false;
|
|
|
|
depth.test_enabled = false;
|
|
|
|
depth.test_func = GL_LESS;
|
|
|
|
depth.test_func = GL_LESS;
|
|
|
|
depth.write_mask = GL_TRUE;
|
|
|
|
depth.write_mask = GL_TRUE;
|
|
|
|
|
|
|
|
depth.depth_range_near = 0.0f;
|
|
|
|
|
|
|
|
depth.depth_range_far = 1.0f;
|
|
|
|
|
|
|
|
|
|
|
|
color_mask.red_enabled = GL_TRUE;
|
|
|
|
color_mask.red_enabled = GL_TRUE;
|
|
|
|
color_mask.green_enabled = GL_TRUE;
|
|
|
|
color_mask.green_enabled = GL_TRUE;
|
|
|
@ -119,6 +121,12 @@ void OpenGLState::Apply() const {
|
|
|
|
glDepthMask(depth.write_mask);
|
|
|
|
glDepthMask(depth.write_mask);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Depth range
|
|
|
|
|
|
|
|
if (depth.depth_range_near != cur_state.depth.depth_range_near ||
|
|
|
|
|
|
|
|
depth.depth_range_far != cur_state.depth.depth_range_far) {
|
|
|
|
|
|
|
|
glDepthRange(depth.depth_range_near, depth.depth_range_far);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Color mask
|
|
|
|
// Color mask
|
|
|
|
if (color_mask.red_enabled != cur_state.color_mask.red_enabled ||
|
|
|
|
if (color_mask.red_enabled != cur_state.color_mask.red_enabled ||
|
|
|
|
color_mask.green_enabled != cur_state.color_mask.green_enabled ||
|
|
|
|
color_mask.green_enabled != cur_state.color_mask.green_enabled ||
|
|
|
|