当前位置: 首页>>代码示例>>Java>>正文


Java GLES10类代码示例

本文整理汇总了Java中android.opengl.GLES10的典型用法代码示例。如果您正苦于以下问题:Java GLES10类的具体用法?Java GLES10怎么用?Java GLES10使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GLES10类属于android.opengl包,在下文中一共展示了GLES10类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadOnCreate

import android.opengl.GLES10; //导入依赖的package包/类
@Override
            protected void loadOnCreate() {
//                GL_RENDERER = glGetString(GLES10.GL_RENDERER);
//                GL_VERSION = glGetString(GLES10.GL_VERSION);
//                GL_VENDOR = glGetString(GLES10.GL_VENDOR);
                GL_MAX_TEXTURE_SIZE = glGetIntegerv(GLES10.GL_MAX_TEXTURE_SIZE);
//                GL_MAX_TEXTURE_UNITS = glGetIntegerv(GLES10.GL_MAX_TEXTURE_UNITS);
//                GL_MAX_LIGHTS = glGetIntegerv(GLES10.GL_MAX_LIGHTS);
//                GL_SUBPIXEL_BITS = glGetIntegerv(GLES10.GL_SUBPIXEL_BITS);
//                GL_MAX_ELEMENTS_VERTICES = glGetIntegerv(GLES10.GL_MAX_ELEMENTS_VERTICES);
//                GL_MAX_ELEMENTS_INDICES = glGetIntegerv(GLES10.GL_MAX_ELEMENTS_INDICES);
//                GL_MAX_MODELVIEW_STACK_DEPTH = glGetIntegerv(GLES10.GL_MAX_MODELVIEW_STACK_DEPTH);
//                GL_MAX_PROJECTION_STACK_DEPTH = glGetIntegerv(GLES10.GL_MAX_PROJECTION_STACK_DEPTH);
//                GL_MAX_TEXTURE_STACK_DEPTH = glGetIntegerv(GLES10.GL_MAX_TEXTURE_STACK_DEPTH);
//                GL_DEPTH_BITS = glGetIntegerv(GLES10.GL_DEPTH_BITS);
//                GL_STENCIL_BITS = glGetIntegerv(GLES10.GL_STENCIL_BITS);
                GL_EXTENSIONS = glGetString(GLES10.GL_EXTENSIONS);
//                GL_MAX_VIEWPORT_DIMS = glGetIntegerv(GLES10.GL_MAX_VIEWPORT_DIMS, 2);
            }
 
开发者ID:QuixomTech,项目名称:DeviceInfo,代码行数:20,代码来源:GPU.java

示例2: addExtensionsForConfig

import android.opengl.GLES10; //导入依赖的package包/类
private static void addExtensionsForConfig(EGL10 egl10, EGLDisplay egldisplay, EGLConfig eglconfig, int ai[], int ai1[], Set<String> set) {
    EGLContext eglContext = egl10.eglCreateContext(egldisplay, eglconfig, EGL10.EGL_NO_CONTEXT, ai1);
    if (eglContext == EGL10.EGL_NO_CONTEXT) {
        return;
    }
    javax.microedition.khronos.egl.EGLSurface eglSurface = egl10.eglCreatePbufferSurface(egldisplay, eglconfig, ai);
    if (eglSurface == EGL10.EGL_NO_SURFACE) {
        egl10.eglDestroyContext(egldisplay, eglContext);
    } else {
        egl10.eglMakeCurrent(egldisplay, eglSurface, eglSurface, eglContext);
        String s = GLES10.glGetString(7939);
        if (!TextUtils.isEmpty(s)) {
            String as[] = s.split(" ");
            int i = as.length;
            for (int j = 0; j < i; j++) {
                set.add(as[j]);
            }
        }
        egl10.eglMakeCurrent(egldisplay, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_CONTEXT);
        egl10.eglDestroySurface(egldisplay, eglSurface);
        egl10.eglDestroyContext(egldisplay, eglContext);
    }
}
 
开发者ID:yeriomin,项目名称:YalpStore,代码行数:24,代码来源:EglExtensionRetriever.java

示例3: logVersionInfo

import android.opengl.GLES10; //导入依赖的package包/类
/**
 * Writes GL version info to the log.
 */
@SuppressLint("InlinedApi")
public static void logVersionInfo() {
	Log.i(TAG, "vendor  : " + GLES10.glGetString(GLES10.GL_VENDOR));
	Log.i(TAG, "renderer: " + GLES10.glGetString(GLES10.GL_RENDERER));
	Log.i(TAG, "version : " + GLES10.glGetString(GLES10.GL_VERSION));

	if (BuildCheck.isAndroid4_3()) {
		final int[] values = new int[1];
		GLES30.glGetIntegerv(GLES30.GL_MAJOR_VERSION, values, 0);
		final int majorVersion = values[0];
		GLES30.glGetIntegerv(GLES30.GL_MINOR_VERSION, values, 0);
		final int minorVersion = values[0];
		if (GLES30.glGetError() == GLES30.GL_NO_ERROR) {
			Log.i(TAG, "version: " + majorVersion + "." + minorVersion);
		}
	}
}
 
开发者ID:saki4510t,项目名称:libcommon,代码行数:21,代码来源:GLHelper.java

示例4: gluErrorString

import android.opengl.GLES10; //导入依赖的package包/类
/**
 * Return an error string from a GL or GLU error code.
 *
 * @param error - a GL or GLU error code.
 * @return the error string for the input error code, or NULL if the input
 *         was not a valid GL or GLU error code.
 */
public static String gluErrorString(final int error) {
	switch (error) {
	case GLES10.GL_NO_ERROR:
		return "no error";
	case GLES10.GL_INVALID_ENUM:
		return "invalid enum";
	case GLES10.GL_INVALID_VALUE:
		return "invalid value";
	case GLES10.GL_INVALID_OPERATION:
		return "invalid operation";
	case GLES10.GL_STACK_OVERFLOW:
		return "stack overflow";
	case GLES10.GL_STACK_UNDERFLOW:
		return "stack underflow";
	case GLES10.GL_OUT_OF_MEMORY:
		return "out of memory";
	default:
		return null;
	}
}
 
开发者ID:saki4510t,项目名称:libcommon,代码行数:28,代码来源:GLHelper.java

示例5: draw

import android.opengl.GLES10; //导入依赖的package包/类
@Override
	public void draw(final int texId, final float[] tex_matrix, final int offset) {
		// FIXME Matrixを適用
		GLES10.glEnableClientState(GLES10.GL_VERTEX_ARRAY);
		pVertex.position(0);
		GLES10.glVertexPointer(2, GLES10.GL_FLOAT, VERTEX_SZ, pVertex);
//--------------------------------------------------------------------------------
		GLES10.glEnableClientState(GLES10.GL_TEXTURE_COORD_ARRAY);
		pTexCoord.position(0);
		GLES10.glTexCoordPointer(VERTEX_NUM, GLES10.GL_FLOAT, VERTEX_SZ, pTexCoord);
		GLES10.glActiveTexture(GLES10.GL_TEXTURE0);
		GLES10.glBindTexture(mTexTarget, texId);
//--------------------------------------------------------------------------------
		GLES10.glDrawArrays(GLES10.GL_TRIANGLE_STRIP, 0, VERTEX_NUM);
//--------------------------------------------------------------------------------
		GLES10.glBindTexture(mTexTarget, 0);
		GLES10.glDisableClientState(GLES10.GL_TEXTURE_COORD_ARRAY);
//--------------------------------------------------------------------------------
		GLES10.glDisableClientState(GLES10.GL_VERTEX_ARRAY);
	}
 
开发者ID:saki4510t,项目名称:libcommon,代码行数:21,代码来源:GLDrawer2D.java

示例6: getContents

import android.opengl.GLES10; //导入依赖的package包/类
public String getContents() {
    StringBuilder sb = new StringBuilder();
    Formatter f = new Formatter(sb, Locale.US);
    String vendor = GLES10.glGetString(GLES10.GL_VENDOR);
    if (vendor == null) {
        f.format("!!! Please tap on another tab and then tap back on this tab. !!!\n\n");
    }
    f.format("vendor: %s\n", vendor);
    f.format("version: %s\n", GLES10.glGetString(GLES10.GL_VERSION));
    String extensions = GLES10.glGetString(GLES10.GL_EXTENSIONS);
    if (extensions == null) {
        extensions = "";
    }
    f.format("extensions: %s\n", extensions.replaceAll(" ", "\n"));
    return sb.toString();
}
 
