Java Code Examples for android.opengl.GLSurfaceView#Renderer

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: PixelBuffer.java    From Fatigue-Detection with MIT License 7 votes vote down vote up
public void setRenderer(final GLSurfaceView.Renderer renderer) {
    mRenderer = renderer;

    // Does this thread own the OpenGL context?
    if (!Thread.currentThread().getName().equals(mThreadOwner)) {
        Log.e(TAG, "setRenderer: This thread does not own the OpenGL context.");
        return;
    }

    // Call the renderer initialization routines
    mRenderer.onSurfaceCreated(mGL, mEGLConfig);
    mRenderer.onSurfaceChanged(mGL, mWidth, mHeight);
}
 
Example 2
Source File: PixelBuffer.java    From DeviceConnect-Android with MIT License 5 votes vote down vote up
public void setRenderer(GLSurfaceView.Renderer renderer) {
    mRenderer = renderer;

    if (!Thread.currentThread().getName().equals(mThreadOwner)) {
        mLogger.severe("setRenderer: This thread does not own the OpenGL context.");
        return;
    }

    mRenderer.onSurfaceCreated(mGL, mEGLConfig);
}
 
Example 3
Source File: PixelBuffer.java    From In77Camera with MIT License 5 votes vote down vote up
public void setRenderer(final GLSurfaceView.Renderer renderer) {
    mRenderer = renderer;

    // Does this thread own the OpenGL context?
    if (!Thread.currentThread().getName().equals(mThreadOwner)) {
        Log.e(TAG, "setRenderer: This thread does not own the OpenGL context.");
        return;
    }

    // Call the renderer initialization routines
    mRenderer.onSurfaceCreated(mGL, mEGLConfig);
    mRenderer.onSurfaceChanged(mGL, mWidth, mHeight);
}
 
Example 4
Source File: PixelBuffer.java    From SimpleVideoEditor with Apache License 2.0 5 votes vote down vote up
public void setRenderer(final GLSurfaceView.Renderer renderer) {
    mRenderer = renderer;

    // Does this thread own the OpenGL context?
    if (!Thread.currentThread().getName().equals(mThreadOwner)) {
        Log.e(TAG, "setRenderer: This thread does not own the OpenGL context.");
        return;
    }

    // Call the renderer initialization routines
    mRenderer.onSurfaceCreated(mGL, mEGLConfig);
    mRenderer.onSurfaceChanged(mGL, mWidth, mHeight);
}
 
Example 5
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");
}
 
Example 6
Source File: DSL.java    From anvil with MIT License 4 votes vote down vote up
public static Void renderer(GLSurfaceView.Renderer arg) {
  return BaseDSL.attr("renderer", arg);
}
 
Example 7
Source File: DSL.java    From anvil with MIT License 4 votes vote down vote up
public static Void renderer(GLSurfaceView.Renderer arg) {
  return BaseDSL.attr("renderer", arg);
}
 
Example 8
Source File: GLTextureView.java    From ZGDanmaku with Apache License 2.0 4 votes vote down vote up
/**
 * Set the renderer associated with this view. Also starts the thread that
 * will call the renderer, which in turn causes the rendering to start.
 * <p>This method should be called once and only once in the life-cycle of
 * a GLSurfaceView.
 * <p>The following GLSurfaceView methods can only be called <em>before</em>
 * setRenderer is called:
 * <ul>
 * <li>{@link #setEGLConfigChooser(boolean)}
 * <li>{@link #setEGLConfigChooser(EGLConfigChooser)}
 * <li>{@link #setEGLConfigChooser(int, int, int, int, int, int)}
 * </ul>
 * <p>
 * The following GLSurfaceView methods can only be called <em>after</em>
 * setRenderer is called:
 * <ul>
 * <li>{@link #getRenderMode()}
 * <li>{@link #onPause()}
 * <li>{@link #onResume()}
 * <li>{@link #queueEvent(Runnable)}
 * <li>{@link #requestRender()}
 * <li>{@link #setRenderMode(int)}
 * </ul>
 *
 * @param renderer the renderer to use to perform OpenGL drawing.
 */
public void setRenderer(GLSurfaceView.Renderer renderer) {
    checkRenderThreadState();
    if (mEGLConfigChooser == null) {
        mEGLConfigChooser = new SimpleEGLConfigChooser(true);
    }
    if (mEGLContextFactory == null) {
        mEGLContextFactory = new DefaultContextFactory();
    }
    if (mEGLWindowSurfaceFactory == null) {
        mEGLWindowSurfaceFactory = new DefaultWindowSurfaceFactory();
    }
    mRenderer = renderer;
    mGLThread = new GLThread(mThisWeakRef);
    mGLThread.start();
}
 
