Ok, if i set the format parameter to GL_DEPTH_COMPONENT it works. With all other formats i tried it gives me an error.
However,
it should generate a “invalid enum” error, instead of “invalid operation”
if i specify a NULL pointer it should accept any format. I don’t want to put lots of “if internalformat = DEPTH16/24/32 then format = …” into my code, if i specify a NULL pointer anyway.
“Textures with a base internal format of DEPTH_COMPONENT require depth
component data; textures with other base internal formats require RGBA
component data. The error INVALID_OPERATION is generated if the base
internal format is DEPTH_COMPONENT and format is not DEPTH_COMPONENT,
or if the base internal format is not DEPTH_COMPONENT and format is
DEPTH_COMPONENT.”