Bug: Application called a GL11 Pointer method with an indirect Buffer
来源:互联网 发布:深入浅出学习软件 编辑:程序博客网 时间:2024/06/06 00:45
在Android studio 中测试OpenGL es,app运行崩溃,然后查看日志,发现Error:
原因: 不能直接使用
FloatBuffer.wrap(float [] arr), IntBuffer.wrap(int [] arr)
解决办法:
public IntBuffer bufferUtil(int[] arr){ IntBuffer buffer; ByteBuffer byteBuffer = ByteBuffer.allocateDirect(arr.length * 4); byteBuffer.order(ByteOrder.nativeOrder()); buffer = byteBuffer.asIntBuffer(); buffer.put(arr); buffer.position(0); return buffer; } public FloatBuffer bufferUtil(float[] arr){ FloatBuffer buffer; ByteBuffer byteBuffer = ByteBuffer.allocateDirect(arr.length * 4); byteBuffer.order(ByteOrder.nativeOrder()); buffer = byteBuffer.asFloatBuffer(); buffer.put(arr); buffer.position(0); return buffer; }
修改之后,运行成功。
0 0
- Bug: Application called a GL11 Pointer method with an indirect Buffer
- Indirect Computing Model with Indirect Formal Method
- An empty string called split method to return a string array whose length equals 1.
- Bug-JNI: JNI DETECTED ERROR IN APPLICATION: JNI CallVoidMethodV called with pending exception 'java.
- TypeError: unbound method a() must be called with A instance as first argument (got nothing instead)
- REFLECTION ON A METHOD WITH AN OUT PARAMETER
- A new method to develop with ajax application
- 如何获取app access_token(针对这样的错误This method must be called with an app access_token.)
- Generic detail view DetailView must be called with either an object pk or a slug.
- returns a number of second with no user activity (called in an OnTimer event of a TTimer component).
- 【BUG】 "SetDestination" can only be called on an active agent that has been placed on a NavMesh.
- Android Application class method onCreate being called multiple times
- Using a Service Locator to Work with MessageBoxes in an MVVM Application
- a function return a pointer , wherein a bug
- Unity中BUG:SetDestination can only be called on an active agent that has been placed on a navmesh 的处理
- A pointer to an object & A pointer one past the end of a different object
- An Dojo sample application with Eclipse
- Lotusscript opens an attachment with associated application
- Log4j.properties配置详解
- 出租车GPS轨迹数据和手机数据的研究价值
- jedis调用redis之String数据Key-Value
- 离开微软这两年
- linux基础教程--安装Android SDK
- Bug: Application called a GL11 Pointer method with an indirect Buffer
- oracle不记得所有账户和密码怎么办 ?回车出现一个2
- Android开发小知识-BroadCastReceiver的使用
- BZOJ 3110 [Zjoi2013]K大数查询
- 构建高效安全的Nginx Web服务器
- MySQL 调编码
- 动画入门
- 软件盘输入法窗口
- JAVA利用HttpClient进行POST请求(HTTPS)