load_data   xtlang


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

Implementation

(bind-func load_data
  (lambda (tex:Texture* flipped:i32 filename:String*)
    ;; (println "LOAD:" filename)
    ;; seems to need to be set
    (stbi_set_flip_vertically_on_load flipped)
    (let ((width_ptr:i32* (tref-ptr tex 2))
          (height_ptr:i32* (tref-ptr tex 3))
          (comp_ptr:i32* (salloc))
          (data (stbi_load (cstring filename) width_ptr height_ptr comp_ptr 4)))
      (cond ((= (pref comp_ptr 0) 4)
             (tset! tex 1 GL_RGBA))
            ((= (pref comp_ptr 0) 3)
             (tset! tex 1 GL_RGBA)) ;; rgb should be converted to RGBA
            ((= (pref comp_ptr 0) 1)
             (tset! tex 1 GL_DEPTH_COMPONENT))
            (else (println "Unknown componenet depth: " (pref comp_ptr 0)) 1:i32))
      (if (null? data)
          (begin
            (println (stbi_failure_reason)) 1)
          (begin
            (tset! tex 4 data) 1))
      void)))


Back to Index

Similar Entries

  • AudioBuffer_data_b64    xtlang
  • AudioBuffer_data_b64_cstring    xtlang
  • AudioBuffer_set_data_b64    xtlang
  • AudioBuffer_shared_data    xtlang
  • Pm_Event_Data1    xtlang
  • Pm_Event_Data2    xtlang
  • Pm_Message_Data1    xtlang
  • Pm_Message_Data2    xtlang
  • QRcode_data    xtlang
  • Texture_bind_data    xtlang
  • Texture_bind_data    xtlang
  • VBO_data    xtlang
  • VBO_update_data    xtlang
  • aiProcess_FindInvalidData    scheme
  • aiProcess_ValidateDataStructure    scheme
  • ai_load_ogl_texture    xtlang
  • ai_load_ogl_texture_from_buffer    xtlang
  • analogue-load-preset    scheme
  • analogue-load-state    scheme
  • assimp_load_model    xtlang
  • assimp_load_model    xtlang
  • assimp_load_model    scheme
  • bind-data    macro
  • bind-data-constructors    scheme
  • bind-data-deconstructors    scheme
  • bind-data-deconstructors-macros    scheme
  • bind-data-getters    scheme
  • bind-data-type    scheme
  • bind-data-type-constructor    scheme
  • bind-data-types    scheme
  • cerberus-load-preset    scheme
  • cerberus-load-state    scheme
  • clear_sample_data_    xtlang
  • create_data    xtlang
  • data    xtlang
  • data    xtlang
  • db_load    xtlang
  • dsp_load    xtlang
  • fits-image-data-R32    xtlang
  • fits-image-data-R32    xtlang
  • fits-image-data-RGBA32    xtlang
  • fits-image-data-RGBA32    xtlang
  • fits-image-data-RGBA32-false    xtlang
  • fits-image-data-RGBA32-false    xtlang
  • get_download_handler    xtlang
  • get_hand_data    xtlang
  • get_load_handler    xtlang
  • gl_load_image    xtlang
  • gl_load_image_rect    xtlang
  • gl_load_movie_textures    xtlang
  • gl_load_movie_textures    xtlang
  • gl_load_tex    xtlang
  • gl_load_tex_bgr    xtlang
  • gl_load_tex_ext    xtlang
  • gl_load_tex_ext_bgr    xtlang
  • gl_load_tex_rect    xtlang
  • impc:aot:insert-load-dylib-details    scheme
  • impc:compiler:print-dylib-loading-details-to-log    scheme
  • impc:ti:compile-type-dataconstructors    scheme
  • init_sample_data    xtlang
  • init_sample_data    xtlang
  • ipc:load    scheme
  • is_loading    xtlang
  • lilv_load_plugin    xtlang
  • load-sample    scheme
  • load-sampler    scheme
  • load-tex    xtlang
  • load-tex    xtlang
  • load_assim_material_texture    xtlang
  • load_blep_tables_from_blob    unknown
  • load_cube_data    xtlang
  • load_vg_fonts    xtlang
  • nvg_load_opensans_fonts    xtlang
  • ocv_dataPtr    xtlang
  • ocv_dataPtr    xtlang
  • print-load    scheme
  • reload    xtlang
  • reload_ignore_cache    xtlang
  • set-data-arrays-lines    xtlang
  • set-data-arrays-points    xtlang
  • set-data-particles    xtlang
  • set_sample_data_    xtlang
  • stop_load    xtlang
  • sys:load    scheme
  • sys:load-escape    scheme
  • sys:load-preload-check    scheme
  • sys:load-then-quit    scheme
  • sys_file_datasync    xtlang
  • sys_file_datasync    xtlang
  • update_data_points    xtlang
  • world_data    xtlang
  • world_data_index    xtlang
  • world_data_size    xtlang
  • xobj_database    xtlang
  • xtm_frame_data_to_tex    xtlang
  • xtm_load_vgimage    xtlang
  • xtm_projection_texture_load    xtlang
  • xtm_set_vgimage_subdata    xtlang