I have a test code below:
glGenBuffers(1, &buf); glBindBuffer(GL_PIXEL_UNPACK_BUFFER, buf); check_error(__FILE__, __LINE__); glBufferData(GL_PIXEL_UNPACK_BUFFER, render_width * render_height*4, yuvdata, GL_STREAM_DRAW); check_error(__FILE__, __LINE__); GLubyte* ptr = (GLubyte*)glMapBufferRange(GL_PIXEL_UNPACK_BUFFER, 0, render_width * render_height * 4, GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT ); check_error(__FILE__, __LINE__); if (ptr) { // update data directly on the mapped buffer updatePixels(ptr, render_width * render_height * 4); glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER); // release pointer to mapping buffer }
It works well by the emulator when I chose 3.0 and 3.1.
while I change to include the gl32.h, compile is ok, but will crash because the ptr cannot write and read after map.
I don't know why. no error when check, just crash when update pixel.
Hi peter:
thanks for reply, can you give more information about the ANGLE, dose it depend on android?
I'm a new to this, I want to learn the mali gpu on a embedded linux system.