Example 9
Source File: MDGLScreenWrapper.java    From MD360Player4Android with Apache License 2.0 4 votes vote down vote up
@Override
public void setRenderer(GLSurfaceView.Renderer renderer) {
    glSurfaceView.setRenderer(renderer);
}
 
Example 10
Source File: MDGLScreenWrapper.java    From MD360Player4Android with Apache License 2.0 4 votes vote down vote up
@Override
public void setRenderer(GLSurfaceView.Renderer renderer) {
    glTextureView.setRenderer(renderer);
}
 
Example 11
Source File: GLTextureView.java    From MD360Player4Android with Apache License 2.0 4 votes vote down vote up
/**
 * Set the renderer associated with this view. Also starts the thread that
 * will call the renderer, which in turn causes the rendering to start.
 * <p>This method should be called once and only once in the life-cycle of
 * a GLSurfaceView.
 * <p>The following GLSurfaceView methods can only be called <em>before</em>
 * setRenderer is called:
 * <ul>
 * <li>{@link #setEGLConfigChooser(boolean)}
 * <li>{@link #setEGLConfigChooser(EGLConfigChooser)}
 * <li>{@link #setEGLConfigChooser(int, int, int, int, int, int)}
 * </ul>
 * <p>
 * The following GLSurfaceView methods can only be called <em>after</em>
 * setRenderer is called:
 * <ul>
 * <li>{@link #getRenderMode()}
 * <li>{@link #onPause()}
 * <li>{@link #onResume()}
 * <li>{@link #queueEvent(Runnable)}
 * <li>{@link #requestRender()}
 * <li>{@link #setRenderMode(int)}
 * </ul>
 *
 * @param renderer the renderer to use to perform OpenGL drawing.
 */
public void setRenderer(GLSurfaceView.Renderer renderer) {
    checkRenderThreadState();
    if (mEGLConfigChooser == null) {
        mEGLConfigChooser = new SimpleEGLConfigChooser(true);
    }
    if (mEGLContextFactory == null) {
        mEGLContextFactory = new DefaultContextFactory();
    }
    if (mEGLWindowSurfaceFactory == null) {
        mEGLWindowSurfaceFactory = new DefaultWindowSurfaceFactory();
    }
    mRenderer = renderer;
    mGLThread = new GLThread(mThisWeakRef);
    mGLThread.start();
}
 
Example 12
Source File: GlTextureView.java    From ParticleView with Apache License 2.0 4 votes vote down vote up
/**
 * Set the renderer associated with this view. Also starts the thread that
 * will call the renderer, which in turn causes the rendering to start.
 * <p>This method should be called once and only once in the life-cycle of
 * a GLSurfaceView.
 * <p>The following GLSurfaceView methods can only be called <em>before</em>
 * setRenderer is called:
 * <ul>
 * <li>{@link #setEGLConfigChooser(boolean)}
 * <li>{@link #setEGLConfigChooser(EGLConfigChooser)}
 * <li>{@link #setEGLConfigChooser(int, int, int, int, int, int)}
 * </ul>
 * <p>
 * The following GLSurfaceView methods can only be called <em>after</em>
 * setRenderer is called:
 * <ul>
 * <li>{@link #getRenderMode()}
 * <li>{@link #onPause()}
 * <li>{@link #onResume()}
 * <li>{@link #queueEvent(Runnable)}
 * <li>{@link #requestRender()}
 * <li>{@link #setRenderMode(int)}
 * </ul>
 *
 * @param renderer the renderer to use to perform OpenGL drawing.
 */
public void setRenderer(GLSurfaceView.Renderer renderer) {
    checkRenderThreadState();
    if (mEGLConfigChooser == null) {
        mEGLConfigChooser = new SimpleEGLConfigChooser(true);
    }
    if (mEGLContextFactory == null) {
        mEGLContextFactory = new DefaultContextFactory();
    }
    if (mEGLWindowSurfaceFactory == null) {
        mEGLWindowSurfaceFactory = new DefaultWindowSurfaceFactory();
    }
    mRenderer = renderer;
    mGLThread = new GLThread(mThisWeakRef);
    // ParticleView modification
    mGLThread.mRequestPaused = true;
    mGLThread.start();
}
 
Example 13
Source File: HeyhouPlayerService.java    From TikTok with Apache License 2.0 4 votes vote down vote up
public void attachRender(GLSurfaceView.Renderer render){
    mMediaPlayer.attachRender(render);
}
 
