glMapBufferOES returns null, but no error is generated

887 views
Skip to first unread message

Mohs3n

unread,
Jan 25, 2011, 2:31:29 AM1/25/11
to android-ndk
Hi,
I'm trying to implement a game using ndk. I use glMapBufferOES to
update buffer data. However, the function returns NULL and 0 is
returned by glGetError(which means no error is generated by opengl).
Could this be a bug? Has anyone been able to use this function?

alan

unread,
Jan 25, 2011, 5:38:49 AM1/25/11
to andro...@googlegroups.com
glMapBufferOES is an extension, have you checked your devices extension support? i believe that if you call an unsupported extension there are no guarantees of the behaviour (will probably just crash instantly)

Mohs3n

unread,
Jan 25, 2011, 9:03:57 AM1/25/11
to android-ndk
Thanks for your reply,
Is there any way to check if an extension is supported during run-time?

alan

unread,
Jan 25, 2011, 9:20:54 AM1/25/11
to andro...@googlegroups.com
yes using the standard opengl extension mechanism:
glGetString(GL_EXTENSIONS)

Mohs3n

unread,
Jan 26, 2011, 3:49:30 AM1/26/11
to android-ndk
Yeah. It's not supported. The problem was that I thought glMapBuffer
is included in vertex_buffer_object extension (which is on pc version
of opengl). But, on opengl es it's in a different extension called
GL_OES_mapbuffer.

Ferm

unread,
Mar 5, 2011, 8:25:49 AM3/5/11
to android-ndk
Hello

I have also run into this now trying to port a game from iPhone. Using
nexus one, which does not have the GL_OES_mapbuffer extension, it
returns NULL.

How do you get around this?

Thank you for any pointers.

Louise Cypher

unread,
Mar 5, 2011, 2:09:03 PM3/5/11
to andro...@googlegroups.com
just dont use glMapBuffer ... ;)

nexus one (and the whole snapdragon family) is very tricky with dynamic buffers, since the glBufferSubData call is enormously _slow_ and instead you need to use glBufferData witch is counter-intuitive and
have very bad performance on hummingbird processors (galaxy/galaxy tab) (but they support glMapBuffer)
so basically you need some abstraction layer around your index/vertex buffers to pack all this and tetect whatever you are on adreno or on sgx

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.




--
--
Code it black!
Reply all
Reply to author
Forward
0 new messages