android.opengl.GLSurfaceView.Renderer Java Examples

The following examples show how to use android.opengl.GLSurfaceView.Renderer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GLRenderWrapper.java    From AndroidRipper with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * Constructs this object.
 * 
 * @param view the current glSurfaceView
 * @param renderer the renderer to wrap
 * @param latch the count down latch
 */

public GLRenderWrapper(GLSurfaceView view,
		Renderer renderer, CountDownLatch latch) {
	this.view = view;
	this.renderer = renderer;
	this.latch = latch;
	
	this.width = view.getWidth();
	this.height = view.getHeight();
	
	Integer out = new Reflect(view).field("mEGLContextClientVersion")
			.out(Integer.class);
	if ( out != null ) {
		this.glVersion = out.intValue();
	} else {
		this.glVersion = -1;
		this.takeScreenshot = false;
	}
}
 
Example #2
Source File: CardboardView.java    From Cardboard with Apache License 2.0 6 votes vote down vote up
public RendererHelper(CardboardView.Renderer renderer) {
	this.mRenderer = renderer;
	this.mHmd = new HeadMountedDisplay(CardboardView.this.mHmd);
	this.mHeadTransform = new HeadTransform();
	this.mMonocular = new EyeParams(0);
	this.mLeftEye = new EyeParams(1);
	this.mRightEye = new EyeParams(2);
	updateFieldOfView(this.mLeftEye.getFov(), this.mRightEye.getFov());
	CardboardView.this.mDistortionRenderer = new DistortionRenderer();

	this.mLeftEyeTranslate = new float[16];
	this.mRightEyeTranslate = new float[16];

	this.mVRMode = CardboardView.this.mVRMode;
	this.mDistortionCorrectionEnabled = CardboardView.this.mDistortionCorrectionEnabled;
	this.mDistortionCorrectionScale = CardboardView.this.mDistortionCorrectionScale;
	this.mZNear = CardboardView.this.mZNear;
	this.mZFar = CardboardView.this.mZFar;

	this.mProjectionChanged = true;
}
 
Example #3
Source File: BlockingGLTextureView.java    From TurboLauncher with Apache License 2.0 4 votes vote down vote up
public void setRenderer(Renderer renderer) {
    if (mRenderThread != null) {
        throw new IllegalArgumentException("Renderer already set");
    }
    mRenderThread = new RenderThread(renderer);
}
 
Example #4
Source File: BlockingGLTextureView.java    From TurboLauncher with Apache License 2.0 4 votes vote down vote up
public RenderThread(Renderer renderer) {
    super("RenderThread");
    mRenderer = renderer;
    start();
}
 
Example #5
Source File: BlockingGLTextureView.java    From LB-Launcher with Apache License 2.0 4 votes vote down vote up
public void setRenderer(Renderer renderer) {
    if (mRenderThread != null) {
        throw new IllegalArgumentException("Renderer already set");
    }
    mRenderThread = new RenderThread(renderer);
}
 
Example #6
Source File: BlockingGLTextureView.java    From LB-Launcher with Apache License 2.0 4 votes vote down vote up
public RenderThread(Renderer renderer) {
    super("RenderThread");
    mRenderer = renderer;
    start();
}
 
Example #7
Source File: CardboardView.java    From Cardboard with Apache License 2.0 4 votes vote down vote up
public void setRenderer(Renderer renderer) {
	this.mRendererHelper = (renderer != null ? new RendererHelper(renderer)
			: null);
	super.setRenderer(this.mRendererHelper);
}
 
Example #8
Source File: CardboardView.java    From Cardboard with Apache License 2.0 4 votes vote down vote up
public void setRenderer(StereoRenderer renderer) {
	setRenderer(renderer != null ? new StereoRendererHelper(renderer)
			: (Renderer) null);
}
 
Example #9
Source File: CardboardView.java    From Cardboard with Apache License 2.0 4 votes vote down vote up
public void setRenderer(GLSurfaceView.Renderer renderer) {
	throw new RuntimeException(
			"Please use the CardboardView renderer interfaces");
}