Example 14
Source File: GLTextureView.java    From VideoRecorder with Apache License 2.0 4 votes vote down vote up
/**
 * Set the renderer associated with this view. Also starts the thread that
 * will call the renderer, which in turn causes the rendering to startRecord.
 * <p>This method should be called once and only once in the life-cycle of
 * a GLSurfaceView.
 * <p>The following GLSurfaceView methods can only be called <em>before</em>
 * setRenderer is called:
 * <ul>
 * <li>{@link #setEGLConfigChooser(boolean)}
 * <li>{@link #setEGLConfigChooser(EGLConfigChooser)}
 * <li>{@link #setEGLConfigChooser(int, int, int, int, int, int)}
 * </ul>
 * <p>
 * The following GLSurfaceView methods can only be called <em>after</em>
 * setRenderer is called:
 * <ul>
 * <li>{@link #getRenderMode()}
 * <li>{@link #onPause()}
 * <li>{@link #onResume()}
 * <li>{@link #queueEvent(Runnable)}
 * <li>{@link #requestRender()}
 * <li>{@link #setRenderMode(int)}
 * </ul>
 *
 * @param renderer the renderer to use to perform OpenGL drawing.
 */
public void setRenderer(GLSurfaceView.Renderer renderer) {
    checkRenderThreadState();
    if (mEGLConfigChooser == null) {
        mEGLConfigChooser = new SimpleEGLConfigChooser(true);
    }
    if (mEGLContextFactory == null) {
        mEGLContextFactory = new DefaultContextFactory();
    }
    if (mEGLWindowSurfaceFactory == null) {
        mEGLWindowSurfaceFactory = new DefaultWindowSurfaceFactory();
    }
    mRenderer = renderer;
    mGLThread = new GLThread(mThisWeakRef);
    mGLThread.start();
}
 
Example 15
Source File: GLTextureView.java    From Beginner-Level-Android-Studio-Apps with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Set the renderer associated with this view. Also starts the thread that
 * will call the renderer, which in turn causes the rendering to start.
 * <p>This method should be called once and only once in the life-cycle of
 * a GLSurfaceView.
 * <p>The following GLSurfaceView methods can only be called <em>before</em>
 * setRenderer is called:
 * <ul>
 * <li>{@link #setEGLConfigChooser(boolean)}
 * <li>{@link #setEGLConfigChooser(EGLConfigChooser)}
 * <li>{@link #setEGLConfigChooser(int, int, int, int, int, int)}
 * </ul>
 * <p>
 * The following GLSurfaceView methods can only be called <em>after</em>
 * setRenderer is called:
 * <ul>
 * <li>{@link #getRenderMode()}
 * <li>{@link #onPause()}
 * <li>{@link #onResume()}
 * <li>{@link #queueEvent(Runnable)}
 * <li>{@link #requestRender()}
 * <li>{@link #setRenderMode(int)}
 * </ul>
 *
 * @param renderer the renderer to use to perform OpenGL drawing.
 */
public void setRenderer(GLSurfaceView.Renderer renderer) {
    checkRenderThreadState();
    if (mEGLConfigChooser == null) {
        mEGLConfigChooser = new SimpleEGLConfigChooser(true);
    }
    if (mEGLContextFactory == null) {
        mEGLContextFactory = new DefaultContextFactory();
    }
    if (mEGLWindowSurfaceFactory == null) {
        mEGLWindowSurfaceFactory = new DefaultWindowSurfaceFactory();
    }
    mRenderer = renderer;
    mGLThread = new GLThread(mThisWeakRef);
    mGLThread.start();
}
 
Example 16
Source File: MDGLScreenWrapper.java    From Beginner-Level-Android-Studio-Apps with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void setRenderer(GLSurfaceView.Renderer renderer) {
    glSurfaceView.setRenderer(renderer);
}
 
Example 17
Source File: MDGLScreenWrapper.java    From Beginner-Level-Android-Studio-Apps with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void setRenderer(GLSurfaceView.Renderer renderer) {
    glTextureView.setRenderer(renderer);
}
 
Example 18
Source File: HeyhouPlayer.java    From TikTok with Apache License 2.0 2 votes vote down vote up
/**
 * attach surface
 * @param render,render GLSurfaceView render,used by video output
 */
public native void attachRender(GLSurfaceView.Renderer render);
 
Example 19
Source File: MDGLScreenWrapper.java    From MD360Player4Android with Apache License 2.0 votes vote down vote up
abstract public void setRenderer(GLSurfaceView.Renderer renderer); 
Example 20
Source File: MDGLScreenWrapper.java    From Beginner-Level-Android-Studio-Apps with GNU General Public License v3.0 votes vote down vote up
abstract public void setRenderer(GLSurfaceView.Renderer renderer);