X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fgacela_GL.c;h=da64a2eb55a24beeefca0be78365b7b0d94b8edb;hb=afd5b9c3d8e3e5ce81893771c7cac53f6469aa07;hp=a031dbae69bd7f6ab1edcfc0a32654b11a555940;hpb=16647eed5250375128894f6122be29ef15278ba3;p=gacela.git diff --git a/src/gacela_GL.c b/src/gacela_GL.c index a031dba..da64a2e 100644 --- a/src/gacela_GL.c +++ b/src/gacela_GL.c @@ -76,6 +76,18 @@ get_glTexture_height (SCM glTexture_smob) return scm_from_int (glTexture->height); } +SCM +set_glTexture_size (SCM glTexture_smob, SCM width, SCM height) +{ + struct glTexture *glTexture; + + scm_assert_smob_type (glTexture_tag, glTexture_smob); + glTexture = (struct glTexture *) SCM_SMOB_DATA (glTexture_smob); + glTexture->width = scm_to_int (width); + glTexture->height = scm_to_int (height); + return SCM_UNSPECIFIED; +} + size_t free_glTexture (SCM glTexture_smob) { @@ -235,7 +247,7 @@ gacela_glGenTextures (SCM n) glGenTextures (nint, &text[0]); for (i = nint - 1; i >= 0; i--) { - textures = scm_cons (scm_from_int (text[i]), textures); + textures = scm_cons (make_glTexture (text[i]), textures); } return textures; @@ -369,6 +381,7 @@ GL_register_functions (void* data) scm_set_smob_free (glTexture_tag, free_glTexture); scm_c_define_gsubr ("texture-w", 1, 0, 0, get_glTexture_width); scm_c_define_gsubr ("texture-h", 1, 0, 0, get_glTexture_height); + scm_c_define_gsubr ("set-texture-size!", 3, 0, 0, set_glTexture_size); // Data types scm_c_define ("GL_UNSIGNED_BYTE", scm_from_int (GL_UNSIGNED_BYTE));