"}"
"return textures;")
+(defcfun "void gacela_glDeleteTextures (int n, object textures)" 0
+ "GLuint text[n];"
+ "int i, t;"
+ "for (i = 0; i < n; i++) {"
+ ((nth (int i) textures) t)
+ "text[i] = t;"
+ "}"
+ "glDeleteTextures (n, &text[0]);")
+
(defcfun "void gacela_glBindTexture (int target, int texture)" 0
"glBindTexture (target, texture);")
(defentry glVertex3f (float float float) (void "gacela_glVertex3f"))
(defentry glViewport (int int int int) (void "gacela_glViewport"))
(defentry glGenTextures (int) (object "gacela_glGenTextures"))
+(defentry glDeleteTextures (int object) (void "gacela_glDeleteTextures"))
(defentry glBindTexture (int int) (void "gacela_glBindTexture"))
(defentry glTexImage2D (int int int int int int int int int) (void "gacela_glTexImage2D"))
(defentry glTexParameteri (int int int) (void "gacela_glTexParameteri"))
(glTexParameteri GL_TEXTURE_2D GL_TEXTURE_MIN_FILTER min-filter)
(glTexParameteri GL_TEXTURE_2D GL_TEXTURE_MAG_FILTER mag-filter)
(SDL_FreeSurface image)
- (set-resource key `(:id-texture ,texture :width ,real-w :height ,real-h) nil :static static)
+ (set-resource key
+ `(:id-texture ,texture :width ,real-w :height ,real-h)
+ (lambda () (glDeleteTextures 1 `(,texture)))
+ :static static)
key)))))))))
(defun draw-image-function (filename)
(cond ((/= font 0)
(ftglSetFontFaceSize font size 72)
(ftglSetFontCharMap font encoding)
- (set-resource key `(:id-font ,font) nil :static static)
+ (set-resource key
+ `(:id-font ,font)
+ (lambda () (ftglDestroyFont font))
+ :static static)
key)))))))
(defun render-text (text font)