本文整理汇总了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);
}
示例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);
}
}
示例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);
}
}
}
示例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;
}
}
示例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);
}
示例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();
}
示例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)
}
示例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);
}
示例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);
}
示例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);*/
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}