// Path: gdx-vr/src/com/badlogic/gdx/vr/SplitViewport.java
// public static class SizeInformation {
// 	/** Determines, how the size should be interpreted. */
// 	public SizeType sizeType;
// 
// 	/**
// 	 * The size to be used. Is ignored in case {@link SizeType} REST is
// 	 * used.
// 	 */
// 	public float size;
// 
// 	public SizeInformation(SizeType sizeType, float size) {
// 		this.sizeType = sizeType;
// 		this.size = size;
// 	}
// }
// 
// Path: gdx-vr/src/com/badlogic/gdx/vr/SplitViewport.java
// public enum SizeType {
// 	/**
// 	 * The size will be fixed and will have exactly the given size all the
// 	 * time.
// 	 */
// 	ABSOLUTE,
// 
// 	/**
// 	 * The given size needs to be in [0, 1]. It is relative to the "root"
// 	 * viewport.
// 	 */
// 	RELATIVE,
// 
// 	/**
// 	 * If this type is chosen, the given size will be ignored. Instead all
// 	 * cells with this type will share the rest amount of the "root"
// 	 * viewport that is still left after all other parts have been
// 	 * subtracted.
// 	 */
// 	REST
// }
// 
// Path: gdx-vr/src/com/badlogic/gdx/vr/SplitViewport.java
// public static class SubView {
// 	/** The size information for this sub view. */
// 	public SizeInformation sizeInformation;
// 
// 	/** The {@link Viewport} for this sub view. */
// 	public Viewport viewport;
// 
// 	public SubView(SizeInformation sizeInformation, Viewport viewport) {
// 		this.sizeInformation = sizeInformation;
// 		this.viewport = viewport;
// 	}
// 
// }


import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Camera;
import com.badlogic.gdx.graphics.Pixmap.Format;
import com.badlogic.gdx.graphics.glutils.FrameBuffer;
import com.badlogic.gdx.math.Quaternion;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.viewport.ScreenViewport;
import com.badlogic.gdx.utils.viewport.Viewport;
import com.badlogic.gdx.vr.SplitViewport.SizeInformation;
import com.badlogic.gdx.vr.SplitViewport.SizeType;
import com.badlogic.gdx.vr.SplitViewport.SubView;
/*******************************************************************************
 * Copyright 2011 See AUTHORS file.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 ******************************************************************************/

package com.badlogic.gdx.vr;


/**
 * @author Daniel Holderbaum
 */
public class VirtualRealityRenderer {

	public Array<VirtualRealityRenderListener> listeners = new Array<VirtualRealityRenderListener>();

	private boolean distortionCorrected;

	private FrameBuffer leftFBO, rightFBO;

	private SplitViewport splitViewport = new SplitViewport(new ScreenViewport());

	public VirtualRealityRenderer() {
		splitViewport.row(new SizeInformation(SizeType.RELATIVE, 1f));
// Path: gdx-vr/src/com/badlogic/gdx/vr/SplitViewport.java
// public static class SizeInformation {
// 	/** Determines, how the size should be interpreted. */
// 	public SizeType sizeType;
// 
// 	/**
// 	 * The size to be used. Is ignored in case {@link SizeType} REST is
// 	 * used.
// 	 */
// 	public float size;
// 
// 	public SizeInformation(SizeType sizeType, float size) {
// 		this.sizeType = sizeType;
// 		this.size = size;
// 	}
// }
// 
// Path: gdx-vr/src/com/badlogic/gdx/vr/SplitViewport.java
// public enum SizeType {
// 	/**
// 	 * The size will be fixed and will have exactly the given size all the
// 	 * time.
// 	 */
// 	ABSOLUTE,
// 
// 	/**
// 	 * The given size needs to be in [0, 1]. It is relative to the "root"
// 	 * viewport.
// 	 */
// 	RELATIVE,
// 
// 	/**
// 	 * If this type is chosen, the given size will be ignored. Instead all
// 	 * cells with this type will share the rest amount of the "root"
// 	 * viewport that is still left after all other parts have been
// 	 * subtracted.
// 	 */
// 	REST
// }
// 
// Path: gdx-vr/src/com/badlogic/gdx/vr/SplitViewport.java
// public static class SubView {
// 	/** The size information for this sub view. */
// 	public SizeInformation sizeInformation;
// 
// 	/** The {@link Viewport} for this sub view. */
// 	public Viewport viewport;
// 
// 	public SubView(SizeInformation sizeInformation, Viewport viewport) {
// 		this.sizeInformation = sizeInformation;
// 		this.viewport = viewport;
// 	}
// 
// }


// Path: gdx-vr/src/com/badlogic/gdx/vr/VirtualRealityRenderer.java
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Camera;
import com.badlogic.gdx.graphics.Pixmap.Format;
import com.badlogic.gdx.graphics.glutils.FrameBuffer;
import com.badlogic.gdx.math.Quaternion;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.viewport.ScreenViewport;
import com.badlogic.gdx.utils.viewport.Viewport;
import com.badlogic.gdx.vr.SplitViewport.SizeInformation;
import com.badlogic.gdx.vr.SplitViewport.SizeType;
import com.badlogic.gdx.vr.SplitViewport.SubView;

/*******************************************************************************
 * Copyright 2011 See AUTHORS file.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 ******************************************************************************/

package com.badlogic.gdx.vr;


/**
 * @author Daniel Holderbaum
 */
public class VirtualRealityRenderer {

	public Array<VirtualRealityRenderListener> listeners = new Array<VirtualRealityRenderListener>();

	private boolean distortionCorrected;

	private FrameBuffer leftFBO, rightFBO;

	private SplitViewport splitViewport = new SplitViewport(new ScreenViewport());

	public VirtualRealityRenderer() {
		splitViewport.row(new SizeInformation(SizeType.RELATIVE, 1f));
		splitViewport.add(new SubView(new SizeInformation(SizeType.RELATIVE, 0.5f), VirtualReality.head.getLeftEye()));