本文整理匯總了Java中android.opengl.GLES10.glGetString方法的典型用法代碼示例。如果您正苦於以下問題:Java GLES10.glGetString方法的具體用法?Java GLES10.glGetString怎麽用?Java GLES10.glGetString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.opengl.GLES10
的用法示例。
在下文中一共展示了GLES10.glGetString方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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);
}
}
示例2: 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();
}
示例3: 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);
}
示例4: 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) {
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 (s != null && !s.isEmpty()) {
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);
}
}
}
示例5: getDetailedItems
import android.opengl.GLES10; //導入方法依賴的package包/類
public List<ItemDetails> getDetailedItems() {
List<ItemDetails> detailedItems = new ArrayList<>();
String vendor = GLES10.glGetString(GLES10.GL_VENDOR);
detailedItems.add(new ItemDetails("Vendor", vendor));
detailedItems.add(new ItemDetails("Version", GLES10.glGetString(GLES10.GL_VERSION)));
String extensions = GLES10.glGetString(GLES10.GL_EXTENSIONS);
if (extensions == null) {
extensions = "";
}
detailedItems.add(new ItemDetails("Extensions", extensions.replaceAll(" ", "\n")));
return detailedItems;
}
示例6: glGetString
import android.opengl.GLES10; //導入方法依賴的package包/類
public synchronized static String glGetString(int value) {
return GLES10.glGetString(value);
}
示例7: executeGLThreadJobs
import android.opengl.GLES10; //導入方法依賴的package包/類
@Override
protected void executeGLThreadJobs() {
// Here it is certain that the Unity renderer is active.
// Attempt to find the GL context to share with the holokilo
// opengl context. The two contexts run side by side, the unity
// context runs in background and passes its results to holokilo.
EGL10 egl = ((EGL10)EGLContext.getEGL());
final EGLContext con = egl.eglGetCurrentContext();
if (majorVersionUnity == -1 && !con.equals(EGL10.EGL_NO_CONTEXT)) {
String versionString = GLES10.glGetString(GLES10.GL_VERSION);
for (int i = 0; i < versionString.length(); i++) {
int cha = versionString.charAt(i);
if (Character.isDigit(cha)) {
majorVersionUnity = Character.getNumericValue(cha);
break;
}
}
Log.d(Config.TAG, "GL Version: " + majorVersionUnity);
}
// Rescale the unity surface to 1x1 pixel to hide,
// but keep it regular sized to show the unity splashscreen,
// in accordance with their license agreement.
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
if (con.equals(EGL10.EGL_NO_CONTEXT)) {
// no current context.
} else if (surface == null) {
surface = new UnitySurfaceView(activity, con, majorVersionUnity);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
// Do nothing
}
activity.getLayout().addView(surface);
UnityPlayer.this.setLayoutParams(layoutParams);
} else if (surface.getEglContext().hashCode() != con.hashCode()) {
removeView(surface);
surface.onPause();
activity.getLayout().removeView(surface);
surface = new UnitySurfaceView(activity, con, majorVersionUnity);
activity.getLayout().addView(surface, 0);
}
}
});
}
示例8: determineGraphicSupport
import android.opengl.GLES10; //導入方法依賴的package包/類
public void determineGraphicSupport(GL10 gl) {
final String extensions = gl.glGetString(GL10.GL_EXTENSIONS);
final String version = GLES10.glGetString(GL10.GL_VERSION);
final String renderer = gl.glGetString(GL10.GL_RENDERER);
Log.w("GLExtensions", "Extensions: " + extensions);
Log.w("GLVersion", "Version: " + version);
Log.w("GLRenderer", "Renderer: " + renderer);
// GL_EXT_debug_marker GL_OES_blend_func_separate GL_OES_blend_equation_separate GL_OES_blend_subtract
// GL_OES_byte_coordinates GL_OES_compressed_paletted_texture GL_OES_point_size_array GL_OES_point_sprite
// GL_OES_single_precision GL_OES_stencil_wrap GL_OES_texture_env_crossbar GL_OES_texture_mirored_repeat
// GL_OES_EGL_image GL_OES_element_index_uint GL_OES_draw_texture GL_OES_texture_cube_map GL_OES_draw_texture
// GL_OES_read_format GL_OES_framebuffer_object GL_OES_depth24 GL_OES_depth32 GL_OES_fbo_render_mipmap
// GL_OES_rgb8_rgba8 GL_OES_stencil1 GL_OES_stencil4 GL_OES_stencil8
// GL_OES_packed_depth_stencil GL_EXT_texture_format_BGRA8888 GL_APPLE_texture_format_BGRA8888
// GL_OES_compressed_ETC1_RGB8_texture
String enabledCompressions = "";
if (extensions.contains("GL_IMG_texture_compression_pvrtc")) {
//Use PVR compressed textures
Log.w("Ext", "Device supports PVR");
enabledCompressions += "Device supports PVR\n\t";
}
if (extensions.contains("GL_AMD_compressed_ATC_texture") ||
extensions.contains("GL_ATI_texture_compression_atitc")) {
//Load ATI Textures
Log.w("Ext", "Device supports ATI");
enabledCompressions += "Device supports ATI\n\t";
}
if (extensions.contains("GL_OES_texture_compression_S3TC") ||
extensions.contains("GL_EXT_texture_compression_s3tc")) {
//Use DTX Textures
Log.w("Ext", "Device supports S3TC");
enabledCompressions += "Device supports S3TC\n\t";
}
if (extensions.contains("GL_EXT_texture_compression_dxt1")) {
//Use DTX1 Textures
Log.w("Ext", "Device supports DXT1");
enabledCompressions += "Device supports DXT1\n\t";
}
if (extensions.contains("GL_EXT_texture_compression_dxt3")) {
//Use DTX3 Textures
Log.w("Ext", "Device supports DXT3");
enabledCompressions += "Device supports DXT3\n\t";
}
if (extensions.contains("GL_EXT_texture_compression_dxt5")) {
//Use DTX5 Textures
Log.w("Ext", "Device supports DXT5");
enabledCompressions += "Device supports DXT5\n\t";
}
if (extensions.contains("GL_AMD_compressed_3DC_texture")) {
//Use 3DC Texture
Log.w("Ext", "Device supports 3DC textures");
enabledCompressions += "Device supports 3DC textures\n\t";
}
if (ETC1Util.isETC1Supported()) {
//Use ETC1
Log.w("Ext", "Device supports ETC1 Rgb8 textures");
enabledCompressions += "Device supports ETC1 Rgb8 textures\n\t";
}
final String enabComprFinal = enabledCompressions;
String[] extArray = extensions.split(" ");
final List<String> ordered = Arrays.asList(extArray);
Collections.sort(ordered);
CheckerActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
String extFormatted = "";
for (String singleExt : ordered) {
extFormatted += singleExt + "\n\t";
}
glExtensionsTv.setText("Extensions: \n\t" + extFormatted);
glVersionTv.setText("Version: " + version);
glRendererTv.setText("Renderer: " + renderer);
glExtensionsEnabled.setText("Texture Compression Supported: \n\t" + enabComprFinal);
}
});
}