class_docstr: Base class for render buffer object
  
  A render buffer can be in color, depth or stencil format. If this
  format is not specified, it is set when attached to the FrameBuffer.
  
  Parameters
  ----------
  shape : tuple
      The shape of the render buffer.
  format : {None, 'color', 'depth', 'stencil'}
      The format of the render buffer. See resize.
  resizeable : bool
      Indicates whether texture can be resized
class_docstr_tok: ["Base","class","for","render","buffer","object","A","render","buffer","can","be","in","color",",","depth","or","stencil","format",".","If","this","format","is","not","specified",",","it","is","set","when","attached","to","the","FrameBuffer",".","Parameters","--","--","--","--","--","shape",":","tuple","The","shape","of","the","render","buffer",".","format",":","{","None",",","'color","'",",","'depth","'",",","'stencil","'","}","The","format","of","the","render","buffer",".","See","resize",".","resizeable",":","bool","Indicates","whether","texture","can","be","resized"]
docstr: Set the render-buffer size and format
  
  Parameters
  ----------
  shape : tuple of integers
      New shape in yx order. A render buffer is always 2D. For
      symmetry with the texture class, a 3-element tuple can also
      be given, in which case the last dimension is ignored.
  format : {None, 'color', 'depth', 'stencil'}
      The buffer format. If None, the current format is maintained.
      If that is also None, the format will be set upon attaching
      it to a framebuffer. One can also specify the explicit enum:
      GL_RGB565, GL_RGBA4, GL_RGB5_A1, GL_DEPTH_COMPONENT16, or
      GL_STENCIL_INDEX8
docstr_tok: ["Set","the","render-buffer","size","and","format","Parameters","--","--","--","--","--","shape",":","tuple","of","integers","New","shape","in","yx","order",".","A","render","buffer","is","always","2D",".","For","symmetry","with","the","texture","class",",","a","3-element","tuple","can","also","be","given",",","in","which","case","the","last","dimension","is","ignored",".","format",":","{","None",",","'color","'",",","'depth","'",",","'stencil","'","}","The","buffer","format",".","If","None",",","the","current","format","is","maintained",".","If","that","is","also","None",",","the","format","will","be","set","upon","attaching","it","to","a","framebuffer",".","One","can","also","specify","the","explicit","enum",":","GL_RGB565",",","GL_RGBA4",",","GL_RGB5_A1",",","GL_DEPTH_COMPONENT16",",","or","GL_STENCIL_INDEX8"]
code: def resize(self, shape, format=None):
      """Set the render-buffer size and format
  
      Parameters
      ----------
      shape : tuple of integers
          New shape in yx order. A render buffer is always 2D. For
          symmetry with the texture class, a 3-element tuple can also
          be given, in which case the last dimension is ignored.
      format : {None, 'color', 'depth', 'stencil'}
          The buffer format. If None, the current format is maintained.
          If that is also None, the format will be set upon attaching
          it to a framebuffer. One can also specify the explicit enum:
          GL_RGB565, GL_RGBA4, GL_RGB5_A1, GL_DEPTH_COMPONENT16, or
          GL_STENCIL_INDEX8
      """
      if not self._resizeable:
          raise RuntimeError("RenderBuffer is not resizeable")
      # Check shape
      if not (isinstance(shape, tuple) and len(shape) in (2, 3)):
          raise ValueError(
              "RenderBuffer shape must be a 2/3 element tuple"
          )
      # Check format
      if format is None:
          format = self._format  # Use current format (may be None)
      elif isinstance(format, int):
          pass  # Do not check, maybe user needs desktop GL formats
      elif isinstance(format, str):
          if format not in ("color", "depth", "stencil"):
              raise ValueError(
                  'RenderBuffer format must be "color", "depth"'
                  ' or "stencil", not %r' % format
              )
      else:
          raise ValueError("Invalid RenderBuffer format: %r" % format)
  
      # Store and send GLIR command
      self._shape = tuple(shape[:2])
      self._format = format
      if self._format is not None:
          self._glir.command(
              "SIZE", self._id, self._shape, self._format
          )
  
imports: from .globject import GLObject
  from .texture import Texture2D
  from .wrappers import _check_valid, read_pixels
  from .context import get_current_canvas
label_desc: Use image node_id 4 for calling the RenderBuffer obj's underlying member method code with example usage: obj.resize(shape, format) without return types