Hello there
Non-direct buffers exist within the java heap space, and thus may be
shuffled around by the garbage collector to reduce fragmentation.
OpenGL may try and use data from the buffers that you pass in at any
time - if the buffer has been moved since you passed its address to
OpenGL then you'll be reading data from an invalid location.
Direct buffers are allocated outside of the java heap, and thus do not
move around.
For opengl use, always allocate buffers like so
FloatBuffer fb =
ByteBuffer.allocateDirect( size ).order( ByteBuffer.nativeOrder() ).asFloatBuffer();
Also be aware of the performance issue in
http://code.google.com/p/android/issues/detail?id=11078
Ryan
On Jan 6, 5:13 am, kong <zfr...
@gmail.com> wrote:
|
I ended up using the syntax specified by RyanMcNally, using
"ByteOrder.nativeOrder()" instead of ByteBuffer.nativeOrder()
e.g.
sphereVertex =
ByteBuffer.allocateDirect( 400000 ).order(
ByteOrder.nativeOrder() ).asFloatBuffer();
This was after I found a workable syntax elsewhere with the statements
broken out like this (sphereVertex was previously defined as a FloatBuffer):
ByteBuffer vbb = ByteBuffer.allocateDirect(400000);
vbb.order(ByteOrder.nativeOrder());
sphereVertex = vbb.asFloatBuffer();
When that worked I took a closer look at the condensed syntax and made the
one change to ByteOrder and that worked too.
|
分享到:
相关推荐
NULL 博文链接:https://xienan123.iteye.com/blog/1042124
NULL 博文链接:https://listen-raining.iteye.com/blog/2087518
java.lang.IllegalArgumentException Cannot format given Object as a Date
Caused by: java.lang.IllegalArgumentException: input == null! at javax.imageio.ImageIO.read(ImageIO.java:1388) at com.pleanwar.fiying.FlyingObject.loadImage(FlyingObject.java:52) at ...
NULL 博文链接:https://denghuijia1314521-gmail-com.iteye.com/blog/1341258
链接is unknown to this NavController
NULL 博文链接:https://wxb-j2ee.iteye.com/blog/1183736
主要介绍了IDEA 中使用 ECJ 编译出现 java.lang.IllegalArgumentException问题 ,本文内容简短给大家介绍的好,需要的朋友可以参考下
解决在Linux系统下,POI、easyExcel 报错 java.lang.IllegalArgumentException: The workbook already contains a sheet named。原因是缺少了字体文件,如果是Docker部署使用本资源即可。内部提供字体资源以及代码...
对接微信接口中因为jdk8解密长度不够 报错 java.security.InvalidKeyException: Illegal key size 替换路径:(记得备份原有的文件) C:\Program Files\Java\jdk1.8.0_131\jre\lib\security
两天因为项目需要整合spring、struts2、mybatis三大框架,但启动的时候总出现这个错误,困扰我好久,折腾了好久终于找到问题根源,下面小编给大家分享下问题所在及解决办法,一起看看吧
复制并覆盖%JAVA_HOME%/jre/lib/security下的local_policy.jar 和 US_export_policy.jar
Java demo源码 398.java.lang.IllegalArgumentException- 398.java.lang.IllegalArgumentException 复现bug demo 源码
SpringBoot 整合 MyBatis。解决因Mybatis-Spring版本过高引起的“Caused by: java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required”异常
主要介绍了 Java java.lang.ExceptionInInitializerError 错误如何解决的相关资料,需要的朋友可以参考下
今天小编就为大家分享一篇关于Java上传文件错误java.lang.NoSuchMethodException的解决办法,小编觉得内容挺不错的,现在分享给大家,具有很好的参考价值,需要的朋友一起跟随小编来看看吧
### Cause: java.lang.IllegalArgumentException: jdbcUrl is required with driverClassName. at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:...
Java源码非法访问异常IllegalArgumentException
在通过接口setComponentEnabledSetting,设置android组件可用或者不可用的时候,如果刚刚设置完成后,立即交流看关机,发现开机后本次设置并没有被保存。本文详细的分析了这个问题。
java.lang.IllegalArgumentException: System memory 259522560 must be at least 471859200. Please increase heap size using the --driver-memory option or spark.driver.memory in Spark configuration.at.org....