Android的 - OpenGL的不显示瓦特/模拟器?模拟器、Android、OpenGL

2023-09-06 05:10:03 作者:别捏我肥脸

当我在模拟器上运行我的程序,它会显示一个的ImageView 闪屏,然后黑屏的应用程序的其余部分,它使用 GLSurfaceViews 。该OGL我的手机上运行良好。我已经测试的两台电脑(低和高性能)既不显示GLSurfaceViews程序。我还测试了使用一些来自谷歌apidemos interweb现场演示OGL的仿真器和演示没有任何一台计算机上显示。我的程序使用OGL ES 1.1,但是我也用OGL ES 1.0无济于事测试。我怎么可能会显示OGL在模拟器上?谢谢你。

下面是一些简单的方形渲染code的例子并不在模拟器上工作。

 公共无效onDrawFrame(GL10 GL){  //这工作  gl.glClearColor(_red,_green,_blue,1.0F);  gl.glClear(GL10.GL_COLOR_BUFFER_BIT);  //这不  浮顶点[] = {.5f,.5f,0,.5f,-.5f,0,-.5f,.5f,0,-.5f,-.5f,0};  FloatBuffer vertexSquareBuffer = ByteBuffer.allocateDirect(4 * 3 * 4)    。.order(ByteOrder.nativeOrder())asFloatBuffer();  vertexSquareBuffer.put(顶点);  vertexSquareBuffer.position(0);  gl.glColor4f(1,1,0,0.5F);  gl.glVertexPointer(3,GL10.GL_FLOAT,0,vertexSquareBuffer);  gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP,0,4);} 
OpenGL ES之二 Android中的OpenGL ES概述

解决方案

那么有一些可能性。首先让我们看看事情应该工作,并在你的仿真器。你能请到这里试试这个教程,并通过模拟器运行它的 http://www.droidnova.com/android-3d-game-tutorial-part-i,312.html (第一个做到这一点位)

我们知道这样,如果该问题是否与您的code或仿真器。

之后,你可能需要看看是否有所有的所需的共享对象库present 。

让我知道你如何去评论。

When I run my program on an emulator, it displays an ImageView splash screen, then a black screen for the remainder of the application, which uses GLSurfaceViews. The OGL runs well on my phone. I have tested the program on two computers (low and high performance) and neither displays the GLSurfaceViews. I have also tested the emulator using some of the OGL demos from the Google apidemos interweb site and the demos don't display on either computer. My program uses OGL es 1.1, however I have also tested using OGL es 1.0 to no avail. How might I display ogl on an emulator? Thanks.

Here's an example of some simple square rendering code that doesn't work on the emulator


public void onDrawFrame(GL10 gl) {
  //This works
  gl.glClearColor(_red, _green, _blue, 1.0f);
  gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
  //This doesn't
  float vertices[] = { .5f, .5f, 0, .5f, -.5f, 0, -.5f, .5f, 0, -.5f, -.5f, 0 };
  FloatBuffer vertexSquareBuffer = ByteBuffer.allocateDirect(4 * 3 * 4)
    .order(ByteOrder.nativeOrder()).asFloatBuffer();
  vertexSquareBuffer.put(vertices);
  vertexSquareBuffer.position(0);
  gl.glColor4f(1, 1, 0, 0.5f);
  gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexSquareBuffer);
  gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0,4);
}

解决方案

Well there are some possibilities. Firstly lets see if something that should work, does work on your emulator. Can you please go here and try this tutorial and run it through your emulator: http://www.droidnova.com/android-3d-game-tutorial-part-i,312.html (Do this bit first)

That way we know if the problem is with your code or the emulator.

After that you might need to look to see if there are all the required shared object libraries present.

Let me know in the comments how you go.