mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 20:52:36 +01:00
Cleanup.
This commit is contained in:
@@ -281,11 +281,11 @@ class ExampleOIT : public entry::AppI
|
||||
ImGui::SetNextWindowPos(ImVec2((float)m_width - (float)m_width / 4.0f - 10.0f, 10.0f) );
|
||||
ImGui::SetNextWindowSize(ImVec2((float)m_width / 4.0f, (float)m_height / 3.0f) );
|
||||
ImGui::Begin("Settings"
|
||||
, NULL
|
||||
, ImVec2((float)m_width / 4.0f, (float)m_height / 3.0f)
|
||||
, ImGuiWindowFlags_AlwaysAutoResize
|
||||
);
|
||||
|
||||
, NULL
|
||||
, ImVec2((float)m_width / 4.0f, (float)m_height / 3.0f)
|
||||
, ImGuiWindowFlags_AlwaysAutoResize
|
||||
);
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
ImGui::Text("Blend mode:");
|
||||
@@ -295,7 +295,7 @@ class ExampleOIT : public entry::AppI
|
||||
ImGui::RadioButton("MRT Independent", &m_mode, 2);
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
|
||||
ImGui::Checkbox("Front to back", &m_frontToBack);
|
||||
ImGui::Checkbox("Fade in/out", &m_fadeInOut);
|
||||
|
||||
@@ -410,48 +410,48 @@ class ExampleOIT : public entry::AppI
|
||||
;
|
||||
|
||||
const uint64_t stateNoDepth = 0
|
||||
| BGFX_STATE_CULL_CW
|
||||
| BGFX_STATE_RGB_WRITE
|
||||
| BGFX_STATE_ALPHA_WRITE
|
||||
| BGFX_STATE_DEPTH_TEST_ALWAYS
|
||||
| BGFX_STATE_MSAA
|
||||
;
|
||||
| BGFX_STATE_CULL_CW
|
||||
| BGFX_STATE_RGB_WRITE
|
||||
| BGFX_STATE_ALPHA_WRITE
|
||||
| BGFX_STATE_DEPTH_TEST_ALWAYS
|
||||
| BGFX_STATE_MSAA
|
||||
;
|
||||
|
||||
bgfx::ProgramHandle program = BGFX_INVALID_HANDLE;
|
||||
switch (m_mode)
|
||||
{
|
||||
case 0:
|
||||
// Set vertex and fragment shaders.
|
||||
program = m_blend;
|
||||
case 0:
|
||||
// Set vertex and fragment shaders.
|
||||
program = m_blend;
|
||||
|
||||
// Set render states.
|
||||
bgfx::setState(state
|
||||
| BGFX_STATE_BLEND_ALPHA
|
||||
);
|
||||
break;
|
||||
// Set render states.
|
||||
bgfx::setState(state
|
||||
| BGFX_STATE_BLEND_ALPHA
|
||||
);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
// Set vertex and fragment shaders.
|
||||
program = m_wbSeparatePass;
|
||||
case 1:
|
||||
// Set vertex and fragment shaders.
|
||||
program = m_wbSeparatePass;
|
||||
|
||||
// Set render states.
|
||||
bgfx::setState(stateNoDepth
|
||||
| BGFX_STATE_BLEND_FUNC_SEPARATE(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ZERO, BGFX_STATE_BLEND_INV_SRC_ALPHA)
|
||||
);
|
||||
break;
|
||||
// Set render states.
|
||||
bgfx::setState(stateNoDepth
|
||||
| BGFX_STATE_BLEND_FUNC_SEPARATE(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ZERO, BGFX_STATE_BLEND_INV_SRC_ALPHA)
|
||||
);
|
||||
break;
|
||||
|
||||
default:
|
||||
// Set vertex and fragment shaders.
|
||||
program = m_wbPass;
|
||||
default:
|
||||
// Set vertex and fragment shaders.
|
||||
program = m_wbPass;
|
||||
|
||||
// Set render states.
|
||||
bgfx::setState(stateNoDepth
|
||||
| BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ONE)
|
||||
| BGFX_STATE_BLEND_INDEPENDENT
|
||||
, 0
|
||||
| BGFX_STATE_BLEND_FUNC_RT_1(BGFX_STATE_BLEND_ZERO, BGFX_STATE_BLEND_SRC_COLOR)
|
||||
);
|
||||
break;
|
||||
// Set render states.
|
||||
bgfx::setState(stateNoDepth
|
||||
| BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ONE)
|
||||
| BGFX_STATE_BLEND_INDEPENDENT
|
||||
, 0
|
||||
| BGFX_STATE_BLEND_FUNC_RT_1(BGFX_STATE_BLEND_ZERO, BGFX_STATE_BLEND_SRC_COLOR)
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
// Submit primitive for rendering to view 0.
|
||||
|
||||
Reference in New Issue
Block a user