class_docstr: Generator for the gl2 (desktop) backend.
class_docstr_tok: ["Generator","for","the","gl2","(","desktop",")","backend","."]
code: def _add_group_function(self, des, sig, es2func):
      lines = self.lines
  
      call_line = self._native_call_line
  
      if self.define_argtypes_in_module:
          self._write_argtypes(es2func)
  
      funcname = sig.split("(", 1)[0]
      args = sig.split("(", 1)[1].split(")")[0]
  
      if des.name == "uniform":
          if funcname[-1] != "v":
              lines.append("def %s:" % sig)
              lines.append(call_line(funcname, es2func, args))
          else:
              t = {"f": "float", "i": "int"}[funcname[-2]]
              lines.append("def %s:" % sig)
              lines.append(
                  "    values = [%s(val) for val in values]" % t
              )
              lines.append(
                  "    values = (ctypes.c_%s*len(values))(*values)" % t
              )
              lines.append(
                  call_line(
                      funcname, es2func, "location, count, values"
                  )
              )
      elif des.name == "uniformMatrix":
          lines.append("def %s:" % sig)
          lines.append('    if not values.flags["C_CONTIGUOUS"]:')
          lines.append("        values = values.copy()")
          lines.append('    assert values.dtype.name == "float32"')
          lines.append("    values_ = values")
          lines.append(
              "    values = values_.ctypes.data_as(ctypes.POINTER(ctypes.c_float))"
          )
          lines.append(
              call_line(
                  funcname,
                  es2func,
                  "location, count, transpose, values",
              )
          )
      elif des.name == "vertexAttrib":
          lines.append("def %s:" % sig)
          lines.append(call_line(funcname, es2func, args))
      elif des.name == "texParameter":
          lines.append("def %s:" % sig)
          lines.append(call_line(funcname, es2func, args))
  
      else:
          raise ValueError("unknown group func")
  
imports: from __future__ import annotations
  import os
  import sys
  import headerparser
  from annotations import parse_anotations
  from OpenGL import GL
label_desc: Use image node_id 5 for calling the Gl2ApiGenerator obj's underlying member method code with example usage: obj._add_group_function(des, sig, es2func) without return types