Texture_bind_data   xtlang


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

Implementation

(bind-func Texture_bind_data
  "this just uses texture slot 0 (GL_TEXTURE0) - it should probably
allow the texture slot to be specified"
  (lambda (tex:Texture data:i8* width height chan:i32 wrap filter)
    (if (null? data)
        (begin (println "Error: data is null.")
               #f)
        (let ((format (cond ((= chan 1) GL_RED)
                            ((= chan 3) GL_RGB)
                            ((= chan 4) GL_RGBA)
                            (else 0:i32))))
          (if (= format 0)
              (begin (println "Error: only chan must be 1, 3 or 4.")
                     #f)
              (begin (glActiveTexture GL_TEXTURE0)
                     (glBindTexture GL_TEXTURE_2D tex)
                     (glTexImage2D GL_TEXTURE_2D 0
                                   format
                                   width height
                                   0
                                   format
                                   GL_UNSIGNED_BYTE
                                   data)
                     ;; set some parameters
                     (glTexParameteri GL_TEXTURE_2D GL_TEXTURE_WRAP_S wrap)
                     (glTexParameteri GL_TEXTURE_2D GL_TEXTURE_WRAP_T wrap)
                     (glTexParameteri GL_TEXTURE_2D GL_TEXTURE_MIN_FILTER filter)
                     (glTexParameteri GL_TEXTURE_2D GL_TEXTURE_MAG_FILTER filter)
                     (gl_print_error "couldn't Texture_bind_image")
                     #t))))))


Back to Index

Similar Entries

  • AudioBuffer_data_b64    xtlang
  • AudioBuffer_data_b64_cstring    xtlang
  • AudioBuffer_set_data_b64    xtlang
  • AudioBuffer_shared_data    xtlang
  • FBO_color_texture    xtlang
  • FBO_create_with_textures    xtlang
  • FBO_depth_texture    xtlang
  • Pm_Event_Data1    xtlang
  • Pm_Event_Data2    xtlang
  • Pm_Message_Data1    xtlang
  • Pm_Message_Data2    xtlang
  • QRcode_data    xtlang
  • Texture    xtlang
  • Texture    xtlang
  • Texture    xtlang
  • Texture    xtlang
  • Texture    xtlang
  • Texture    xtlang
  • Texture_bind_data    xtlang
  • Texture_bind_image    xtlang
  • Texture_create    xtlang
  • Texture_create_FBO_depth_texture    xtlang
  • Texture_delete    xtlang
  • VAO_bind_and_draw_arrays    xtlang
  • VAO_bind_attribute    xtlang
  • VAO_bind_attribute    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
  • bind    xtlang
  • bind    xtlang
  • bind    xtlang
  • bind-alias    macro
  • bind-closure    macro
  • 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
  • bind-dylib    macro
  • bind-ext-val    macro
  • bind-external-dylib-declarations    scheme
  • bind-func    macro
  • bind-func-ipc    scheme
  • bind-gl-proc    macro
  • bind-glew    macro
  • bind-lib    macro
  • bind-lib-func    macro
  • bind-lib-type    macro
  • bind-lib-val    macro
  • bind-lib-xtm-get-string    macro
  • bind-macro    macro
  • bind-method    macro
  • bind-object    macro
  • bind-poly    macro
  • bind-static    macro
  • bind-type    macro
  • bind-val    macro
  • bind-wrapper    macro
  • bind_cube    xtlang
  • bindfunc    xtlang
  • bindfunc_with_docstring    xtlang
  • bindfunc_with_zone_size    xtlang
  • bindfunc_with_zone_size_and_docstring    xtlang
  • clear_sample_data_    xtlang
  • create_data    xtlang
  • create_texture_shader    xtlang
  • data    xtlang
  • data    xtlang
  • fbo_create_texture    xtlang
  • fbo_create_texture_rect    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_hand_data    xtlang
  • gl_load_movie_textures    xtlang
  • gl_load_movie_textures    xtlang
  • godot_method_bind_call    xtlang
  • godot_method_bind_get_method    xtlang
  • godot_method_bind_ptrcall    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-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:compiler:print-bind-func-details-to-log    scheme
  • impc:compiler:print-binding-details-to-log    scheme
  • impc:compiler:print-lib-binding-details-to-log    scheme
  • impc:ti:bind-dylib    scheme
  • impc:ti:bind-lib    scheme
  • impc:ti:compile-type-dataconstructors    scheme
  • init_sample_data    xtlang
  • init_sample_data    xtlang
  • ipc:bind-func    scheme
  • ipc:bind-xtmrender-vars    scheme
  • load_assim_material_texture    xtlang
  • load_cube_data    xtlang
  • load_data    xtlang
  • match-result:bind    scheme
  • nnsock_bind    xtlang
  • ocv_dataPtr    xtlang
  • ocv_dataPtr    xtlang
  • plet-make-bindings    scheme
  • set-data-arrays-lines    xtlang
  • set-data-arrays-points    xtlang
  • set-data-particles    xtlang
  • set_sample_data_    xtlang
  • set_slide_texture    xtlang
  • shader_update_projection_texture    xtlang
  • sys_file_datasync    xtlang
  • sys_file_datasync    xtlang
  • texture_setup    xtlang
  • unbind    xtlang
  • unbind    xtlang
  • unbind    xtlang
  • unbind-func    macro
  • unbind_cube    xtlang
  • unbind_cube    xtlang
  • update_data_points    xtlang
  • world_data    xtlang
  • world_data_index    xtlang
  • world_data_size    xtlang
  • world_texture_setup    xtlang
  • xobj_database    xtlang
  • xtm_frame_data_to_tex    xtlang
  • xtm_projection_texture_load    xtlang
  • xtm_projecton_texture_weight    xtlang
  • xtm_set_vgimage_subdata    xtlang