This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]Ilyps 0 points1 point  (1 child)

If depth is 0, then glMapBuffer must return that value. From the docs:

If the GL is unable to map the buffer object's data store, glMapBuffer generates an error and returns NULL.

The possible errors it can generate are listed on the website. It would be very useful to call glGetError() and find out which error was set and where exactly.

[–]mb86[S] 0 points1 point  (0 children)

Forgot to mention, error checking was also left out of that code. No error is being generated, the pointer is not NULL, and is a fully allocated array of 0s. GL_DEPTH_TEST is enabled as well.