hmd orient, vr ui

This commit is contained in:
2018-10-28 22:25:15 +01:00
parent 0fff9f2010
commit b366d6b61f
11 changed files with 145 additions and 16 deletions

View File

@@ -365,7 +365,8 @@ void App::init()
glEnable(GL_LINE_SMOOTH);
#endif
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glBlendEquation(GL_FUNC_ADD);
//glBlendEquation(GL_FUNC_ADD);
glBlendEquationSeparate(GL_FUNC_ADD, GL_MAX);
initShaders();
initAssets();
@@ -492,18 +493,38 @@ void App::update(float dt)
}
return false;
};
//glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
uirtt.bindFramebuffer();
uirtt.clear();
glEnable(GL_SCISSOR_TEST);
for (int i = 1; i < layout[main_id]->m_children.size(); i++)
layout[main_id]->m_children[i]->watch(observer);
//msgbox->watch(observer);
glDisable(GL_SCISSOR_TEST);
uirtt.unbindFramebuffer();
#if __IOS__
[ios_view->glview bindDrawable];
#else
glBindFramebuffer(GL_FRAMEBUFFER, 0);
#endif
//canvas->watch(observer);
glEnable(GL_SCISSOR_TEST);
if (auto* main = layout[main_id])
main->watch(observer);
for (int i = 0; i < layout[main_id]->m_children.size(); i++)
layout[main_id]->m_children[i]->watch(observer);
//msgbox->watch(observer);
glDisable(GL_SCISSOR_TEST);
// glEnable(GL_BLEND);
// sampler.bind(0);
// ui::ShaderManager::use(kShader::Texture);
// ui::ShaderManager::u_int(kShaderUniform::Tex, 0);
// ui::ShaderManager::u_mat4(kShaderUniform::MVP, glm::ortho(-1.f, 1.f, -1.f, 1.f));
// glActiveTexture(GL_TEXTURE0);
// uirtt.bindTexture();
// m_face_plane.draw_fill();
// uirtt.unbindTexture();
// glDisable(GL_BLEND);
if (rec_running)
{
rec_timer += dt;