If parameter is a 'counter', raise GL_INVALID_VALUE if value is negative

Fixes bug 10984.
This commit is contained in:
Brian 2008-02-19 08:27:08 -07:00
parent 9993ccce69
commit a52ce9de7d

View file

@ -554,6 +554,14 @@ generic_%u_byte( GLint rop, const void * ptr )
condition_list = []
for p in f.parameterIterateCounters():
condition_list.append( "%s >= 0" % (p.name) )
# 'counter' parameters cannot be negative
print " if (%s < 0) {" % p.name
print " __glXSetError(gc, GL_INVALID_VALUE);"
if f.return_type != 'void':
print " return 0;"
else:
print " return;"
print " }"
if skip_condition:
condition_list.append( skip_condition )