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
  • FBO    xtlang
  • FBO    xtlang
  • FBO    xtlang
  • FBO    xtlang
  • FBO    xtlang
  • FBO_color_texture    xtlang
  • FBO_create    xtlang
  • FBO_create_with_textures    xtlang
  • FBO_depth_texture    xtlang
  • FBO_height    xtlang
  • FBO_id    xtlang
  • FBO_width    xtlang
  • Rectangle    xtlang
  • Rectangle    xtlang
  • ShaderProgram_create    xtlang
  • ShaderProgram_create    xtlang
  • ShaderProgram_create    xtlang
  • ShaderProgram_create    xtlang
  • Shader_create    xtlang
  • Texture_create    xtlang
  • Texture_create_FBO_depth_texture    xtlang
  • VAO_create    xtlang
  • VAO_create_ss_quad    xtlang
  • VBO_create    xtlang
  • VBO_create    xtlang
  • VBO_create    xtlang
  • VBO_create    xtlang
  • apr_pool_create    xtlang
  • apr_pool_create    xtlang
  • cerberus_create_lfos    xtlang
  • create-zone    scheme
  • create-zone1    xtlang
  • create-zone2    xtlang
  • create_arrows_shader    xtlang
  • create_data    xtlang
  • create_fbo    xtlang
  • create_fbo_no_depth    xtlang
  • create_fbo_no_depth_rect    xtlang
  • create_heatmap_shader    xtlang
  • create_particles_shader    xtlang
  • create_points_shader    xtlang
  • create_post_process_shader    xtlang
  • create_raymarcher_shader    xtlang
  • create_shader    xtlang
  • create_shader_xtm    xtlang
  • create_shadertoy_shader    xtlang
  • create_texture_shader    xtlang
  • create_triangle_shader    xtlang
  • create_triangle_shader    xtlang
  • create_vbo    xtlang
  • create_walker_array    xtlang
  • fbo_create_depth_buffer    xtlang
  • fbo_create_depth_buffer_rect    xtlang
  • fbo_create_texture    xtlang
  • fbo_create_texture_rect    xtlang
  • fill_direction_vector    xtlang
  • fill_direction_vector    xtlang
  • fluid-cube-create    xtlang
  • fluid-cube-create    xtlang
  • fluid_cube_create    xtlang
  • get-fbo    xtlang
  • get-fbo    xtlang
  • gl_load_image_rect    xtlang
  • gl_load_tex_rect    xtlang
  • gl_tex_height_rect    xtlang
  • gl_tex_width_rect    xtlang
  • glfw_create_fullscreen_interaction_window    xtlang
  • glfw_create_fullscreen_interaction_window    xtlang
  • glfw_create_fullscreen_window    xtlang
  • glfw_create_fullscreen_window    xtlang
  • glfw_create_interaction_window    xtlang
  • glfw_create_window    xtlang
  • glfw_init_and_create_compatibility_window    xtlang
  • glfw_init_and_create_fullscreen_compatibility_window    xtlang
  • glfw_init_and_create_fullscreen_interaction_compatibility_window    xtlang
  • glfw_init_and_create_fullscreen_interaction_window    xtlang
  • glfw_init_and_create_fullscreen_interaction_window    xtlang
  • glfw_init_and_create_fullscreen_window    xtlang
  • glfw_init_and_create_fullscreen_window    xtlang
  • glfw_init_and_create_interaction_compatibility_window    xtlang
  • glfw_init_and_create_interaction_window    xtlang
  • glfw_init_and_create_window    xtlang
  • godot_variant_new_rect2    xtlang
  • gui_draw_rect    xtlang
  • half_rectangular_window_func    xtlang
  • half_rectangular_window_func2    xtlang
  • impc:ir:compile:create_zone    scheme
  • impc:ti:create-scheme-wrapper    scheme
  • impc:ti:create-scm-wrapper?    scheme
  • impc:ti:create_zone-check    scheme
  • nnsock_create    xtlang
  • nnsock_create    xtlang
  • nvg_create_context    xtlang
  • nvg_create_font    xtlang
  • ocv_rectangle    xtlang
  • pa_create_default_stream    xtlang
  • pa_create_stream    xtlang
  • pm_create_input_stream    xtlang
  • pm_create_output_stream    xtlang
  • psystem_create    xtlang
  • psystem_create    xtlang
  • qr_create_l    xtlang
  • qr_create_with_level    xtlang
  • rados-pool-create    xtlang
  • rect    macro
  • rectangular_window_func    xtlang
  • rectr    macro
  • world_create    xtlang
  • xtm-vg-create-context    scheme
  • xtm_add_rect    xtlang
  • xtm_add_rect    xtlang
  • xtm_add_rect    xtlang
  • xtm_add_rectd    xtlang
  • xtm_add_round_rect    xtlang
  • xtm_add_round_rectd    xtlang
  • xtm_add_rounded_rect    xtlang
  • xtm_add_rounded_rect    xtlang
  • xtm_add_rounded_rect_varying    xtlang
  • xtm_add_rounded_rect_varying    xtlang
  • xtm_create_path    xtlang
  • xtm_create_vgimage    xtlang
  • xtm_draw_rect    xtlang
  • xtm_draw_rect_fill    xtlang
  • xtm_draw_rect_fill    xtlang
  • xtm_draw_rect_fill    xtlang
  • xtm_draw_rect_fill    xtlang
  • xtm_draw_rect_stroke    xtlang
  • xtm_draw_rect_stroke    xtlang
  • xtm_draw_rect_stroke    xtlang
  • xtm_draw_rect_stroke    xtlang
  • xtm_draw_rectd    xtlang
  • xtm_draw_round_rect    xtlang
  • xtm_draw_round_rectd    xtlang
  • xtm_draw_rounded_rect_fill    xtlang
  • xtm_draw_rounded_rect_fill    xtlang
  • xtm_draw_rounded_rect_fill    xtlang
  • xtm_draw_rounded_rect_fill    xtlang
  • xtm_draw_rounded_rect_stroke    xtlang
  • xtm_draw_rounded_rect_stroke    xtlang
  • xtm_draw_rounded_rect_stroke    xtlang
  • xtm_draw_rounded_rect_stroke    xtlang
  • xtm_draw_rounded_rect_varying_fill    xtlang
  • xtm_draw_rounded_rect_varying_fill    xtlang
  • xtm_draw_rounded_rect_varying_fill    xtlang
  • xtm_draw_rounded_rect_varying_fill    xtlang
  • xtm_draw_rounded_rect_varying_stroke    xtlang
  • xtm_draw_rounded_rect_varying_stroke    xtlang
  • xtm_draw_rounded_rect_varying_stroke    xtlang
  • xtm_draw_rounded_rect_varying_stroke    xtlang
  • xtm_render_fbo    xtlang
  • xtm_shadow_fbo    xtlang
  • xtm_vg_clear_rect    xtlang
  • xtm_vg_create_contextf    xtlang
  • xtm_vg_create_contexti32    xtlang