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.191 by root, Thu Apr 26 23:51:02 2007 UTC vs.
Revision 1.192 by root, Fri Apr 27 21:27:51 2007 UTC

65#define GL_FUNC(ptr,name) ptr name; 65#define GL_FUNC(ptr,name) ptr name;
66#include "glfunc.h" 66#include "glfunc.h"
67#undef GL_FUNC 67#undef GL_FUNC
68} gl; 68} gl;
69 69
70static void
70static void gl_BlendFuncSeparate (GLenum sa, GLenum da, GLenum saa, GLenum daa) 71gl_BlendFuncSeparate (GLenum sa, GLenum da, GLenum saa, GLenum daa)
71{ 72{
72 if (gl.BlendFuncSeparate) 73 if (gl.BlendFuncSeparate)
73 gl.BlendFuncSeparate (sa, da, saa, daa); 74 gl.BlendFuncSeparate (sa, da, saa, daa);
74 else if (gl.BlendFuncSeparateEXT) 75 else if (gl.BlendFuncSeparateEXT)
75 gl.BlendFuncSeparateEXT (sa, da, saa, daa); 76 gl.BlendFuncSeparateEXT (sa, da, saa, daa);
76 else 77 else
77 glBlendFunc (sa, da); 78 glBlendFunc (sa, da);
79}
80
81static GLuint
82gen_texture ()
83{
84 GLuint name;
85
86 if (AvFILL (texture_av) >= 0)
87 name = (GLuint)(size_t)av_pop (texture_av);
88 else
89 glGenTextures (1, &name);
90
91 return name;
92}
93
94static void
95del_texture (GLuint name)
96{
97 /* make a half-assed attempt at returning the memory used by the texture */
98 /* textures are frequently being reused by cfplus anyway */
99 /*glBindTexture (GL_TEXTURE_2D, name);*/
100 /*glTexImage2D (GL_TEXTURE_2D, 0, GL_ALPHA, 0, 0, 0, GL_ALPHA, GL_UNSIGNED_BYTE, 0);*/
101 av_push (texture_av, (SV *)(size_t)name);
102 glDeleteTextures (1, &name);
78} 103}
79 104
80#include "texcache.c" 105#include "texcache.c"
81 106
82#include "pango-font.c" 107#include "pango-font.c"
2376 2401
2377void glCopyPixels (int x, int y, int width, int height, int type = GL_COLOR) 2402void glCopyPixels (int x, int y, int width, int height, int type = GL_COLOR)
2378 2403
2379int glGenTexture () 2404int glGenTexture ()
2380 CODE: 2405 CODE:
2381{ 2406 RETVAL = gen_texture ();
2382 GLuint name;
2383 if (AvFILL (texture_av) >= 0)
2384 name = (GLuint)(size_t)av_pop (texture_av);
2385 else
2386 glGenTextures (1, &name);
2387 RETVAL = name;
2388}
2389 OUTPUT: 2407 OUTPUT:
2390 RETVAL 2408 RETVAL
2391 2409
2392void glDeleteTexture (int name) 2410void glDeleteTexture (int name)
2393 CODE: 2411 CODE:
2394{ 2412 del_texture (name);
2395 /* make a half-assed attempt at returning the memory used by the texture */ 2413
2396 /* textures are frequently being reused by cfplus anyway */
2397 /*glBindTexture (GL_TEXTURE_2D, name);*/
2398 /*glTexImage2D (GL_TEXTURE_2D, 0, GL_ALPHA, 0, 0, 0, GL_ALPHA, GL_UNSIGNED_BYTE, 0);*/
2399 av_push (texture_av, (SV *)(size_t)name);
2400 { GLuint name_ = name; glDeleteTextures (1, &name_); }
2401}
2402
2403int glGenList () 2414int glGenList ()
2404 CODE: 2415 CODE:
2405 RETVAL = glGenLists (1); 2416 RETVAL = glGenLists (1);
2406 OUTPUT: 2417 OUTPUT:
2407 RETVAL 2418 RETVAL

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines