code: def _test_fbo():
      w, h = 120, 130
  
      # Create frame buffer
      hframebuf = gl.glCreateFramebuffer()
      gl.glBindFramebuffer(gl.GL_FRAMEBUFFER, hframebuf)
  
      # Create render buffer (for depth)
      hrenderbuf = gl.glCreateRenderbuffer()
      gl.glBindRenderbuffer(gl.GL_RENDERBUFFER, hrenderbuf)
      gl.glRenderbufferStorage(
          gl.GL_RENDERBUFFER, gl.GL_DEPTH_COMPONENT16, w, h
      )
      gl.glFramebufferRenderbuffer(
          gl.GL_FRAMEBUFFER,
          gl.GL_DEPTH_ATTACHMENT,
          gl.GL_RENDERBUFFER,
          hrenderbuf,
      )
  
      # Create texture (for color)
      htex = gl.glCreateTexture()
      gl.glBindTexture(gl.GL_TEXTURE_2D, htex)
      gl.glTexImage2D(
          gl.GL_TEXTURE_2D,
          0,
          gl.GL_RGB,
          gl.GL_RGB,
          gl.GL_UNSIGNED_BYTE,
          (h, w),
      )
      gl.glFramebufferTexture2D(
          gl.GL_FRAMEBUFFER,
          gl.GL_COLOR_ATTACHMENT0,
          gl.GL_TEXTURE_2D,
          htex,
          0,
      )
  
      # Check framebuffer status
      status = gl.glCheckFramebufferStatus(gl.GL_FRAMEBUFFER)
      assert_equal(status, gl.GL_FRAMEBUFFER_COMPLETE)
  
      # Tests renderbuffer params
      name = gl.glGetFramebufferAttachmentParameter(
          gl.GL_FRAMEBUFFER,
          gl.GL_DEPTH_ATTACHMENT,
          gl.GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME,
      )
      assert_equal(name, hrenderbuf)
      #
      width = gl.glGetRenderbufferParameter(
          gl.GL_RENDERBUFFER, gl.GL_RENDERBUFFER_WIDTH
      )
      assert_equal(width, w)
  
      # Touch copy tex functions
      gl.glBindTexture(gl.GL_TEXTURE_2D, htex)
      gl.glCopyTexSubImage2D(gl.GL_TEXTURE_2D, 0, 5, 5, 5, 5, 20, 20)
      gl.glCopyTexImage2D(
          gl.GL_TEXTURE_2D, 0, gl.GL_RGB, 0, 0, 30, 30, 0
      )
  
      gl.check_error()
  
      # Clean up
      gl.glDeleteTexture(htex)
      gl.glDeleteRenderbuffer(hrenderbuf)
      gl.glDeleteFramebuffer(hframebuf)
  
      gl.check_error()
  
file_path: vispy/vispy/gloo/gl/tests/test_basics.py
imports: import sys
  from vispy.app import Canvas
  from numpy.testing import assert_almost_equal
  from vispy.testing import requires_application, requires_pyopengl, SkipTest, run_tests_if_main, assert_equal, assert_true
  from vispy.util import use_log_level
  from vispy.gloo import gl
label_desc: Use image node_id 11 for calling a global function with example usage: _test_fbo() without return types