Skip to content

Commit

Permalink
Disabling zwrite now works correctly in GL3
Browse files Browse the repository at this point in the history
-zwrite (or depth test) function wasn't flushing the batch.
-Removed a debug printf in BasicGUI.
  • Loading branch information
TheExDeus committed Jun 29, 2015
1 parent f2c584d commit 6254653
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
23 changes: 12 additions & 11 deletions ENIGMAsystem/SHELL/Graphics_Systems/OpenGL3/GL3d3d.cpp
Expand Up @@ -117,8 +117,8 @@ void d3d_end()
// disabling hidden surface removal in means there is no depth buffer
void d3d_set_hidden(bool enable)
{
(enable?glEnable:glDisable)(GL_DEPTH_TEST);
enigma::d3dHidden = enable;
oglmgr->SetEnabled(GL_DEPTH_TEST, enable);
enigma::d3dHidden = enable;
d3d_set_zwriteenable(enable);
}

Expand All @@ -127,6 +127,7 @@ void d3d_set_hidden(bool enable)
// properly particle effects are usually drawn with zwriting disabled because of this as well
void d3d_set_zwriteenable(bool enable)
{
oglmgr->BlendFunc();
glDepthMask(enable);
enigma::d3dZWriteEnable = enable;
}
Expand Down Expand Up @@ -518,12 +519,12 @@ bool d3d_light_enable(int id, bool enable)

void d3d_set_lighting(bool enable)
{
enigma::d3d_lighting.lights_enable(enable);
enigma::d3d_lighting.lights_enable(enable);
oglmgr->Lighting();
enigma::d3d_lighting.light_update();
if (enable == true){
enigma::d3d_lighting.lightsource_update();
}
enigma::d3d_lighting.light_update();
if (enable == true){
enigma::d3d_lighting.lightsource_update();
}
}

void d3d_stencil_start_mask(){
Expand Down Expand Up @@ -562,8 +563,8 @@ void d3d_stencil_end_mask(){
}

namespace enigma {
void d3d_light_update_positions()
{
enigma::d3d_lighting.light_update_positions();
}
void d3d_light_update_positions()
{
enigma::d3d_lighting.light_update_positions();
}
}
Expand Up @@ -54,7 +54,7 @@ namespace enigma_user
gui::gui_data_elements.emplace(gui::gui_data_elements_maxid, gui::Style());
gui::Style &sty = gui::gui_data_elements[gui::gui_data_elements_maxid];
sty.id = gui::gui_data_elements_maxid;
printf("Creating style with size %i\n", sizeof(gui::gui_data_elements[gui::gui_data_elements_maxid]));
//printf("Creating style with size %i\n", sizeof(gui::gui_data_elements[gui::gui_data_elements_maxid]));
return gui::gui_data_elements_maxid++;
}

Expand Down

0 comments on commit 6254653

Please sign in to comment.