本文整理匯總了Java中javax.microedition.khronos.opengles.GL類的典型用法代碼示例。如果您正苦於以下問題:Java GL類的具體用法?Java GL怎麽用?Java GL使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
GL類屬於javax.microedition.khronos.opengles包,在下文中一共展示了GL類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createGL
import javax.microedition.khronos.opengles.GL; //導入依賴的package包/類
/**
* Create a GL object for the current EGL context.
* @return
*/
GL createGL() {
GL gl = mEglContext.getGL();
GLTextureView view = mGLSurfaceViewWeakRef.get();
if (view != null) {
if (view.mGLWrapper != null) {
gl = view.mGLWrapper.wrap(gl);
}
if ((view.mDebugFlags & (DEBUG_CHECK_GL_ERROR | DEBUG_LOG_GL_CALLS)) != 0) {
int configFlags = 0;
Writer log = null;
if ((view.mDebugFlags & DEBUG_CHECK_GL_ERROR) != 0) {
configFlags |= GLDebugHelper.CONFIG_CHECK_GL_ERROR;
}
if ((view.mDebugFlags & DEBUG_LOG_GL_CALLS) != 0) {
log = new LogWriter();
}
gl = GLDebugHelper.wrap(gl, configFlags, log);
}
}
return gl;
}
示例2: createGL
import javax.microedition.khronos.opengles.GL; //導入依賴的package包/類
/**
* Create a GL object for the current EGL context.
*
* @return
*/
GL createGL() {
GL gl = mEglContext.getGL();
GLSurfaceView view = mGLSurfaceViewWeakRef.get();
if (view != null) {
if (view.mGLWrapper != null) {
gl = view.mGLWrapper.wrap(gl);
}
if ((view.mDebugFlags & (DEBUG_CHECK_GL_ERROR | DEBUG_LOG_GL_CALLS)) != 0) {
int configFlags = 0;
Writer log = null;
if ((view.mDebugFlags & DEBUG_CHECK_GL_ERROR) != 0) {
configFlags |= GLDebugHelper.CONFIG_CHECK_GL_ERROR;
}
if ((view.mDebugFlags & DEBUG_LOG_GL_CALLS) != 0) {
log = new LogWriter();
}
gl = GLDebugHelper.wrap(gl, configFlags, log);
}
}
return gl;
}
示例3: createGL
import javax.microedition.khronos.opengles.GL; //導入依賴的package包/類
/**
* Create a GL object for the current EGL context.
*
* @return
*/
GL createGL() {
GL gl = mEglContext.getGL();
GLTextureView view = mGLTextureViewWeakRef.get();
if (view != null) {
if (view.mGLWrapper != null) {
gl = view.mGLWrapper.wrap(gl);
}
if ((view.mDebugFlags & (DEBUG_CHECK_GL_ERROR | DEBUG_LOG_GL_CALLS)) != 0) {
int configFlags = 0;
Writer log = null;
if ((view.mDebugFlags & DEBUG_CHECK_GL_ERROR) != 0) {
configFlags |= GLDebugHelper.CONFIG_CHECK_GL_ERROR;
}
if ((view.mDebugFlags & DEBUG_LOG_GL_CALLS) != 0) {
log = new LogWriter();
}
gl = GLDebugHelper.wrap(gl, configFlags, log);
}
}
return gl;
}
示例4: MatrixTrackingGL
import javax.microedition.khronos.opengles.GL; //導入依賴的package包/類
public MatrixTrackingGL(GL gl) {
mgl = (GL10) gl;
if (gl instanceof GL10Ext) {
mgl10Ext = (GL10Ext) gl;
}
if (gl instanceof GL11) {
mgl11 = (GL11) gl;
}
if (gl instanceof GL11Ext) {
mgl11Ext = (GL11Ext) gl;
}
mModelView = new MatrixStack();
mProjection = new MatrixStack();
mTexture = new MatrixStack();
mCurrent = mModelView;
mMatrixMode = GL10.GL_MODELVIEW;
}
示例5: MatrixTrackingGL
import javax.microedition.khronos.opengles.GL; //導入依賴的package包/類
public MatrixTrackingGL(GL gl) {
mgl = (GL10) gl;
if (gl instanceof GL10Ext) {
mgl10Ext = (GL10Ext) gl;
}
if (gl instanceof GL11) {
mgl11 = (GL11) gl;
}
if (gl instanceof GL11Ext) {
mgl11Ext = (GL11Ext) gl;
}
mModelView = new MatrixStack();
mProjection = new MatrixStack();
mTexture = new MatrixStack();
mCurrent = mModelView;
mMatrixMode = GL10.GL_MODELVIEW;
}
示例6: createGL
import javax.microedition.khronos.opengles.GL; //導入依賴的package包/類
/**
* Create a GL object for the current EGL context.
*/
GL createGL() {
GL gl = eglContext.getGL();
GLTextureView view = glTextureViewWeakRef.get();
if (view != null) {
if (view.glWrapper != null) {
gl = view.glWrapper.wrap(gl);
}
if ((view.debugFlags & (DEBUG_CHECK_GL_ERROR | DEBUG_LOG_GL_CALLS)) != 0) {
int configFlags = 0;
Writer log = null;
if ((view.debugFlags & DEBUG_CHECK_GL_ERROR) != 0) {
configFlags |= GLDebugHelper.CONFIG_CHECK_GL_ERROR;
}
if ((view.debugFlags & DEBUG_LOG_GL_CALLS) != 0) {
log = new LogWriter();
}
gl = GLDebugHelper.wrap(gl, configFlags, log);
}
}
return gl;
}
示例7: createGL
import javax.microedition.khronos.opengles.GL; //導入依賴的package包/類
/**
* Create a GL object for the current EGL context.
* @return
*/
GL createGL() {
GL gl = mEglContext.getGL();
GLTextureView view = mGLTextureViewWeakRef.get();
if (view != null) {
if (view.mGLWrapper != null) {
gl = view.mGLWrapper.wrap(gl);
}
if ((view.mDebugFlags & (DEBUG_CHECK_GL_ERROR | DEBUG_LOG_GL_CALLS)) != 0) {
int configFlags = 0;
Writer log = null;
if ((view.mDebugFlags & DEBUG_CHECK_GL_ERROR) != 0) {
configFlags |= GLDebugHelper.CONFIG_CHECK_GL_ERROR;
}
if ((view.mDebugFlags & DEBUG_LOG_GL_CALLS) != 0) {
log = new LogWriter();
}
gl = GLDebugHelper.wrap(gl, configFlags, log);
}
}
return gl;
}
示例8: createGL
import javax.microedition.khronos.opengles.GL; //導入依賴的package包/類
/**
* Create a GL object for the current EGL context.
* @return
*/
GL createGL() {
GL gl = mEglContext.getGL();
GlTextureView view = mGLTextureViewWeakRef.get();
if (view != null) {
if (view.mGLWrapper != null) {
gl = view.mGLWrapper.wrap(gl);
}
if ((view.mDebugFlags & (DEBUG_CHECK_GL_ERROR | DEBUG_LOG_GL_CALLS)) != 0) {
int configFlags = 0;
Writer log = null;
if ((view.mDebugFlags & DEBUG_CHECK_GL_ERROR) != 0) {
configFlags |= GLDebugHelper.CONFIG_CHECK_GL_ERROR;
}
if ((view.mDebugFlags & DEBUG_LOG_GL_CALLS) != 0) {
log = new LogWriter();
}
gl = GLDebugHelper.wrap(gl, configFlags, log);
}
}
return gl;
}
示例9: MatrixTrackingGL
import javax.microedition.khronos.opengles.GL; //導入依賴的package包/類
public MatrixTrackingGL(GL gl, GLSurfaceView glSurfaceView) {
mgl = (GL10) gl;
if (gl instanceof GL10Ext) {
mgl10Ext = (GL10Ext) gl;
}
if (gl instanceof GL11) {
mgl11 = (GL11) gl;
}
if (gl instanceof GL11Ext) {
mgl11Ext = (GL11Ext) gl;
}
mGLSurfaceView = glSurfaceView;
mModelView = new MatrixStack();
mProjection = new MatrixStack();
mTexture = new MatrixStack();
mCurrent = mModelView;
mMatrixMode = GL10.GL_MODELVIEW;
}
示例10: GLWrapper
import javax.microedition.khronos.opengles.GL; //導入依賴的package包/類
/**init methods*/
public GLWrapper(GL gl, GLSurfaceView glSurfaceView)
{
mGL = (GL10)gl;
if(gl instanceof GL10Ext)
{
mGL10Ext = (GL10Ext)gl;
}
if(gl instanceof GL11)
{
mGL11 = (GL11)gl;
}
if(gl instanceof GL11Ext)
{
mGL11Ext = (GL11Ext)gl;
}
if(gl instanceof GL11ExtensionPack)
{
mGL11ExtPack = (GL11ExtensionPack)gl;
}
mGLSurfaceView = glSurfaceView;
}
示例11: createBufferObjects
import javax.microedition.khronos.opengles.GL; //導入依賴的package包/類
public void createBufferObjects(GL gl) {
// Generate a the vertex and element buffer IDs
int[] vboIds = new int[2];
GL11 gl11 = (GL11) gl;
gl11.glGenBuffers(2, vboIds, 0);
mVertexBufferObjectId = vboIds[0];
mElementBufferObjectId = vboIds[1];
// Upload the vertex data
gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, mVertexBufferObjectId);
mVertexByteBuffer.position(0);
gl11.glBufferData(GL11.GL_ARRAY_BUFFER, mVertexByteBuffer.capacity(), mVertexByteBuffer, GL11.GL_STATIC_DRAW);
gl11.glBindBuffer(GL11.GL_ELEMENT_ARRAY_BUFFER, mElementBufferObjectId);
mIndexBuffer.position(0);
gl11.glBufferData(GL11.GL_ELEMENT_ARRAY_BUFFER, mIndexBuffer.capacity() * CHAR_SIZE, mIndexBuffer, GL11.GL_STATIC_DRAW);
// We don't need the in-memory data any more
mVertexBuffer = null;
mVertexByteBuffer = null;
mIndexBuffer = null;
}
示例12: generateWeightedGrid
import javax.microedition.khronos.opengles.GL; //導入依賴的package包/類
private Grid generateWeightedGrid(GL gl) {
final int uSteps = 20;
final int vSteps = 20;
float radius = 0.25f;
float height = 2.0f;
Grid grid = new Grid(uSteps + 1, vSteps + 1);
for (int j = 0; j <= vSteps; j++) {
for (int i = 0; i <= uSteps; i++) {
double angle = Math.PI * 2 * i / uSteps;
float x = radius * (float) Math.cos(angle);
float y = height * ((float) j / vSteps - 0.5f);
float z = radius * (float) Math.sin(angle);
float u = -4.0f * (float) i / uSteps;
float v = -4.0f * (float) j / vSteps;
float w0 = (float) j / vSteps;
float w1 = 1.0f - w0;
grid.set(i, j, x, y, z, u, v, w0, w1, 0, 1);
}
}
grid.createBufferObjects(gl);
return grid;
}
示例13: createBufferObjects
import javax.microedition.khronos.opengles.GL; //導入依賴的package包/類
public void createBufferObjects(GL gl) {
checkGLError(gl);
// Generate a the vertex and element buffer IDs
int[] vboIds = new int[2];
GL11 gl11 = (GL11) gl;
gl11.glGenBuffers(2, vboIds, 0);
mVertexBufferObjectId = vboIds[0];
mElementBufferObjectId = vboIds[1];
// Upload the vertex data
gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, mVertexBufferObjectId);
mVertexByteBuffer.position(0);
gl11.glBufferData(GL11.GL_ARRAY_BUFFER, mVertexByteBuffer.capacity(), mVertexByteBuffer, GL11.GL_STATIC_DRAW);
gl11.glBindBuffer(GL11.GL_ELEMENT_ARRAY_BUFFER, mElementBufferObjectId);
mIndexBuffer.position(0);
gl11.glBufferData(GL11.GL_ELEMENT_ARRAY_BUFFER, mIndexBuffer.capacity() * CHAR_SIZE, mIndexBuffer, GL11.GL_STATIC_DRAW);
// We don't need the in-memory data any more
mVertexBuffer = null;
mVertexByteBuffer = null;
mIndexBuffer = null;
checkGLError(gl);
}
示例14: createGL
import javax.microedition.khronos.opengles.GL; //導入依賴的package包/類
/**
* Create a GL object for the current EGL context.
*/
GL createGL() {
GL gl = mEglContext.getGL();
GLSurfaceViewAPI18 view = mGLSurfaceViewWeakRef.get();
if (view != null) {
if (view.mGLWrapper != null) {
gl = view.mGLWrapper.wrap(gl);
}
if ((view.mDebugFlags & (DEBUG_CHECK_GL_ERROR | DEBUG_LOG_GL_CALLS)) != 0) {
int configFlags = 0;
Writer log = null;
if ((view.mDebugFlags & DEBUG_CHECK_GL_ERROR) != 0) {
configFlags |= GLDebugHelper.CONFIG_CHECK_GL_ERROR;
}
if ((view.mDebugFlags & DEBUG_LOG_GL_CALLS) != 0) {
log = new LogWriter();
}
gl = GLDebugHelper.wrap(gl, configFlags, log);
}
}
return gl;
}
示例15: createGL
import javax.microedition.khronos.opengles.GL; //導入依賴的package包/類
/**
* Create a GL object for the current EGL context.
* @return
*/
GL createGL() {
GL gl = mEglContext.getGL();
final GlTextureView view = mGLSurfaceViewWeakRef.get();
if (view != null) {
if (view.mGLWrapper != null) {
gl = view.mGLWrapper.wrap(gl);
}
if ((view.mDebugFlags & (DEBUG_CHECK_GL_ERROR | DEBUG_LOG_GL_CALLS)) != 0) {
int configFlags = 0;
Writer log = null;
if ((view.mDebugFlags & DEBUG_CHECK_GL_ERROR) != 0) {
configFlags |= GLDebugHelper.CONFIG_CHECK_GL_ERROR;
}
if ((view.mDebugFlags & DEBUG_LOG_GL_CALLS) != 0) {
log = new LogWriter(GlTextureView.TAG);
}
gl = GLDebugHelper.wrap(gl, configFlags, log);
}
}
return gl;
}