load_assim_material_texture   xtlang


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

Implementation

(bind-func load_assim_material_texture
  (lambda (scene:aiScene* material type dir)
    (let ((texfile:aiString* (salloc))
          (tex:Texture* null))
      (if (= (aiGetMaterialTexture material type 0 texfile null null null null null null) 0)
          (let ((s1 (cast (tref-ptr texfile 1) i8*))
                (lgth (+ (strlen dir) (tref texfile 0) 1))
                (s2 (salloc lgth)))
            (if (= (pref s1 0) 42)
                (let ((texidx:i32 (atoi (pref-ptr s1 1)))
                      (texture:aiTexture* (pref (tref scene 9) texidx))
                      (achformat (tref texture 2))
                      (texwidth (tref texture 0))
                      (texheight (tref texture 1))
                      (texdata (cast (tref texture 3) i8*))
                      (datasize (if (= texheight 0) texwidth (* 4 texwidth texheight))))
                  ;;(printf "tidx:%d of num:%d w:%d h:%d size:%d\n" texidx (tref scene 8) texwidth texheight datasize)
                  (set! tex (Texture texwidth texheight 4 texdata))
                  (update tex)
                  ;; (bind tex #t) ;; send to card
                  ;; (unbind tex)
                  (println tex)
                  ;; (set! texid (ai_load_ogl_texture_from_buffer texdata datasize 0))
                  void)
                (begin
                  (memset s2 0 lgth)
                  (memcpy s2 dir (strlen dir))
                  (memcpy (pref-ptr s2 (strlen dir)) s1 (tref texfile 0))
                  (println 'load-texture-from-file: (Str s2))
                  (set! tex (Texture (Str s2)))
                  (update tex)
                  (println tex)
                  ;; (set! texid (ai_load_ogl_texture s2 0))
                  void))))
      tex)))


Back to Index

Similar Entries

  • FBO_color_texture    xtlang
  • FBO_create_with_textures    xtlang
  • FBO_depth_texture    xtlang
  • Texture    xtlang
  • Texture    xtlang
  • Texture    xtlang
  • Texture    xtlang
  • Texture    xtlang
  • Texture    xtlang
  • Texture_bind_data    xtlang
  • Texture_bind_data    xtlang
  • Texture_bind_image    xtlang
  • Texture_create    xtlang
  • Texture_create_FBO_depth_texture    xtlang
  • Texture_delete    xtlang
  • aiGetMaterialFloat    xtlang
  • aiProcess_RemoveRedundantMaterials    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
  • cerberus-load-preset    scheme
  • cerberus-load-state    scheme
  • create_texture_shader    xtlang
  • db_load    xtlang
  • dsp_load    xtlang
  • fbo_create_texture    xtlang
  • fbo_create_texture_rect    xtlang
  • get_download_handler    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
  • ipc:load    scheme
  • is_loading    xtlang
  • lilv_load_plugin    xtlang
  • load-sample    scheme
  • load-sampler    scheme
  • load-tex    xtlang
  • load-tex    xtlang
  • load_blep_tables_from_blob    unknown
  • load_cube_data    xtlang
  • load_data    xtlang
  • load_vg_fonts    xtlang
  • nvg_load_opensans_fonts    xtlang
  • print-load    scheme
  • reload    xtlang
  • reload_ignore_cache    xtlang
  • set_slide_texture    xtlang
  • shader_update_material    xtlang
  • shader_update_material    xtlang
  • shader_update_material    xtlang
  • shader_update_projection_texture    xtlang
  • stop_load    xtlang
  • sys:load    scheme
  • sys:load-escape    scheme
  • sys:load-preload-check    scheme
  • sys:load-then-quit    scheme
  • texture_setup    xtlang
  • world_texture_setup    xtlang
  • xtm_load_vgimage    xtlang
  • xtm_projection_texture_load    xtlang
  • xtm_projecton_texture_weight    xtlang