Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

glGenTextures with zero textures

Tags:

zero

opengl

Simple question: What happens when I call glGenTextures(0, someptr);, generating zero textures? I have a function which generates textures based on a number given by a parameter, which may be 0. I did not find anything in the OpenGL reference pages, Google or StackOverflow. Is it completely undefined (not even defined as undefined behaviour) and therefore dependent on the driver?

like image 303
Kapichu Avatar asked Sep 30 '22 02:09

Kapichu


1 Answers

I'd be likely just to take the spec at its literal word and assume that the function will "return 0 previously unused texture names in [the array pointed to by the second parameter]". Making it a no-op, in effect.

like image 96
Tommy Avatar answered Oct 04 '22 19:10

Tommy