Brian Beuken
Posts: 221
Joined: Fri Jan 29, 2016 12:51 pm

problems with glMapBufferOES

Sat Feb 13, 2016 1:26 am

Hi
I'm having some strange issues with glMapBufferOES
my command

Code: Select all

	framedata = (unsigned char*)glMapBufferOES(GL_ARRAY_BUFFER, GL_WRITE_ONLY_OES);
always returns null, I do know that glMapBufferOES is an extension and I have checked that there is a proc address for it,

Code: Select all

glMapBuffer  =  (PFNGLMAPBUFFEROESPROC)eglGetProcAddress("glMapBufferOES");
which returned a value.. but whether I call it via a proc address or direct, the framedata is never set and I cannot proceed!

Anyone know why? Am I missing an init step somewhere? I have the bcm_host_init(); at the start of my code which should fire up all the BCM specific stuff?
Very old computer game programmer, now teaching very young computer game programmers, some very bad habits.
Wrote some book about coding Pi's and SBC's, it's out now...go get it!
http://www.scratchpadgames.net/

Brian Beuken
Posts: 221
Joined: Fri Jan 29, 2016 12:51 pm

Re: problems with glMapBufferOES

Sat Feb 13, 2016 5:05 am

to partially answer my own questions, I tracked this down to a problem with the way the buffers are created

Code: Select all

	glBufferData(GL_ARRAY_BUFFER, sizeMemory, NULL, GL_STREAM_DRAW);
seems to prevent glMapBufferOES from working
but

Code: Select all

	glBufferData(GL_ARRAY_BUFFER, sizeMemory, NULL, GL_DYNAMIC_DRAW);
allows it...I've not got my code up and running yet to see what impact Dynamic has over stream though.
There is some comments on line that suggest stream_draw may have a bug in it.
Very old computer game programmer, now teaching very young computer game programmers, some very bad habits.
Wrote some book about coding Pi's and SBC's, it's out now...go get it!
http://www.scratchpadgames.net/

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26442
Joined: Sat Jul 30, 2011 7:41 pm

Re: problems with glMapBufferOES

Mon Feb 15, 2016 3:16 pm

Has this been reported on the RPF's github?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

Brian Beuken
Posts: 221
Joined: Fri Jan 29, 2016 12:51 pm

Re: problems with glMapBufferOES

Tue Feb 16, 2016 10:51 am

not sure.. I just stumbled on it, and it took quite some googling to find any reference to any issues, but it appears to relate to broadcom drivers rather than OGLES itself
Very old computer game programmer, now teaching very young computer game programmers, some very bad habits.
Wrote some book about coding Pi's and SBC's, it's out now...go get it!
http://www.scratchpadgames.net/

Return to “OpenGLES”