Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception running VBO sample in SpriteMethodTest #50

Closed
GoogleCodeExporter opened this issue Feb 10, 2016 · 4 comments
Closed

Exception running VBO sample in SpriteMethodTest #50

GoogleCodeExporter opened this issue Feb 10, 2016 · 4 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Launch SpriteMethodTest
2. Select OpenGL ES -> Use VBO Extension

What is the expected output? What do you see instead?

Expected sprite test to run, instead received the following in LogCat:

Uncaught handler: thread GLThread exiting due to uncaught exception
java.lang.IllegalArgumentException: remaining() < size
    at com.google.android.gles_jni.GLImpl.glBufferData(Native Method)
    at 
com.android.spritemethodtest.Grid.generateHardwareBuffers(Grid.java:231)
    at 
com.android.spritemethodtest.SimpleGLRenderer.surfaceCreated(SimpleGLRender
er.java:192)
    at 
com.android.spritemethodtest.GLSurfaceView$GLThread.guardedRun(GLSurfaceVie
w.java:403)
    at 
com.android.spritemethodtest.GLSurfaceView$GLThread.run(GLSurfaceView.java:
337)

What version of the product are you using? On what operating system?

Running on Android Emulator
OS: Windows 7
Eclipse: 3.5.1 (Eclipse IDE for Java Developers Build id: 20090920-1017)
Android SDK: 2.0.1

Tested on 1.5, 1.6, 2.0 and 2.0.1 emulated devices

Original issue reported on code.google.com by jason.po...@gmail.com on 28 Dec 2009 at 9:00

@GoogleCodeExporter
Copy link
Author

The attached SVN patch resolves the issue for me:


Original comment by jason.po...@gmail.com on 28 Dec 2009 at 9:14

Attachments:

@GoogleCodeExporter
Copy link
Author

FYI:

Grid class uses:

final int vertexSize = mVertexBuffer.capacity() * Float.SIZE;

and

final int texCoordSize = mTexCoordBuffer.capacity() * Float.SIZE;

Should be:

final int vertexSize = mVertexBuffer.capacity() * 4;

and

final int texCoordSize = mTexCoordBuffer.capacity() * 4;

Float.SIZE resolves to 32

Original comment by jason.po...@gmail.com on 28 Dec 2009 at 9:16

@GoogleCodeExporter
Copy link
Author

Indeed.  Fixed.

Original comment by sm0a...@gmail.com on 19 Jan 2010 at 5:05

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

you get the 32 because it is in bits not in bytes...
Float.SIZE/Byte.SIZE does the trick,
writing 4 is more hardcoded...

Original comment by DA0.1428...@gmail.com on 29 Dec 2012 at 4:23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant