ai_load_ogl_texture_from_buffer   xtlang


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

Implementation

(bind-func ai_load_ogl_texture_from_buffer
  (lambda (buffer buflen tex_id:i32)
    ;; if tex_id is 0, generate a new texture
    (if (= tex_id 0)
        (let ((texid_ptr:i32* (salloc)))
          (glGenTextures 1 texid_ptr)
          (set! tex_id (pref texid_ptr 0))))
    ;; (stbi_set_flip_vertically_on_load 1)
    (let ((width_ptr:i32* (salloc))
          (height_ptr:i32* (salloc))
          (comp_ptr:i32* (salloc))
          (data (stbi_load_from_memory buffer buflen width_ptr height_ptr comp_ptr 4)))
      (if (null? data)
          (begin (println (stbi_failure_reason))
                 0)
          (begin
            (glActiveTexture GL_TEXTURE0)
            (glBindTexture GL_TEXTURE_2D tex_id)
            (glTexImage2D GL_TEXTURE_2D 0
                          GL_RGBA
                          (pref width_ptr 0)
                          (pref height_ptr 0)
                          0
                          GL_RGBA
                          GL_UNSIGNED_BYTE
                          data)
            ;; set some parameters
            (glTexParameteri GL_TEXTURE_2D GL_TEXTURE_WRAP_S GL_CLAMP_TO_EDGE)
            (glTexParameteri GL_TEXTURE_2D GL_TEXTURE_WRAP_T GL_CLAMP_TO_EDGE)
            (glTexParameteri GL_TEXTURE_2D GL_TEXTURE_MIN_FILTER GL_LINEAR)
            (glTexParameteri GL_TEXTURE_2D GL_TEXTURE_MAG_FILTER GL_LINEAR)
            (gl_print_error "error in ai_load_ogl_texture")
            tex_id)))))


Back to Index

Similar Entries

  • -clock:metro-from-host-    scheme
  • -clock:metro-from-host-    scheme
  • AudioBuffer    xtlang
  • AudioBuffer    xtlang
  • AudioBuffer    xtlang
  • AudioBuffer    xtlang
  • AudioBuffer    xtlang
  • AudioBuffer_concat    xtlang
  • AudioBuffer_cstring    xtlang
  • AudioBuffer_data_b64    xtlang
  • AudioBuffer_data_b64_cstring    xtlang
  • AudioBuffer_from_aiff    xtlang
  • AudioBuffer_from_wave    xtlang
  • AudioBuffer_malloc    xtlang
  • AudioBuffer_read    xtlang
  • AudioBuffer_read    xtlang
  • AudioBuffer_read_interp    xtlang
  • AudioBuffer_read_interp_mix    xtlang
  • AudioBuffer_read_interp_pw    xtlang
  • AudioBuffer_read_looped    xtlang
  • AudioBuffer_read_looped    xtlang
  • AudioBuffer_set_data_b64    xtlang
  • AudioBuffer_shared_data    xtlang
  • Complex_bufferize    xtlang
  • Complex_bufferize    xtlang
  • Complex_bufferize    xtlang
  • Complex_bufferize    xtlang
  • Complex_unbufferize    xtlang
  • Complex_unbufferize    xtlang
  • Complex_unbufferize    xtlang
  • Complex_unbufferize    xtlang
  • FBO_color_texture    xtlang
  • FBO_create_with_textures    xtlang
  • FBO_depth_texture    xtlang
  • MATCH-FAILED    scheme
  • 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
  • _glib_main_loop_call    xtlang
  • _glib_main_loop_call    xtlang
  • _glib_main_loop_call    xtlang
  • _gst_main_loop_call    xtlang
  • aiGetMaterialFloat    xtlang
  • aiProcess_CalcTangentSpace    scheme
  • aiProcess_Debone    scheme
  • aiProcess_FindDegenerates    scheme
  • aiProcess_FindInstances    scheme
  • aiProcess_FindInvalidData    scheme
  • aiProcess_FixInfacingNormals    scheme
  • aiProcess_FlipUVs    scheme
  • aiProcess_FlipWindingOrder    scheme
  • aiProcess_GenNormals    scheme
  • aiProcess_GenSmoothNormals    scheme
  • aiProcess_GenUVCoords    scheme
  • aiProcess_ImproveCacheLocality    scheme
  • aiProcess_JoinIdenticalVertices    scheme
  • aiProcess_LimitBoneWeights    scheme
  • aiProcess_MakeLeftHanded    scheme
  • aiProcess_OptimizeGraph    scheme
  • aiProcess_OptimizeMeshes    scheme
  • aiProcess_PreTransformVertices    scheme
  • aiProcess_RemoveComponent    scheme
  • aiProcess_RemoveRedundantMaterials    scheme
  • aiProcess_SortByPType    scheme
  • aiProcess_SplitByBoneCount    scheme
  • aiProcess_SplitLargeMeshes    scheme
  • aiProcess_TransformUVCoords    scheme
  • aiProcess_Triangulate    scheme
  • aiProcess_ValidateDataStructure    scheme
  • ai_build_anim_channel    xtlang
  • ai_build_animation    xtlang
  • ai_build_mesh    xtlang
  • ai_build_mesh_vbo    xtlang
  • ai_build_node    xtlang
  • ai_build_scene    xtlang
  • ai_color4_to_float4    xtlang
  • ai_convert    xtlang
  • ai_find_matching_node    xtlang
  • ai_load_ogl_texture    xtlang
  • ai_matrix4_to_float    xtlang
  • ai_print_export_formats    xtlang
  • aiff_validate    xtlang
  • analogue-load-preset    scheme
  • analogue-load-state    scheme
  • assimp_load_model    xtlang
  • assimp_load_model    xtlang
  • assimp_load_model    scheme
  • audiofile_aiff_read_samples    xtlang
  • available_midi_events    xtlang
  • await_futures    xtlang
  • bitmap_from_window    xtlang
  • buffers    xtlang
  • cairo-animation    scheme
  • cairo_draw_image    xtlang
  • cerberus-load-preset    scheme
  • cerberus-load-state    scheme
  • cerberus_frq_from_val    xtlang
  • cerberus_main_cc    xtlang
  • cerberus_octave_from_val    xtlang
  • clock:offset-from-server    scheme
  • clock_scheduler_main_callback    xtlang
  • comb_fb_from_rtsixty    xtlang
  • constrain-generic    scheme
  • constrain-genericfunc    macro
  • cpBBContainsBB    xtlang
  • cpBBContainsVect    xtlang
  • create_texture_shader    xtlang
  • db_load    xtlang
  • decompose_domain    xtlang
  • dsp_load    xtlang
  • fbo_create_depth_buffer    xtlang
  • fbo_create_depth_buffer_rect    xtlang
  • fbo_create_texture    xtlang
  • fbo_create_texture_rect    xtlang
  • filename-from-path    scheme
  • fill_buffer_with_file    xtlang
  • frq_from_val    xtlang
  • frq_from_val    xtlang
  • get_download_handler    xtlang
  • get_load_handler    xtlang
  • get_main_frame    xtlang
  • ghttp_copy_request_body_into_buffer    xtlang
  • ghttp_set_content_type_plaintext    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
  • glew-name-from-gl-name    scheme
  • glfw_get_framebuffer_height    xtlang
  • glfw_get_framebuffer_width    xtlang
  • glfw_print_primary_monitor_details    xtlang
  • glfw_print_video_mode_details    xtlang
  • glfw_swap_buffers    xtlang
  • glib-main-loop    scheme
  • glib-main-loop    scheme
  • glib_main_loop    xtlang
  • grains    scheme
  • gst-main-loop    scheme
  • gui_set_monokai_color_theme    xtlang
  • gui_set_monokai_opensans_theme    xtlang
  • impc:aot:insert-closure-binding-details    scheme
  • impc:aot:insert-ext-globalvar-binding-details    scheme
  • impc:aot:insert-gl-proc-binding-details    scheme
  • impc:aot:insert-globalvar-binding-details    scheme
  • impc:aot:insert-load-dylib-details    scheme
  • impc:aot:insert-namedtype-binding-details    scheme
  • impc:aot:insert-nativefunc-binding-details    scheme
  • impc:aot:insert-polyfunc-binding-details    scheme
  • impc:aot:insert-static-binding-details    scheme
  • impc:aot:insert-typealias-binding-details    scheme
  • impc:aot:insert-xtmacro-binding-details    scheme
  • impc:aot:print-compilation-details    scheme
  • impc:compiler:print-bind-func-details-to-log    scheme
  • impc:compiler:print-binding-details-to-log    scheme
  • impc:compiler:print-compiler-failed-error    scheme
  • impc:compiler:print-constraint-error    scheme
  • impc:compiler:print-dylib-loading-details-to-log    scheme
  • impc:compiler:print-lib-binding-details-to-log    scheme
  • impc:compiler:print-polying-details-to-log    scheme
  • impc:ir:compiler:closure-from-getter    scheme
  • impc:ir:convert-from-pretty-types    scheme
  • impc:ir:get-arity-from-pretty-closure    scheme
  • impc:ir:get-array-type-from-str    scheme
  • impc:ir:get-closure-type-from-str    scheme
  • impc:ir:get-function-type-from-str    scheme
  • impc:ir:get-tuple-type-from-str    scheme
  • impc:ir:get-type-from-pretty-array    scheme
  • impc:ir:get-type-from-pretty-closure    scheme
  • impc:ir:get-type-from-pretty-str    scheme
  • impc:ir:get-type-from-pretty-str-rec    scheme
  • impc:ir:get-type-from-pretty-tuple    scheme
  • impc:ir:get-type-from-pretty-vector    scheme
  • impc:ir:get-type-from-str    scheme
  • impc:ir:get-vector-type-from-str    scheme
  • impc:ti:check-bang-against-reified    scheme
  • impc:ti:constrain-genericfunc    scheme
  • impc:ti:generic-type-details    scheme
  • impc:ti:reverse-set-bangs-from-reified    scheme
  • impc:ti:tuple-list-from-pretty-tuple-str    scheme
  • impc:ti:variable-substitution-pairs    scheme
  • ipc:load    scheme
  • is_loading    xtlang
  • last-pair    scheme
  • lilv_load_plugin    xtlang
  • list-tail    scheme
  • 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_data    xtlang
  • load_vg_fonts    xtlang
  • main    xtlang
  • main    xtlang
  • main    xtlang
  • main    xtlang
  • main    xtlang
  • main    xtlang
  • main    xtlang
  • main    xtlang
  • main    xtlang
  • main    xtlang
  • main    xtlang
  • mainLoop    xtlang
  • mainLoop    xtlang
  • main_cc    xtlang
  • main_gain    xtlang
  • main_reverb    xtlang
  • match-pair    scheme
  • match_aiString    xtlang
  • nth_tail    xtlang
  • nth_tailr    xtlang
  • nvg_load_opensans_fonts    xtlang
  • octave_from_val    xtlang
  • ocv_waitKey    xtlang
  • p:pair    scheme
  • pairs_test    xtlang
  • pc:from-intervals    scheme
  • pc:from-steps    scheme
  • pc:scale-from-chord    scheme
  • pc:scale-from-pc    scheme
  • print-load    scheme
  • reload    xtlang
  • reload_ignore_cache    xtlang
  • run_main_event_loop    xtlang
  • set_cairo_source_with_colour    xtlang
  • set_dl_main    xtlang
  • set_sampler_audiobuffer    xtlang
  • set_slide_texture    xtlang
  • sf_channels_from_file    xtlang
  • sf_frames_from_file    xtlang
  • sf_read_file_into_buffer    xtlang
  • sf_samples_from_file    xtlang
  • shader_update_projection_texture    xtlang
  • stop_load    xtlang
  • string_list_from_file    xtlang
  • string_list_from_string    xtlang
  • sys:compile-init-ll-from-str    scheme
  • sys:compile-ll-from-str    scheme
  • sys:load    scheme
  • sys:load-escape    scheme
  • sys:load-preload-check    scheme
  • sys:load-then-quit    scheme
  • sys:wait    scheme
  • tail    scheme
  • texture_setup    xtlang
  • with-input-from-file    scheme
  • with-input-output-from-to-files    scheme
  • world_texture_setup    xtlang
  • xtm_destroy_paint    xtlang
  • xtm_load_vgimage    xtlang
  • xtm_paint_set_color    xtlang
  • xtm_paint_set_fill    xtlang
  • xtm_paint_set_pattern    xtlang
  • xtm_paint_set_stroke    xtlang
  • xtm_projection_texture_load    xtlang
  • xtm_projecton_texture_weight    xtlang
  • xtmdoc-get-args-from-form    scheme
  • zip_array_ptr_constraint    scheme
  • zip_array_val_constraint    scheme