add ovr platform sdk and test photo sharing
This commit is contained in:
@@ -91,6 +91,8 @@ void oculus_init(JavaVM* vm, JNIEnv* jni, jobject activity_class)
|
||||
// If intialization failed, vrapi_* function calls will not be available.
|
||||
exit( 0 );
|
||||
}
|
||||
auto result = ovr_PlatformInitializeAndroid("1687982804637910", activity_class, jni);
|
||||
LOG("ovr_PlatformInitializeAndroid result %d", result);
|
||||
}
|
||||
|
||||
void oculus_init_vr(EGLDisplay display, EGLContext context, ANativeWindow* surface)
|
||||
@@ -106,16 +108,17 @@ void oculus_init_vr(EGLDisplay display, EGLContext context, ANativeWindow* surfa
|
||||
for (int i = 0; i < swap_chain_count; i++)
|
||||
{
|
||||
auto texid = vrapi_GetTextureSwapChainHandle(swap_chain[eye], i);
|
||||
if (!ovr_eyes[i][eye].create(rtt_w, rtt_h, texid, GL_RGBA8, true))
|
||||
if (ovr_eyes[i][eye].create(rtt_w, rtt_h, texid, GL_RGBA8, true))
|
||||
{
|
||||
ovr_eyes[i][eye].bindFramebuffer();
|
||||
ovr_eyes[i][eye].clear({1, 0, 1, 1});
|
||||
ovr_eyes[i][eye].unbindFramebuffer();
|
||||
LOG("FAILED create fb for eye %d", eye);
|
||||
ovr_eyes[i][eye].bindTexture();
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
ovr_eyes[i][eye].unbindTexture();
|
||||
LOG("create eye %d", eye);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG("create eye %d", eye);
|
||||
LOG("FAILED create fb for eye %d", eye);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,11 @@
|
||||
#include <VrApi_SystemUtils.h>
|
||||
#include <VrApi_Input.h>
|
||||
|
||||
#include <OVR_Platform.h>
|
||||
#include <OVR_PlatformInitialize.h>
|
||||
#include <OVR_Requests_Media.h>
|
||||
#include <OVR_Requests_Livestreaming.h>
|
||||
|
||||
#include <EGL/egl.h>
|
||||
#include <EGL/eglext.h>
|
||||
#include <android/window.h>
|
||||
|
||||
Reference in New Issue
Block a user