add focus project, fix recovery save on ui thread, fix grid commit, wave_sdk submodule, use PlatformActivity as base for android/quest/focus and extend VRActivity on focus.

This commit is contained in:
2019-07-29 22:54:50 +02:00
parent 73485cde01
commit f2d2ef1067
31 changed files with 1206 additions and 36 deletions

View File

@@ -83,7 +83,7 @@ android {
// Sets optional flags for the C compiler.
//cFlags "-D_EXAMPLE_C_FLAG1", "-D_EXAMPLE_C_FLAG2"
// Sets a flag to enable format macro constants for the C++ compiler.
cppFlags "-D__QUEST__"
cppFlags "-D__QUEST__=1"
arguments "-DANDROID_TOOLCHAIN=clang",
//"-DANDROID_PLATFORM=android-19",
"-DANDROID_STL=c++_shared",

View File

@@ -44,12 +44,12 @@ struct QuestController : public VRController
if (pressed && !m_buttons[(int)b])
{
m_buttons[(int)b] = true;
App::I.vr_digital(*this, b, kAction::Press, axis);
App::I->vr_digital(*this, b, kAction::Press, axis);
}
if (!pressed && m_buttons[(int)b])
{
m_buttons[(int)b] = false;
App::I.vr_digital(*this, b, kAction::Release, axis);
App::I->vr_digital(*this, b, kAction::Release, axis);
}
}
void update_analog(kButton b, glm::vec2 force)
@@ -59,12 +59,12 @@ struct QuestController : public VRController
if (l > zero && !m_analog_buttons[(int)b])
{
m_analog_buttons[(int)b] = true;
App::I.vr_analog(*this, b, kAction::Press, force);
App::I->vr_analog(*this, b, kAction::Press, force);
}
if (l <= zero && m_analog_buttons[(int)b])
{
m_analog_buttons[(int)b] = false;
App::I.vr_analog(*this, b, kAction::Release, force);
App::I->vr_analog(*this, b, kAction::Release, force);
}
}
@@ -205,10 +205,10 @@ void oculus_draw(float dt)
if (controllers[0].id != -1)
{
controllers[0].update_state(predictedDisplayTime, head_pos);
App::I.vr_controllers[0] = controllers[0];
App::I->vr_controllers[0] = controllers[0];
}
App::I.vr_head = pose;
App::I.vr_update(dt);
App::I->vr_head = pose;
App::I->vr_update(dt);
// update hmd
auto layer = vrapi_DefaultLayerProjection2();
@@ -225,7 +225,7 @@ void oculus_draw(float dt)
glm::mat4 proj = glm::make_mat4(reinterpret_cast<const float*>(&proj_ovr));
auto view_ovr = ovrMatrix4f_Transpose(&tracking.Eye[eye].ViewMatrix);
glm::mat4 view = glm::make_mat4(reinterpret_cast<const float*>(&view_ovr));
App::I.vr_draw(proj, view, pose);
App::I->vr_draw(proj, view, pose);
rtt.unbindFramebuffer();
layer.Textures[eye].ColorSwapChain = swap_chain[eye];
layer.Textures[eye].SwapChainIndex = swap_chain_index;

View File

@@ -0,0 +1,6 @@
package com.omixlab.panopainter;
import android.app.NativeActivity;
public class PlatformActivity extends NativeActivity {
}