pack_lights.c revision a0d1e40cc56a54314af0a1a4b5e13905ffd78393
/* Copyright (c) 2001, Stanford University
* All rights reserved
*
* See the file LICENSE.txt for information on redistributing this software.
*/
#include "packer.h"
#include "cr_error.h"
{
unsigned int params_length = 0;
unsigned char *data_ptr;
switch( pname )
{
case GL_AMBIENT:
case GL_DIFFUSE:
case GL_SPECULAR:
case GL_POSITION:
break;
case GL_SPOT_DIRECTION:
break;
case GL_SPOT_EXPONENT:
case GL_SPOT_CUTOFF:
case GL_CONSTANT_ATTENUATION:
case GL_LINEAR_ATTENUATION:
case GL_QUADRATIC_ATTENUATION:
params_length = sizeof( *params );
break;
default:
"crPackLight(bad pname)" );
return GL_FALSE;
}
WRITE_DATA( 0, int, packet_length );
if (params_length > sizeof( *params ))
{
}
{
}
return GL_TRUE;
}
{
}
{
/* floats and ints are the same size, so the packing should be the same */
}
{
unsigned int packet_length = sizeof( int ) + sizeof( pname );
unsigned int params_length = 0;
unsigned char *data_ptr;
switch( pname )
{
case GL_LIGHT_MODEL_AMBIENT:
break;
case GL_LIGHT_MODEL_TWO_SIDE:
params_length = sizeof( *params );
break;
default:
"crPackLightModel(bad pname)" );
return GL_FALSE;
}
WRITE_DATA( 0, int, packet_length );
if (params_length > sizeof( *params ))
{
}
return GL_TRUE;
}
{
}
{
/* floats and ints are the same size, so the packing should be the same */
}