Created
November 11, 2013 09:04
-
-
Save Madsy/7410120 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SCM_DEFINE(Scheme_CreateTexture, "texture-create", 0, 0, 1, | |
(SCM rest), | |
"Create a texture without any contents.") | |
{ | |
/* | |
Optional keywords/arguments: | |
#:target ('texture-1d | 'texture-2d | 'texture-3d) | |
#:numchannels (1,2,3,4) | |
#:format ('fixedpoint | 'float) | |
#:width integer | |
#:height integer | |
#:depth integer | |
*/ | |
#define FUNC_NAME s_Scheme_CreateTexture | |
SCM smob; | |
SCM scm_target; | |
SCM scm_numchannels; | |
SCM scm_format; | |
SCM scm_width; | |
SCM scm_height; | |
SCM scm_depth; | |
GLenum target; | |
GLuint format; | |
GLuint internalformat; | |
GLuint width; | |
GLuint height; | |
GLuint depth; | |
scm_target = scheme_symbol_texture_2d; | |
scm_numchannels = scm_from_uint32(4); | |
scm_format = scheme_symbol_fixedpoint; | |
scm_width = scm_from_uint32(256); | |
scm_height = scm_from_uint32(256); | |
scm_depth = scm_from_uint32(0); | |
scm_c_bind_keyword_arguments("texture-create", rest, (scm_t_keyword_arguments_flags)0, | |
scheme_keyword_target, &scm_target, | |
scheme_keyword_numchannels, &scm_numchannels, | |
scheme_keyword_format, &scm_format, | |
scheme_keyword_width, &scm_width, | |
scheme_keyword_height, &scm_height, | |
scheme_keyword_depth, &scm_depth, | |
SCM_UNDEFINED); | |
SCM_VALIDATE_NUMBER(1, scm_numchannels); | |
... | |
return smob; | |
#undef FUNC_NAME | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment