server_simpleget.py revision 4d10b27f3115f8fcd58864142163726d6214a752
# Copyright (c) 2001, Stanford University
# All rights reserved.
#
# See the file LICENSE.txt for information on redistributing this software.
import sys
import apiutil
print """#include "cr_spu.h"
#include "chromium.h"
#include "cr_error.h"
#include "cr_mem.h"
#include "cr_net.h"
#include "server_dispatch.h"
#include "server.h"
"""
from get_sizes import *;
print 'void SERVER_DISPATCH_APIENTRY crServerDispatch%s( %s )' % ( func_name, apiutil.MakeDeclarationString(params))
print '{'
print '\tint tablesize;'
print """
#ifdef CR_ARB_texture_compression
if (GL_COMPRESSED_TEXTURE_FORMATS_ARB == pname)
{
GLint numtexfmts = 0;
cr_server.head_spu->dispatch_table.GetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB, &numtexfmts);
tablesize = numtexfmts * sizeof(%s);
}
else
#endif
{
tablesize = __numValues( pname ) * sizeof(%s);
}
print '\t(void) params;'
print '\tcr_server.head_spu->dispatch_table.%s( pname, get_values );' % func_name
print """
if (GL_TEXTURE_BINDING_1D==pname
|| GL_TEXTURE_BINDING_2D==pname
|| GL_TEXTURE_BINDING_3D==pname
|| GL_TEXTURE_BINDING_RECTANGLE_ARB==pname
|| GL_TEXTURE_BINDING_CUBE_MAP_ARB==pname)
{
GLuint texid;
texid = (GLuint) *get_values;
*get_values = (%s) crServerTranslateTextureID(texid);
}
print '\tcrServerReturnValue( get_values, tablesize );'
print '\tcrFree(get_values);'
print '}\n'