ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/Client.xs
(Generate patch)

Comparing deliantra/Deliantra-Client/Client.xs (file contents):
Revision 1.182 by root, Wed Apr 18 09:39:49 2007 UTC vs.
Revision 1.183 by root, Fri Apr 20 16:56:08 2007 UTC

400 400
401/* SDL should provide this, really. */ 401/* SDL should provide this, really. */
402#define SDLK_MODIFIER_MIN 300 402#define SDLK_MODIFIER_MIN 300
403#define SDLK_MODIFIER_MAX 314 403#define SDLK_MODIFIER_MAX 314
404 404
405static AV *texture_av;
406
405MODULE = CFPlus PACKAGE = CFPlus 407MODULE = CFPlus PACKAGE = CFPlus
406 408
407PROTOTYPES: ENABLE 409PROTOTYPES: ENABLE
408 410
409BOOT: 411BOOT:
410{ 412{
413 texture_av = newAV ();
414 AvREAL_off (texture_av);
415
411 HV *stash = gv_stashpv ("CFPlus", 1); 416 HV *stash = gv_stashpv ("CFPlus", 1);
412 static const struct { 417 static const struct {
413 const char *name; 418 const char *name;
414 IV iv; 419 IV iv;
415 } *civ, const_iv[] = { 420 } *civ, const_iv[] = {
2370 2375
2371int glGenTexture () 2376int glGenTexture ()
2372 CODE: 2377 CODE:
2373{ 2378{
2374 GLuint name; 2379 GLuint name;
2380 if (AvFILL (texture_av) >= 0)
2381 name = (GLuint)av_pop (texture_av);
2382 else
2375 glGenTextures (1, &name); 2383 glGenTextures (1, &name);
2376 RETVAL = name; 2384 RETVAL = name;
2377} 2385}
2378 OUTPUT: 2386 OUTPUT:
2379 RETVAL 2387 RETVAL
2380 2388
2381void glDeleteTexture (int name) 2389void glDeleteTexture (int name)
2382 CODE: 2390 CODE:
2383{ 2391{
2384 GLuint name_ = name; 2392 glBindTexture (GL_TEXTURE_2D, name);
2393 glTexImage2D (GL_TEXTURE_2D, 0, GL_ALPHA, 0, 0, 0, GL_ALPHA, GL_UNSIGNED_BYTE, 0);
2394 av_push (texture_av, (SV *)name);
2385 glDeleteTextures (1, &name_); 2395 /*glDeleteTextures (1, &name_);*/
2386} 2396}
2387 2397
2388int glGenList () 2398int glGenList ()
2389 CODE: 2399 CODE:
2390 RETVAL = glGenLists (1); 2400 RETVAL = glGenLists (1);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines