create_fbo_rect   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/external/opengl.xtm

Implementation

;; create and return a frame buffer struct (E_fbo)
;; if _texid is greater than 0 then use existing _texid
(bind-func create_fbo_rect
  (lambda (width:i32 height:i32 _texid:i32 _depthid:i32)
    (let ((texid:i32 0)
    (depthid:i32 0)
    (fboid:i32* (salloc))
    (fbo:E_fbo* (halloc))) ;; heap alloc
      (glGenFramebuffers 1 fboid)
      ;; bind the fbo
      (glBindFramebuffer GL_FRAMEBUFFER (pref fboid 0))
      (if (> _texid 0) (set! texid _texid))
      (if (> _depthid 0) (set! depthid _depthid))
      (set! texid (fbo_create_texture_rect width height))
      (set! depthid (fbo_create_depth_buffer_rect width height))
      ;; Attach the texture texid to the color buffer of our fbo
      (glFramebufferTexture2D GL_FRAMEBUFFER GL_COLOR_ATTACHMENT0 GL_TEXTURE_RECTANGLE_ARB texid 0)
      ;; Attach the texture depthid to the depth buffer of our fbo
      (glFramebufferTexture2D GL_FRAMEBUFFER GL_DEPTH_ATTACHMENT GL_TEXTURE_RECTANGLE_ARB depthid 0)
      (tfill! fbo (pref fboid 0) texid depthid width height)
      (let ((status:i32 (glCheckFramebufferStatus GL_FRAMEBUFFER)))
  (if (<> status GL_FRAMEBUFFER_COMPLETE)
      (set! fbo (cast null E_fbo*))))
      (glClearColor 0.0 1.0 0.0 1.0)
      (glClear (+ GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT))
      ;; unbind the frame buffer
      (glBindFramebuffer GL_FRAMEBUFFER 0)
      ;; return the extfbo struct
      fbo)))


Back to Index

Similar Entries

  • Crect    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/gsl.xtm
  • FBO    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm
  • FBO    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm
  • FBO    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm
  • FBO    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm
  • FBO    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm
  • FBO_color_texture    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • FBO_create    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • FBO_create_with_textures    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • FBO_depth_texture    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • FBO_height    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • FBO_id    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • FBO_width    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • Rectangle    xtlang    /digego/extempore/tree/v0.8.9/tests/core/generics.xtm
  • Rectangle    xtlang    /digego/extempore/tree/v0.8.9/tests/core/generics.xtm
  • ShaderProgram_create    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • ShaderProgram_create    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • ShaderProgram_create    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • ShaderProgram_create    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • Shader_create    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • Texture_create    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • Texture_create_FBO_depth_texture    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • VAO_create    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • VAO_create_ss_quad    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • VBO_create    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • VBO_create    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • VBO_create    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • VBO_create    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • apr_pool_create    xtlang    /digego/extempore/tree/v0.8.9/libs/external/apr.xtm
  • apr_pool_create    xtlang    /digego/extempore/tree/v0.8.9/libs/external/apr.xtm
  • cerberus_create_lfos    xtlang    /digego/extempore/tree/v0.8.9/libs/core/instruments/cerberus.xtm
  • create-zone    scheme    /digego/extempore/tree/v0.8.9/libs/contrib/xtmcv.xtm
  • create-zone1    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/xtmcv.xtm
  • create-zone2    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/xtmcv.xtm
  • create_arrows_shader    xtlang    /digego/extempore/tree/v0.8.9/examples/external/shader-tutorials/arrows.xtm
  • create_data    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm
  • create_fbo    xtlang    /digego/extempore/tree/v0.8.9/libs/external/opengl.xtm
  • create_fbo_no_depth    xtlang    /digego/extempore/tree/v0.8.9/libs/external/opengl.xtm
  • create_fbo_no_depth_rect    xtlang    /digego/extempore/tree/v0.8.9/libs/external/opengl.xtm
  • create_heatmap_shader    xtlang    /digego/extempore/tree/v0.8.9/examples/external/shader-tutorials/heatmap.xtm
  • create_particles_shader    xtlang    /digego/extempore/tree/v0.8.9/examples/external/shader-tutorials/particles.xtm
  • create_points_shader    xtlang    /digego/extempore/tree/v0.8.9/examples/external/shader-tutorials/points.xtm
  • create_post_process_shader    xtlang    /digego/extempore/tree/v0.8.9/examples/external/shader-tutorials/framebuffer.xtm
  • create_raymarcher_shader    xtlang    /digego/extempore/tree/v0.8.9/examples/external/raymarcher.xtm
  • create_shader    xtlang    /digego/extempore/tree/v0.8.9/libs/external/opengl.xtm
  • create_shader_xtm    xtlang    /digego/extempore/tree/v0.8.9/libs/external/opengl.xtm
  • create_shadertoy_shader    xtlang    /digego/extempore/tree/v0.8.9/examples/external/shader-tutorials/shadertoy.xtm
  • create_texture_shader    xtlang    /digego/extempore/tree/v0.8.9/examples/external/shader-tutorials/texture.xtm
  • create_triangle_shader    xtlang    /digego/extempore/tree/v0.8.9/examples/external/shader-tutorials/simple-triangle.xtm
  • create_triangle_shader    xtlang    /digego/extempore/tree/v0.8.9/examples/external/shader-tutorials/framebuffer.xtm
  • create_vbo    xtlang    /digego/extempore/tree/v0.8.9/libs/external/opengl.xtm
  • create_walker_array    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/mpi/random-walk.xtm
  • fbo_create_depth_buffer    xtlang    /digego/extempore/tree/v0.8.9/libs/external/opengl.xtm
  • fbo_create_depth_buffer_rect    xtlang    /digego/extempore/tree/v0.8.9/libs/external/opengl.xtm
  • fbo_create_texture    xtlang    /digego/extempore/tree/v0.8.9/libs/external/opengl.xtm
  • fbo_create_texture_rect    xtlang    /digego/extempore/tree/v0.8.9/libs/external/opengl.xtm
  • fill_direction_vector    xtlang    /digego/extempore/tree/v0.8.9/libs/external/opengl.xtm
  • fill_direction_vector    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • fluid-cube-create    xtlang    /digego/extempore/tree/v0.8.9/libs/external/fluid2d.xtm
  • fluid-cube-create    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/fluid_dynamics.xtm
  • fluid_cube_create    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/fluids_2d.xtm
  • get-fbo    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/shadowmap.xtm
  • get-fbo    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/multilight.xtm
  • gl_load_image_rect    xtlang    /digego/extempore/tree/v0.8.9/libs/external/soil.xtm
  • gl_load_tex_rect    xtlang    /digego/extempore/tree/v0.8.9/libs/external/soil.xtm
  • gl_tex_height_rect    xtlang    /digego/extempore/tree/v0.8.9/libs/external/soil.xtm
  • gl_tex_width_rect    xtlang    /digego/extempore/tree/v0.8.9/libs/external/soil.xtm
  • glfw_create_fullscreen_interaction_window    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glfw3.xtm
  • glfw_create_fullscreen_interaction_window    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glfw3.xtm
  • glfw_create_fullscreen_window    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glfw3.xtm
  • glfw_create_fullscreen_window    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glfw3.xtm
  • glfw_create_interaction_window    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glfw3.xtm
  • glfw_create_window    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glfw3.xtm
  • glfw_init_and_create_compatibility_window    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glfw3.xtm
  • glfw_init_and_create_fullscreen_compatibility_window    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glfw3.xtm
  • glfw_init_and_create_fullscreen_interaction_compatibility_window    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glfw3.xtm
  • glfw_init_and_create_fullscreen_interaction_window    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glfw3.xtm
  • glfw_init_and_create_fullscreen_interaction_window    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glfw3.xtm
  • glfw_init_and_create_fullscreen_window    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glfw3.xtm
  • glfw_init_and_create_fullscreen_window    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glfw3.xtm
  • glfw_init_and_create_interaction_compatibility_window    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glfw3.xtm
  • glfw_init_and_create_interaction_window    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glfw3.xtm
  • glfw_init_and_create_window    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glfw3.xtm
  • godot_variant_new_rect2    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libgodot.xtm
  • gui_draw_rect    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • half_rectangular_window_func    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/TSM_library.xtm
  • half_rectangular_window_func2    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/TSM_library.xtm
  • impc:ir:compile:create_zone    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmir.xtm
  • impc:ti:create-scheme-wrapper    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:create-scm-wrapper?    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:create_zone-check    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • nnsock_create    xtlang    /digego/extempore/tree/v0.8.9/libs/external/nanomsg.xtm
  • nnsock_create    xtlang    /digego/extempore/tree/v0.8.9/libs/external/nanomsg.xtm
  • nvg_create_context    xtlang    /digego/extempore/tree/v0.8.9/libs/external/nanovg.xtm
  • nvg_create_font    xtlang    /digego/extempore/tree/v0.8.9/libs/external/nanovg.xtm
  • ocv_rectangle    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/xtmcv.xtm
  • pa_create_default_stream    xtlang    /digego/extempore/tree/v0.8.9/libs/external/portaudio.xtm
  • pa_create_stream    xtlang    /digego/extempore/tree/v0.8.9/libs/external/portaudio.xtm
  • pm_create_input_stream    xtlang    /digego/extempore/tree/v0.8.9/libs/external/portmidi.xtm
  • pm_create_output_stream    xtlang    /digego/extempore/tree/v0.8.9/libs/external/portmidi.xtm
  • psystem_create    xtlang    /digego/extempore/tree/v0.8.9/libs/external/particles_vbo.xtm
  • psystem_create    xtlang    /digego/extempore/tree/v0.8.9/libs/external/particles.xtm
  • qr_create_l    xtlang    /digego/extempore/tree/v0.8.9/libs/external/qr-code.xtm
  • qr_create_with_level    xtlang    /digego/extempore/tree/v0.8.9/libs/external/qr-code.xtm
  • rados-pool-create    xtlang    /digego/extempore/tree/v0.8.9/libs/external/ceph.xtm
  • rect    macro    /digego/extempore/tree/v0.8.9/runtime/scheme.xtm
  • rectangular_window_func    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/TSM_library.xtm
  • rectr    macro    /digego/extempore/tree/v0.8.9/runtime/scheme.xtm
  • world_create    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/game-of-life.xtm
  • xtm-vg-create-context    scheme    /digego/extempore/tree/v0.8.9/libs/contrib/openvg.xtm
  • xtm_add_rect    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/openvg.xtm
  • xtm_add_rect    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/nanovg_helper.xtm
  • xtm_add_rect    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/nanovg_helper.xtm
  • xtm_add_rectd    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/openvg.xtm
  • xtm_add_round_rect    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/openvg.xtm
  • xtm_add_round_rectd    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/openvg.xtm
  • xtm_add_rounded_rect    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/nanovg_helper.xtm
  • xtm_add_rounded_rect    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/nanovg_helper.xtm
  • xtm_add_rounded_rect_varying    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/nanovg_helper.xtm
  • xtm_add_rounded_rect_varying    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/nanovg_helper.xtm
  • xtm_create_path    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/openvg.xtm
  • xtm_create_vgimage    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/openvg.xtm
  • xtm_draw_rect    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/openvg.xtm
  • xtm_draw_rect_fill    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/nanovg_helper.xtm
  • xtm_draw_rect_fill    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/nanovg_helper.xtm
  • xtm_draw_rect_fill    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/nanovg_helper.xtm
  • xtm_draw_rect_fill    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/nanovg_helper.xtm
  • xtm_draw_rect_stroke    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/nanovg_helper.xtm
  • xtm_draw_rect_stroke    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/nanovg_helper.xtm
  • xtm_draw_rect_stroke    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/nanovg_helper.xtm
  • xtm_draw_rect_stroke    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/nanovg_helper.xtm
  • xtm_draw_rectd    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/openvg.xtm
  • xtm_draw_round_rect    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/openvg.xtm
  • xtm_draw_round_rectd    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/openvg.xtm
  • xtm_draw_rounded_rect_fill    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/nanovg_helper.xtm
  • xtm_draw_rounded_rect_fill    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/nanovg_helper.xtm
  • xtm_draw_rounded_rect_fill    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/nanovg_helper.xtm
  • xtm_draw_rounded_rect_fill    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/nanovg_helper.xtm
  • xtm_draw_rounded_rect_stroke    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/nanovg_helper.xtm
  • xtm_draw_rounded_rect_stroke    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/nanovg_helper.xtm
  • xtm_draw_rounded_rect_stroke    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/nanovg_helper.xtm
  • xtm_draw_rounded_rect_stroke    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/nanovg_helper.xtm
  • xtm_draw_rounded_rect_varying_fill    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/nanovg_helper.xtm
  • xtm_draw_rounded_rect_varying_fill    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/nanovg_helper.xtm
  • xtm_draw_rounded_rect_varying_fill    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/nanovg_helper.xtm
  • xtm_draw_rounded_rect_varying_fill    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/nanovg_helper.xtm
  • xtm_draw_rounded_rect_varying_stroke    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/nanovg_helper.xtm
  • xtm_draw_rounded_rect_varying_stroke    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/nanovg_helper.xtm
  • xtm_draw_rounded_rect_varying_stroke    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/nanovg_helper.xtm
  • xtm_draw_rounded_rect_varying_stroke    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/nanovg_helper.xtm
  • xtm_render_fbo    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • xtm_shadow_fbo    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • xtm_vg_clear_rect    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/openvg.xtm
  • xtm_vg_create_contextf    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/openvg.xtm
  • xtm_vg_create_contexti32    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/openvg.xtm