Android NDK可以实现最快的2D帧速率,包括我的尝试,更好的选择?
我使用NDK和OpenGL ES 2.0在GL_TRIANGLE_STRIP上将框架显示为纹理.这是在HTC Desire上完成的,与Nexus One相同.我试图加载多个GL_RGBA纹理并在纹理之间切换,因为单个纹理的正常填充率令人失望地低:
我认为即使30.32 fps RGBA仍然太慢.
那么这是实现最快2D帧速率(具有相同质量)的方法吗?有什么建议可以加快速度吗?
这是相关代码,它基于hello-gl2 NDK示例:
=== GL2JNIView.java:
init(false, 0, 0);
ConfigChooser(5, 6, 5, 0, depth, stencil);
Run Code Online (Sandbox Code Playgroud)
=== gl_code.cpp:
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <android/log.h>
#include <stdlib.h>
#include <time.h>
typedef unsigned char byte;
static int view_width, view_height;
static byte* framebuffer;
static int framebuffer_size;
static GLuint texture_id[6];
static const char* vertexSrc =
"precision highp float;\n"
"precision highp int;\n"
"attribute vec4 vertexCoords;\n"
"attribute …Run Code Online (Sandbox Code Playgroud)