开发者ID:iamtrk,项目名称:Device-Explorer,代码行数:17,代码来源:Content.java

示例7: onSurfaceCreated

import android.opengl.GLES10; //导入依赖的package包/类
@Override
    public void onSurfaceCreated(GL10 gl, EGLConfig config) {
        super.onSurfaceCreated(gl,config);
//        batch = new SpriteBatch();
//        img = new Texture("world.png");

        GLES10.glClearColor(0.0f, 0.0f, 0.0f, 0.f);

        // Create the GLText
        glText = new GLText( gl, context.getAssets() );

        // Load the font from file (set size + padding), creates the texture
        // NOTE: after a successful call to this the font is ready for rendering!
        glText.load( "Roboto-Regular.ttf", 14, 2, 2 );  // Create Font (Height: 14 Pixels / X+Y Padding 2 Pixels)

    }
 
开发者ID:harua8n,项目名称:CodeSamples,代码行数:17,代码来源:SimpleRenderer.java

示例8: addExtensionsForConfig

import android.opengl.GLES10; //导入依赖的package包/类
private static void addExtensionsForConfig(EGL10 paramEGL10, EGLDisplay paramEGLDisplay, EGLConfig paramEGLConfig, int[] paramArrayOfInt1, int[] paramArrayOfInt2, Set<String> paramSet)
{
  EGLContext localEGLContext = paramEGL10.eglCreateContext(paramEGLDisplay, paramEGLConfig, EGL10.EGL_NO_CONTEXT, paramArrayOfInt2);
  if (localEGLContext == EGL10.EGL_NO_CONTEXT) {
    return;
  }
  EGLSurface localEGLSurface = paramEGL10.eglCreatePbufferSurface(paramEGLDisplay, paramEGLConfig, paramArrayOfInt1);
  if (localEGLSurface == EGL10.EGL_NO_SURFACE)
  {
    paramEGL10.eglDestroyContext(paramEGLDisplay, localEGLContext);
    return;
  }
  paramEGL10.eglMakeCurrent(paramEGLDisplay, localEGLSurface, localEGLSurface, localEGLContext);
  String str = GLES10.glGetString(7939);
  if (!TextUtils.isEmpty(str))
  {
    String[] arrayOfString = str.split(" ");
    int i = arrayOfString.length;
    for (int j = 0; j < i; j++) {
      paramSet.add(arrayOfString[j]);
    }
  }
  paramEGL10.eglMakeCurrent(paramEGLDisplay, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_CONTEXT);
  paramEGL10.eglDestroySurface(paramEGLDisplay, localEGLSurface);
  paramEGL10.eglDestroyContext(paramEGLDisplay, localEGLContext);
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:27,代码来源:GlExtensionReader.java

示例9: loadOnCreate

import android.opengl.GLES10; //导入依赖的package包/类
@Override
protected void loadOnCreate() {
    GL_RENDERER = glGetString(GLES10.GL_RENDERER);
    GL_VERSION = glGetString(GLES10.GL_VERSION);
    GL_VENDOR = glGetString(GLES10.GL_VENDOR);
    GL_MAX_TEXTURE_SIZE = glGetIntegerv(GLES10.GL_MAX_TEXTURE_SIZE);
    GL_MAX_TEXTURE_UNITS = glGetIntegerv(GLES10.GL_MAX_TEXTURE_UNITS);
    GL_MAX_LIGHTS = glGetIntegerv(GLES10.GL_MAX_LIGHTS);
    GL_SUBPIXEL_BITS = glGetIntegerv(GLES10.GL_SUBPIXEL_BITS);
    GL_MAX_ELEMENTS_VERTICES = glGetIntegerv(GLES10.GL_MAX_ELEMENTS_VERTICES);
    GL_MAX_ELEMENTS_INDICES = glGetIntegerv(GLES10.GL_MAX_ELEMENTS_INDICES);
    GL_MAX_MODELVIEW_STACK_DEPTH = glGetIntegerv(GLES10.GL_MAX_MODELVIEW_STACK_DEPTH);
    GL_MAX_PROJECTION_STACK_DEPTH = glGetIntegerv(GLES10.GL_MAX_PROJECTION_STACK_DEPTH);
    GL_MAX_TEXTURE_STACK_DEPTH = glGetIntegerv(GLES10.GL_MAX_TEXTURE_STACK_DEPTH);
    GL_DEPTH_BITS = glGetIntegerv(GLES10.GL_DEPTH_BITS);
    GL_STENCIL_BITS = glGetIntegerv(GLES10.GL_STENCIL_BITS);
    GL_EXTENSIONS = glGetString(GLES10.GL_EXTENSIONS);
    GL_MAX_VIEWPORT_DIMS = glGetIntegerv(GLES10.GL_MAX_VIEWPORT_DIMS, 2);
}
 
开发者ID:paspao,项目名称:MobiStego,代码行数:20,代码来源:GPU.java

示例10: loadOnCreate

import android.opengl.GLES10; //导入依赖的package包/类
@Override
protected void loadOnCreate() {
    GL_RENDERER = glGetString(GLES10.GL_RENDERER);
    GL_VERSION = glGetString(GLES10.GL_VERSION);
    GL_VENDOR = glGetString(GLES10.GL_VENDOR);
    /*GL_MAX_TEXTURE_SIZE = glGetIntegerv(GLES10.GL_MAX_TEXTURE_SIZE);
    GL_MAX_TEXTURE_UNITS = glGetIntegerv(GLES10.GL_MAX_TEXTURE_UNITS);
    GL_MAX_LIGHTS = glGetIntegerv(GLES10.GL_MAX_LIGHTS);
    GL_SUBPIXEL_BITS = glGetIntegerv(GLES10.GL_SUBPIXEL_BITS);
    GL_MAX_ELEMENTS_VERTICES = glGetIntegerv(GLES10.GL_MAX_ELEMENTS_VERTICES);
    GL_MAX_ELEMENTS_INDICES = glGetIntegerv(GLES10.GL_MAX_ELEMENTS_INDICES);
    GL_MAX_MODELVIEW_STACK_DEPTH = glGetIntegerv(GLES10.GL_MAX_MODELVIEW_STACK_DEPTH);
    GL_MAX_PROJECTION_STACK_DEPTH = glGetIntegerv(GLES10.GL_MAX_PROJECTION_STACK_DEPTH);
    GL_MAX_TEXTURE_STACK_DEPTH = glGetIntegerv(GLES10.GL_MAX_TEXTURE_STACK_DEPTH);
    GL_DEPTH_BITS = glGetIntegerv(GLES10.GL_DEPTH_BITS);
    GL_STENCIL_BITS = glGetIntegerv(GLES10.GL_STENCIL_BITS);
    GL_EXTENSIONS = glGetString(GLES10.GL_EXTENSIONS);
    GL_MAX_VIEWPORT_DIMS = glGetIntegerv(GLES10.GL_MAX_VIEWPORT_DIMS, 2);*/
}
 
开发者ID:Daniele-Comi,项目名称:System-Monitor,代码行数:20,代码来源:GPU.java

示例11: load

import android.opengl.GLES10; //导入依赖的package包/类
public void load(GL10 gl) {
    int width = 128;
    int height = 128;
    Buffer image = createImage(width, height);
    ETC1Util.ETC1Texture etc1Texture = ETC1Util.compressTexture(image, width, height, 3, 3 * width);
    if (USE_STREAM_IO) {
        // Test the ETC1Util APIs for reading and writing compressed textures to I/O streams.
        try {
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
            ETC1Util.writeTexture(etc1Texture, bos);
            ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
            ETC1Util.loadTexture(GLES10.GL_TEXTURE_2D, 0, 0,
                    GLES10.GL_RGB, GLES10.GL_UNSIGNED_SHORT_5_6_5, bis);
        } catch (IOException e) {
            Log.w(TAG, "Could not load texture: " + e);
        }
    } else {
        ETC1Util.loadTexture(GLES10.GL_TEXTURE_2D, 0, 0,
                GLES10.GL_RGB, GLES10.GL_UNSIGNED_SHORT_5_6_5, etc1Texture);
    }
}
 
开发者ID:luoqii,项目名称:ApkLauncher,代码行数:22,代码来源:CompressedTextureActivity.java

示例12: isETC1Supported

import android.opengl.GLES10; //导入依赖的package包/类
/**
 * Check if ETC1 texture compression is supported by the active OpenGL ES context.
 * @return true if the active OpenGL ES context supports ETC1 texture compression.
 */
public static boolean isETC1Supported() {
    int[] results = new int[20];
    GLES10.glGetIntegerv(GLES10.GL_NUM_COMPRESSED_TEXTURE_FORMATS, results, 0);
    int numFormats = results[0];
    if (numFormats > results.length) {
        results = new int[numFormats];
    }
    GLES10.glGetIntegerv(GLES10.GL_COMPRESSED_TEXTURE_FORMATS, results, 0);
    for (int i = 0; i < numFormats; i++) {
        if (results[i] == JavaETC1.ETC1_RGB8_OES) {
            return true;
        }
    }
    return false;
}
 
开发者ID:nicastel,项目名称:renderscript_texture_compressor,代码行数:20,代码来源:JavaETC1Util.java

示例13: isETC1Supported

import android.opengl.GLES10; //导入依赖的package包/类
/**
 * Check if ETC1 texture compression is supported by the active OpenGL ES context.
 * @return true if the active OpenGL ES context supports ETC1 texture compression.
 */
public static boolean isETC1Supported() {
    int[] results = new int[20];
    GLES10.glGetIntegerv(GLES10.GL_NUM_COMPRESSED_TEXTURE_FORMATS, results, 0);
    int numFormats = results[0];
    if (numFormats > results.length) {
        results = new int[numFormats];
    }
    GLES10.glGetIntegerv(GLES10.GL_COMPRESSED_TEXTURE_FORMATS, results, 0);
    for (int i = 0; i < numFormats; i++) {
        if (results[i] == RsETC1.ETC1_RGB8_OES) {
            return true;
        }
    }
    return false;
}
 
开发者ID:nicastel,项目名称:renderscript_texture_compressor,代码行数:20,代码来源:RsETC1Util.java

示例14: drawQuadWithTexture

import android.opengl.GLES10; //导入依赖的package包/类
@Override
public void drawQuadWithTexture(TextureHandle textureid, float[] geometry) {
	if (quadEleementBuffer == null) {
		generateQuadElementBuffer();
	}
	quadEleementBuffer.position(0);
	glBindTexture(textureid);

	FloatBuffer buffer = generateTemporaryFloatBuffer(geometry);

	GLES10.glVertexPointer(3, GLES10.GL_FLOAT, 5 * 4, buffer);
	FloatBuffer texbuffer = reuseableBufferDuplicate;
	texbuffer.position(3);
	GLES10.glTexCoordPointer(2, GLES10.GL_FLOAT, 5 * 4, texbuffer);

	GLES10.glDrawElements(GLES10.GL_TRIANGLES, 6, GLES10.GL_UNSIGNED_BYTE,
			quadEleementBuffer);
}
 
开发者ID:jsettlers,项目名称:settlers-remake,代码行数:19,代码来源:AndroidDrawContext.java

示例15: drawTrianglesWithTextureColored

import android.opengl.GLES10; //导入依赖的package包/类
@Override
public void drawTrianglesWithTextureColored(TextureHandle textureid, float[] geometry) {
	glBindTexture(textureid);

	GLES10.glEnableClientState(GLES10.GL_COLOR_ARRAY);

	FloatBuffer buffer = generateTemporaryFloatBuffer(geometry);

	GLES10.glVertexPointer(3, GLES10.GL_FLOAT, 9 * 4, buffer);
	FloatBuffer texbuffer = reuseableBufferDuplicate;
	texbuffer.position(3);
	GLES10.glTexCoordPointer(2, GLES10.GL_FLOAT, 9 * 4, texbuffer);
	FloatBuffer colorbuffer = buffer.duplicate(); // we need it selden enogh
													// to allocate a new one.
	colorbuffer.position(5);
	GLES10.glColorPointer(4, GLES10.GL_FLOAT, 9 * 4, colorbuffer);

	GLES10.glDrawArrays(GLES10.GL_TRIANGLES, 0, geometry.length / 9);
	GLES10.glDisableClientState(GLES10.GL_COLOR_ARRAY);
}
 
开发者ID:jsettlers,项目名称:settlers-remake,代码行数:21,代码来源:AndroidDrawContext.java


注:本文中的android.opengl.GLES10类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。