当前位置: 首页>>代码示例>>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;未经允许,请勿转载。