private void InitializeViewports() { m_initializedGraphicsDeviceType = SystemInfo.graphicsDeviceType; m_frameBuffer = new HVRFrameBufferInterface(); m_viewports = new HVRViewportInterface [MAXIMUM_VIEWPORTS]; m_viewportIndex = 0; for (int i = 0; i < MAXIMUM_VIEWPORTS; ++i) { HVRViewportInterface viewport = new HVRViewportInterface(); viewport.SetFrameBuffer(m_frameBuffer); m_viewports[i] = viewport; } }
public static void Render(HVRSceneInterface scene, HVRViewportInterface viewport) { if (scene != null && viewport != null) { HVRFrameBufferInterface frameBuffer = viewport.frameBuffer; if (frameBuffer != null) { int clearEventID = HVRPlayerInterfaceAPI.Unity_FrameBuffer_Clear(frameBuffer.handle, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f); GL.IssuePluginEvent(HVRPlayerInterfaceAPI.UnityRenderEventFunc(), clearEventID); } int eventID = HVRPlayerInterfaceAPI.Unity_Player_Render(scene.handle, viewport.handle); GL.IssuePluginEvent(HVRPlayerInterfaceAPI.UnityRenderEventFunc(), eventID); } }