pack_map.c revision a0d1e40cc56a54314af0a1a4b5e13905ffd78393
ca551aca153d6df494985b5281c573ba2e3eb474vboxsync/* Copyright (c) 2001, Stanford University
ca551aca153d6df494985b5281c573ba2e3eb474vboxsync * All rights reserved
ca551aca153d6df494985b5281c573ba2e3eb474vboxsync * See the file LICENSE.txt for information on redistributing this software.
ca551aca153d6df494985b5281c573ba2e3eb474vboxsync/* Note -- for these packets, the ustride and vstride are implicit,
ca551aca153d6df494985b5281c573ba2e3eb474vboxsync * and are computed into the packet instead of copied.
81b3101ea5e60964f67c97185bbd43dbf75c5ab5vboxsyncvoid PACK_APIENTRY crPackMap2d(GLenum target, GLdouble u1,
81b3101ea5e60964f67c97185bbd43dbf75c5ab5vboxsync GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2,
81b3101ea5e60964f67c97185bbd43dbf75c5ab5vboxsync GLint vstride, GLint vorder, const GLdouble *points)
bd810d58866067df322ea7f4a4627d9bdebb70d3vboxsync unsigned char *data_ptr;
bd810d58866067df322ea7f4a4627d9bdebb70d3vboxsync sizeof( u1 ) +
bd810d58866067df322ea7f4a4627d9bdebb70d3vboxsync sizeof( u2 ) +
bd810d58866067df322ea7f4a4627d9bdebb70d3vboxsync sizeof( v1 ) +
bd810d58866067df322ea7f4a4627d9bdebb70d3vboxsync sizeof( v2 ) +
bd810d58866067df322ea7f4a4627d9bdebb70d3vboxsync int num_components = __gl_Map2NumComponents( target );
bd810d58866067df322ea7f4a4627d9bdebb70d3vboxsync "crPackMap2d(bad target)" );
bd810d58866067df322ea7f4a4627d9bdebb70d3vboxsync packet_length += num_components*uorder*vorder*sizeof( *points );
bd810d58866067df322ea7f4a4627d9bdebb70d3vboxsync data_ptr = (unsigned char *) crPackAlloc( packet_length );
bd810d58866067df322ea7f4a4627d9bdebb70d3vboxsync for (v = 0 ; v < vorder ; v++)
bd810d58866067df322ea7f4a4627d9bdebb70d3vboxsync for (u = 0 ; u < uorder ; u++)
bd810d58866067df322ea7f4a4627d9bdebb70d3vboxsync crMemcpy( dest_data, src_data, num_components * sizeof( *points ) );
unsigned char *data_ptr;
int packet_length =
sizeof( target ) +
sizeof( u1 ) +
sizeof( u2 ) +
sizeof( uorder ) +
sizeof( ustride ) +
sizeof( v1 ) +
sizeof( v2 ) +
sizeof( vorder ) +
sizeof( vstride );
if (num_components < 0)
for (v = 0 ; v < vorder ; v++)
for (u = 0 ; u < uorder ; u++)
unsigned char *data_ptr;
int packet_length =
sizeof( target ) +
sizeof( u1 ) +
sizeof( u2 ) +
sizeof( stride ) +
sizeof( order );
if (num_components < 0)
for (u = 0 ; u < order ; u++)
unsigned char *data_ptr;
int packet_length =
sizeof( target ) +
sizeof( u1 ) +
sizeof( u2 ) +
sizeof( stride ) +
sizeof( order );
if (num_components < 0)
for (u = 0 ; u < order ; u++)