02-07-2015 05:44 AM
SHOULD I ROTATE MY DEVICE'S SCREEN?
Manual screen rotation is not recommended. If your window is fullscreen on a
rift device, set the ovrDistortionCap_LinuxDevFullscreen distortion cap to
have the SDK automatically rotate the distortion mesh on appropriate devices.
Be aware you will have to account for window size. You can use
OVR::SDKWindow::findDevScreenForHMD (Displays/OVR_Linux_SDKWindow.h) to
return the screen offset and dimensions necessary to size your Linux window.
See Samples/CommonSrc/Platform/Linux_Platform.cpp for an example.
// テクスチャサイズ(一枚のテクスチャに左右の絵をレンダリングする場合)
// Configure Stereo settings.
ovrSizei recommenedTex0Size = ovrHmd_GetFovTextureSize(hmd, ovrEye_Left,
hmd->DefaultEyeFov[0], 1.0f);
ovrSizei recommenedTex1Size = ovrHmd_GetFovTextureSize(hmd, ovrEye_Right,
hmd->DefaultEyeFov[1], 1.0f);
// The actual RT size may be different due to HW limits.
ovrSizei renderTargetSize;
renderTargetSize.w = recommenedTex0Size.w + recommenedTex1Size.w;
renderTargetSize.h = max ( recommenedTex0Size.h, recommenedTex1Size.h );
// レンダリング設定
ovrRecti EyeRenderViewport[2]; // Useful to remember when varying resolution
// ----
EyeRenderViewport[0].Pos = ovrVector2i{ 0, 0};
EyeRenderViewport[0].Size = ovrSizei{ renderTargetSize.w / 2, renderTargetSize.h};
EyeRenderViewport[1].Pos = ovrVector2i{(renderTargetSize.w + 1) / 2, 0};
EyeRenderViewport[1].Size = EyeRenderViewport[0].Size;
ovrGLTexture EyeTexture[2];
EyeTexture[0].OGL.Header.API = ovrRenderAPI_OpenGL;
EyeTexture[0].OGL.Header.TextureSize = renderTargetSize;
EyeTexture[0].OGL.Header.RenderViewport = EyeRenderViewport[0];
EyeTexture[0].OGL.TexId = texID;
EyeTexture[1] = EyeTexture[0];
EyeTexture[1].OGL.Header.RenderViewport = EyeRenderViewport[1];
02-17-2015 06:20 PM
else if (fullscreen == Render::Display_Fullscreen)
{
// Obtain display information so that we can make and informed
// decision about display modes.
...以下続く...
02-25-2015 03:51 AM
// Configure OpenGL.
union ovrGLConfig cfg;
cfg.OGL.Header.API = ovrRenderAPI_OpenGL;
cfg.OGL.Header.BackBufferSize = g_ovrHmd->Resolution;
cfg.OGL.Header.Multisample = 0; //backBufferMultisample
cfg.OGL.Disp = glfwGetX11Display();
// Configure OpenGL.
union ovrGLConfig cfg;
cfg.OGL.Header.API = ovrRenderAPI_OpenGL;
cfg.OGL.Header.BackBufferSize.h = g_ovrHmd->Resolution.w; //縦横入れ替え
cfg.OGL.Header.BackBufferSize.w = g_ovrHmd->Resolution.h; //縦横入れ替え
cfg.OGL.Header.Multisample = 0; //backBufferMultisample
cfg.OGL.Disp = glfwGetX11Display();