Texture_bind_image   xtlang


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

Implementation

(bind-func Texture_bind_image
  (lambda (tex:Texture filename)
    ;; seems to need to be set
    (stbi_set_flip_vertically_on_load 1)
    (let ((width_ptr:i32* (salloc))
          (height_ptr:i32* (salloc))
          (comp_ptr:i32* (salloc))
          (data (stbi_load filename width_ptr height_ptr comp_ptr 4)))
      (if (null? data)
          (begin (println (stbi_failure_reason))
                 -1)
          (begin
            (glActiveTexture GL_TEXTURE0)
            (glBindTexture GL_TEXTURE_2D tex)
            (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 "couldn't Texture_bind_image")
            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_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
  • ai_load_ogl_texture    xtlang
  • ai_load_ogl_texture_from_buffer    xtlang
  • biSizeImage    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
  • cairo_draw_image    xtlang
  • create_texture_shader    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
  • fits-image-x    xtlang
  • fits-image-x    xtlang
  • fits-image-y    xtlang
  • fits-image-y    xtlang
  • fits-image-z    xtlang
  • fits-image-z    xtlang
  • free_image    xtlang
  • gl_load_image    xtlang
  • gl_load_image_rect    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
  • ipc:bind-func    scheme
  • ipc:bind-xtmrender-vars    scheme
  • load_assim_material_texture    xtlang
  • match-result:bind    scheme
  • nnsock_bind    xtlang
  • plet-make-bindings    scheme
  • set_slide_texture    xtlang
  • shader_update_projection_texture    xtlang
  • texture_setup    xtlang
  • unbind    xtlang
  • unbind    xtlang
  • unbind    xtlang
  • unbind-func    macro
  • unbind_cube    xtlang
  • unbind_cube    xtlang
  • world_texture_setup    xtlang
  • xtm_create_vgimage    xtlang
  • xtm_destroy_vgimage    xtlang
  • xtm_draw_vgimage    xtlang
  • xtm_load_vgimage    xtlang
  • xtm_projection_texture_load    xtlang
  • xtm_projecton_texture_weight    xtlang
  • xtm_scale_and_draw_vgimage    xtlang
  • xtm_scale_and_draw_vgimaged    xtlang
  • xtm_set_vgimage_subdata    xtlang
  • xtm_vgimage_rotate    xtlang
  • xtm_vgimage_rotated    xtlang
  • xtm_vgimage_scale    xtlang
  • xtm_vgimage_scaled    xtlang
  • xtm_vgimage_shear    xtlang
  • xtm_vgimage_sheard    xtlang
  • xtm_vgimage_translate    xtlang
  • xtm_vgimage_translated    xtlang