本文整理汇总了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;
}