本文整理匯總了Java中android.opengl.GLSurfaceView.setRenderMode方法的典型用法代碼示例。如果您正苦於以下問題:Java GLSurfaceView.setRenderMode方法的具體用法?Java GLSurfaceView.setRenderMode怎麽用?Java GLSurfaceView.setRenderMode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.opengl.GLSurfaceView
的用法示例。
在下文中一共展示了GLSurfaceView.setRenderMode方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onCreate
import android.opengl.GLSurfaceView; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (!Utils.supportGlEs20(this)) {
Toast.makeText(this, "GLES 2.0 not supported!", Toast.LENGTH_LONG).show();
finish();
return;
}
mGLSurfaceView = (GLSurfaceView) findViewById(R.id.surface);
mGLSurfaceView.setEGLContextClientVersion(2);
mRenderer = new DemoRenderer(this);
mGLSurfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);
mGLSurfaceView.setRenderer(mRenderer);
mGLSurfaceView.setRenderMode(GLSurfaceView.RENDERMODE_CONTINUOUSLY);
}
示例2: onCreate
import android.opengl.GLSurfaceView; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_camera_capture);
File outputFile = new File(getFilesDir(), "camera-test.mp4");
TextView fileText = (TextView) findViewById(R.id.cameraOutputFile_text);
fileText.setText(outputFile.toString());
Spinner spinner = (Spinner) findViewById(R.id.cameraFilter_spinner);
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,
R.array.cameraFilterNames, android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
// Apply the adapter to the spinner.
spinner.setAdapter(adapter);
spinner.setOnItemSelectedListener(this);
// Define a handler that receives camera-control messages from other threads. All calls
// to Camera must be made on the same thread. Note we create this before the renderer
// thread, so we know the fully-constructed object will be visible.
mCameraHandler = new CameraHandler(this);
mRecordingEnabled = sVideoEncoder.isRecording();
// Configure the GLSurfaceView. This will start the Renderer thread, with an
// appropriate EGL context.
mGLView = (GLSurfaceView) findViewById(R.id.cameraPreview_surfaceView);
mGLView.setEGLContextClientVersion(2); // select GLES 2.0
mRenderer = new CameraSurfaceRenderer(mCameraHandler, sVideoEncoder, outputFile);
mGLView.setRenderer(mRenderer);
mGLView.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
Log.d(TAG, "onCreate complete: " + this);
}
示例3: init
import android.opengl.GLSurfaceView; //導入方法依賴的package包/類
public void init(GLSurfaceView sv) {
mState.set(STATE_IDLE);
sv.setEGLContextClientVersion(2); // GLES 2.0
sv.setRenderer(mGLRenderer);
sv.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
mGLSurfaceView = sv;
}
示例4: onCreate
import android.opengl.GLSurfaceView; //導入方法依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
/**
* Initialize the renderer and tell it to only render when
* explicity requested with the RENDERMODE_WHEN_DIRTY option
*/
mEffectView = (GLSurfaceView) findViewById(R.id.effectsview);
mEffectView.setEGLContextClientVersion(2);
mEffectView.setRenderer(this);
mEffectView.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
mCurrentEffect = R.id.none;
}
示例5: onCreateView
import android.opengl.GLSurfaceView; //導入方法依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
log.i("onCreateView");
View rootView = inflater.inflate(R.layout.fragment_cameragl, container, false);
mPreview = (GLSurfaceView) rootView.findViewById(R.id.camera_preview);
mCamera = Camera.open(mCameraId);
mPreview.setEGLContextClientVersion(2);
CameraRenderer renderer = new CameraRenderer(mPreview, mCamera);
renderer.setRotation(90, mCameraId == CameraInfo.CAMERA_FACING_FRONT, false);
mPreview.setRenderer(renderer);
mPreview.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
return rootView;
}
示例6: onCreate
import android.opengl.GLSurfaceView; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Log.d(TAG, "SAMPLE PAth: " + SAMPLE);
setContentView(R.layout.activity_main);
niceSpinner = (NiceSpinner)findViewById(R.id.cameraFilter_spinner);
List<String> dataset = new LinkedList<>(Arrays.asList("正常 ","黑白 ", "模糊 ", "銳化 ", "邊緣 ", "浮雕 "));
niceSpinner.attachDataSource(dataset);
listenControl = (LinearLayout)findViewById(R.id.listen_control);
selectFileBtn = (Button)findViewById(R.id.open_file);
control = (LinearLayout)findViewById(R.id.control);
glSurfaceView = (GLSurfaceView) findViewById(R.id.glSurfaceView);
SeekBar seekBar = (SeekBar) findViewById(R.id.seekbar);
videoRenderer = new VideoRenderer(MainActivity.this, glSurfaceView, seekBar, videoPath);
glSurfaceView.setEGLContextClientVersion(2);
glSurfaceView.setRenderer(videoRenderer);
glSurfaceView.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
// Log.d(TAG, SAMPLE);
niceSpinner.setOnTouchListener(this);
niceSpinner.setOnItemSelectedListener(this);
niceSpinner.dismissDropDown();
pause = (Button) findViewById(R.id.pause);
// avoid clicking without video
pause.setEnabled(false);
pause.setOnClickListener(this);
selectFileBtn.setOnClickListener(this);
glSurfaceView.setOnClickListener(this);
}
示例7: TiledImageView
import android.opengl.GLSurfaceView; //導入方法依賴的package包/類
public TiledImageView(Context context, AttributeSet attrs) {
super(context, attrs);
mRenderer = new ImageRendererWrapper();
mRenderer.image = new TiledImageRenderer(this);
mGLSurfaceView = new GLSurfaceView(context);
mGLSurfaceView.setEGLContextClientVersion(2);
mGLSurfaceView.setRenderer(new TileRenderer());
mGLSurfaceView.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
addView(mGLSurfaceView, new LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
}
示例8: onCreate
import android.opengl.GLSurfaceView; //導入方法依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mGLView = new GLSurfaceView(this);
GLRenderer renderer = new GLRenderer();
mGLView.setEGLContextClientVersion(2);
mGLView.setRenderer(renderer);
mGLView.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
setContentView(mGLView);
}