update_cube   xtlang


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

Implementation

(bind-func update_cube
  (lambda (tex:Texture*)
    (glActiveTexture GL_TEXTURE0)
    (glBindTexture GL_TEXTURE_CUBE_MAP (id tex))
    (gl_print_error "error binding texture cube data")
    ;; front
    (glTexImage2D GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0
                  (if (= (type tex) GL_BGRA) GL_RGBA (type tex)) ;; this is internal type
                  (width tex)
                  (height tex)
                  0
                  (type tex)        ;; this is external type (i.e. conversion from external to internal required)
                  GL_UNSIGNED_BYTE
                  (pref-ptr (data tex) (* (width tex) (height tex) 4 0)))
    ;; back
    (glTexImage2D GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0
                  (if (= (type tex) GL_BGRA) GL_RGBA (type tex)) ;; this is internal type
                  (width tex)
                  (height tex)
                  0
                  (type tex)        ;; this is external type (i.e. conversion from external to internal required)
                  GL_UNSIGNED_BYTE
                  (pref-ptr (data tex) (* (width tex) (height tex) 4 1)))
    ;; top
    (glTexImage2D GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0
                  (if (= (type tex) GL_BGRA) GL_RGBA (type tex)) ;; this is internal type
                  (width tex)
                  (height tex)
                  0
                  (type tex)        ;; this is external type (i.e. conversion from external to internal required)
                  GL_UNSIGNED_BYTE
                  (pref-ptr (data tex) (* (width tex) (height tex) 4 2)))
    ;; bottom
    (glTexImage2D GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0
                  (if (= (type tex) GL_BGRA) GL_RGBA (type tex)) ;; this is internal type
                  (width tex)
                  (height tex)
                  0
                  (type tex)        ;; this is external type (i.e. conversion from external to internal required)
                  GL_UNSIGNED_BYTE
                  (pref-ptr (data tex) (* (width tex) (height tex) 4 3)))
    ;; left
    (glTexImage2D GL_TEXTURE_CUBE_MAP_POSITIVE_X 0
                  (if (= (type tex) GL_BGRA) GL_RGBA (type tex)) ;; this is internal type
                  (width tex)
                  (height tex)
                  0
                  (type tex)        ;; this is external type (i.e. conversion from external to internal required)
                  GL_UNSIGNED_BYTE
                  (pref-ptr (data tex) (* (width tex) (height tex) 4 4)))
    ;; right
    (glTexImage2D GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0
                  (if (= (type tex) GL_BGRA) GL_RGBA (type tex)) ;; this is internal type
                  (width tex)
                  (height tex)
                  0
                  (type tex)        ;; this is external type (i.e. conversion from external to internal required)
                  GL_UNSIGNED_BYTE
                  (pref-ptr (data tex) (* (width tex) (height tex) 4 5)))
    (glBindTexture GL_TEXTURE_CUBE_MAP 0)
    (gl_print_error "could not update cube!")
    void))


Back to Index

Similar Entries

  • VBO_update_data    xtlang
  • bind_cube    xtlang
  • clean-cube    xtlang
  • clock:update-metro    scheme
  • clock:update-metro    scheme
  • cube_whole    xtlang
  • dict_update    xtlang
  • fluid-cube-add-density    xtlang
  • fluid-cube-add-density    xtlang
  • fluid-cube-add-velocity    xtlang
  • fluid-cube-add-velocity    xtlang
  • fluid-cube-create    xtlang
  • fluid-cube-create    xtlang
  • fluid-cube-get-column    xtlang
  • fluid-cube-get-first-column    xtlang
  • fluid-cube-get-first-row    xtlang
  • fluid-cube-get-last-column    xtlang
  • fluid-cube-get-last-row    xtlang
  • fluid-cube-get-row    xtlang
  • fluid-cube-set-column    xtlang
  • fluid-cube-set-first-column    xtlang
  • fluid-cube-set-first-row    xtlang
  • fluid-cube-set-last-column    xtlang
  • fluid-cube-set-last-row    xtlang
  • fluid-cube-set-row    xtlang
  • fluid-step-cube    xtlang
  • fluid-step-cube    xtlang
  • fluid_cube_add_density    xtlang
  • fluid_cube_add_velocity    xtlang
  • fluid_cube_create    xtlang
  • fluid_step_cube    xtlang
  • get-fluid-cube    xtlang
  • get-fluid-cube-1    xtlang
  • get-fluid-cube-2    xtlang
  • get_fluid_cube    xtlang
  • glCube    xtlang
  • impc:ti:check-to-update-generic-vars    scheme
  • impc:ti:update-closure-name    scheme
  • impc:ti:update-var    scheme
  • kinect_update_body    xtlang
  • load_cube_data    xtlang
  • model_update    xtlang
  • position_update    xtlang
  • shader_update_bones    xtlang
  • shader_update_camera    xtlang
  • shader_update_envmap    xtlang
  • shader_update_light    xtlang
  • shader_update_lights    xtlang
  • shader_update_material    xtlang
  • shader_update_material    xtlang
  • shader_update_material    xtlang
  • shader_update_matrices    xtlang
  • shader_update_matrices_lv    xtlang
  • shader_update_matrices_lvs    xtlang
  • shader_update_projection_texture    xtlang
  • shader_update_uvwmatrix    xtlang
  • unbind_cube    xtlang
  • unbind_cube    xtlang
  • update    xtlang
  • update    xtlang
  • update-borders    xtlang
  • update-fluid-sym-state    xtlang
  • update_data_points    xtlang
  • xtm_update_camera    xtlang
  • xtm_update_lights    xtlang
  • xtm_update_matrices    xtlang
  • xtmtest-update-test-result    scheme
  • xtmtest-update-test-result    scheme