當前位置: 首頁>>代碼示例>>Java>>正文


Java GL類代碼示例

本文整理匯總了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;
}
 
開發者ID:pavelsemak,項目名稱:alpha-movie,代碼行數:28,代碼來源:GLTextureView.java

示例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;
}
 
開發者ID:uestccokey,項目名稱:EZFilter,代碼行數:29,代碼來源:GLSurfaceView.java

示例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;
}
 
開發者ID:uestccokey,項目名稱:EZFilter,代碼行數:29,代碼來源:GLTextureView.java

示例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;
}
 
開發者ID:archos-sa,項目名稱:aos-MediaLib,代碼行數:18,代碼來源:MatrixTrackingGL.java

示例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;
}
 
開發者ID:tgmarinho,項目名稱:apps-for-android,代碼行數:18,代碼來源:MatrixTrackingGL.java

示例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;
}
 
開發者ID:wasabeef,項目名稱:android-RoundedTextureView,代碼行數:27,代碼來源:GLTextureView.java

示例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;
}
 
開發者ID:RealWei,項目名稱:md360,代碼行數:28,代碼來源:GLTextureView.java

示例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;
}
 
開發者ID:shchurov,項目名稱:ParticleView,代碼行數:28,代碼來源:GlTextureView.java

示例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;
}
 
開發者ID:codedavid,項目名稱:PanoramaGL,代碼行數:19,代碼來源:MatrixTrackingGL.java

示例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;
}
 
開發者ID:codedavid,項目名稱:PanoramaGL,代碼行數:24,代碼來源:GLWrapper.java

示例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;
}
 
開發者ID:luoqii,項目名稱:ApkLauncher,代碼行數:23,代碼來源:MatrixPaletteRenderer.java

示例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;
}
 
開發者ID:luoqii,項目名稱:ApkLauncher,代碼行數:26,代碼來源:MatrixPaletteRenderer.java

示例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);
}
 
開發者ID:luoqii,項目名稱:ApkLauncher,代碼行數:25,代碼來源:CubeMapActivity.java

示例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;
}
 
開發者ID:basherone,項目名稱:libgdxcn,代碼行數:27,代碼來源:GLSurfaceViewAPI18.java

示例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;
}
 
開發者ID:kkucherenkov,項目名稱:FxCameraApp,代碼行數:28,代碼來源:GlTextureView.java


注:本文中的javax.microedition.khronos.opengles.GL類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。