本文整理汇总了C++中ASSIGN_4V函数的典型用法代码示例。如果您正苦于以下问题:C++ ASSIGN_4V函数的具体用法?C++ ASSIGN_4V怎么用?C++ ASSIGN_4V使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ASSIGN_4V函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _mesa_ProgramEnvParameter4fARB
/**
* Set a program env parameter register.
* \note Called from the GL API dispatcher.
* Note, this function is also used by the GL_NV_vertex_program extension
* (alias to ProgramParameterfNV)
*/
void GLAPIENTRY
_mesa_ProgramEnvParameter4fARB(GLenum target, GLuint index,
GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
FLUSH_VERTICES(ctx, _NEW_PROGRAM_CONSTANTS);
if (target == GL_FRAGMENT_PROGRAM_ARB
&& ctx->Extensions.ARB_fragment_program) {
if (index >= ctx->Const.FragmentProgram.MaxEnvParams) {
_mesa_error(ctx, GL_INVALID_VALUE, "glProgramEnvParameter(index)");
return;
}
ASSIGN_4V(ctx->FragmentProgram.Parameters[index], x, y, z, w);
}
else if (target == GL_VERTEX_PROGRAM_ARB /* == GL_VERTEX_PROGRAM_NV */
&& (ctx->Extensions.ARB_vertex_program || ctx->Extensions.NV_vertex_program)) {
if (index >= ctx->Const.VertexProgram.MaxEnvParams) {
_mesa_error(ctx, GL_INVALID_VALUE, "glProgramEnvParameter(index)");
return;
}
ASSIGN_4V(ctx->VertexProgram.Parameters[index], x, y, z, w);
}
else {
_mesa_error(ctx, GL_INVALID_ENUM, "glProgramEnvParameter(target)");
return;
}
}
示例2: _mesa_init_vp_registers
/**
* Load/initialize the vertex program registers.
* This needs to be done per vertex.
*/
void
_mesa_init_vp_registers(GLcontext *ctx)
{
GLuint i;
/* Input registers get initialized from the current vertex attribs */
MEMCPY(ctx->VertexProgram.Inputs, ctx->Current.Attrib,
VERT_ATTRIB_MAX * 4 * sizeof(GLfloat));
/* Output and temp regs are initialized to [0,0,0,1] */
for (i = 0; i < MAX_NV_VERTEX_PROGRAM_OUTPUTS; i++) {
ASSIGN_4V(ctx->VertexProgram.Outputs[i], 0.0F, 0.0F, 0.0F, 1.0F);
}
for (i = 0; i < MAX_NV_VERTEX_PROGRAM_TEMPS; i++) {
ASSIGN_4V(ctx->VertexProgram.Temporaries[i], 0.0F, 0.0F, 0.0F, 1.0F);
}
/* The program parameters aren't touched */
/* XXX: This should be moved to glBegin() time, but its safe (and slow!)
* here - Karl
*/
if (ctx->VertexProgram.Current->Parameters) {
/* Grab the state GL state and put into registers */
_mesa_load_state_parameters(ctx, ctx->VertexProgram.Current->Parameters);
}
}
示例3: _mesa_init_rastpos
/**
* Initialize the context current raster position information.
*
* \param ctx GL context.
*
* Initialize the current raster position information in
* __struct gl_contextRec::Current, and adds the extension entry points to the
* dispatcher.
*/
void _mesa_init_rastpos( struct gl_context * ctx )
{
ASSIGN_4V( ctx->Current.RasterPos, 0.0, 0.0, 0.0, 1.0 );
ctx->Current.RasterDistance = 0.0;
ASSIGN_4V( ctx->Current.RasterColor, 1.0, 1.0, 1.0, 1.0 );
ASSIGN_4V( ctx->Current.RasterTexCoords, 0.0, 0.0, 0.0, 1.0 );
ctx->Current.RasterPosValid = GL_TRUE;
}
示例4: _mesa_init_rastpos
/**
* Initialize the context current raster position information.
*
* \param ctx GL context.
*
* Initialize the current raster position information in
* __struct gl_contextRec::Current, and adds the extension entry points to the
* dispatcher.
*/
void _mesa_init_rastpos( struct gl_context * ctx )
{
unsigned i;
ASSIGN_4V( ctx->Current.RasterPos, 0.0, 0.0, 0.0, 1.0 );
ctx->Current.RasterDistance = 0.0;
ASSIGN_4V( ctx->Current.RasterColor, 1.0, 1.0, 1.0, 1.0 );
ASSIGN_4V( ctx->Current.RasterSecondaryColor, 0.0, 0.0, 0.0, 1.0 );
for (i = 0; i < ARRAY_SIZE(ctx->Current.RasterTexCoords); i++)
ASSIGN_4V( ctx->Current.RasterTexCoords[i], 0.0, 0.0, 0.0, 1.0 );
ctx->Current.RasterPosValid = GL_TRUE;
}
示例5: _mesa_init_rastpos
/**
* Initialize the context current raster position information.
*
* \param ctx GL context.
*
* Initialize the current raster position information in
* __GLcontextRec::Current, and adds the extension entry points to the
* dispatcher.
*/
void _mesa_init_rastpos( GLcontext * ctx )
{
int i;
ASSIGN_4V( ctx->Current.RasterPos, 0.0, 0.0, 0.0, 1.0 );
ctx->Current.RasterDistance = 0.0;
ASSIGN_4V( ctx->Current.RasterColor, 1.0, 1.0, 1.0, 1.0 );
ASSIGN_4V( ctx->Current.RasterSecondaryColor, 0.0, 0.0, 0.0, 1.0 );
ctx->Current.RasterIndex = 1.0;
for (i=0; i<MAX_TEXTURE_UNITS; i++)
ASSIGN_4V( ctx->Current.RasterTexCoords[i], 0.0, 0.0, 0.0, 1.0 );
ctx->Current.RasterPosValid = GL_TRUE;
}
示例6: _mesa_init_color
/**
* Initialization of the context's Color attribute group.
*
* \param ctx GL context.
*
* Initializes the related fields in the context color attribute group,
* __struct gl_contextRec::Color.
*/
void _mesa_init_color( struct gl_context * ctx )
{
GLuint i;
/* Color buffer group */
ctx->Color.IndexMask = ~0u;
memset(ctx->Color.ColorMask, 0xff, sizeof(ctx->Color.ColorMask));
ctx->Color.ClearIndex = 0;
ASSIGN_4V( ctx->Color.ClearColor.f, 0, 0, 0, 0 );
ctx->Color.AlphaEnabled = GL_FALSE;
ctx->Color.AlphaFunc = GL_ALWAYS;
ctx->Color.AlphaRef = 0;
ctx->Color.BlendEnabled = 0x0;
for (i = 0; i < ARRAY_SIZE(ctx->Color.Blend); i++) {
ctx->Color.Blend[i].SrcRGB = GL_ONE;
ctx->Color.Blend[i].DstRGB = GL_ZERO;
ctx->Color.Blend[i].SrcA = GL_ONE;
ctx->Color.Blend[i].DstA = GL_ZERO;
ctx->Color.Blend[i].EquationRGB = GL_FUNC_ADD;
ctx->Color.Blend[i].EquationA = GL_FUNC_ADD;
}
ASSIGN_4V( ctx->Color.BlendColor, 0.0, 0.0, 0.0, 0.0 );
ASSIGN_4V( ctx->Color.BlendColorUnclamped, 0.0, 0.0, 0.0, 0.0 );
ctx->Color.IndexLogicOpEnabled = GL_FALSE;
ctx->Color.ColorLogicOpEnabled = GL_FALSE;
ctx->Color.LogicOp = GL_COPY;
ctx->Color.DitherFlag = GL_TRUE;
/* GL_FRONT is not possible on GLES. Instead GL_BACK will render to either
* the front or the back buffer depending on the config */
if (ctx->Visual.doubleBufferMode || _mesa_is_gles(ctx)) {
ctx->Color.DrawBuffer[0] = GL_BACK;
}
else {
ctx->Color.DrawBuffer[0] = GL_FRONT;
}
ctx->Color.ClampFragmentColor = ctx->API == API_OPENGL_COMPAT ?
GL_FIXED_ONLY_ARB : GL_FALSE;
ctx->Color._ClampFragmentColor = GL_FALSE;
ctx->Color.ClampReadColor = GL_FIXED_ONLY_ARB;
/* GLES 1/2/3 behaves as though GL_FRAMEBUFFER_SRGB is always enabled
* if EGL_KHR_gl_colorspace has been used to request sRGB.
*/
ctx->Color.sRGBEnabled = _mesa_is_gles(ctx);
ctx->Color.BlendCoherent = true;
}
示例7: _mesa_init_fog
void _mesa_init_fog( struct gl_context * ctx )
{
/* Fog group */
ctx->Fog.Enabled = GL_FALSE;
ctx->Fog.Mode = GL_EXP;
ASSIGN_4V( ctx->Fog.Color, 0.0, 0.0, 0.0, 0.0 );
ASSIGN_4V( ctx->Fog.ColorUnclamped, 0.0, 0.0, 0.0, 0.0 );
ctx->Fog.Index = 0.0;
ctx->Fog.Density = 1.0;
ctx->Fog.Start = 0.0;
ctx->Fog.End = 1.0;
ctx->Fog.ColorSumEnabled = GL_FALSE;
ctx->Fog.FogCoordinateSource = GL_FRAGMENT_DEPTH_EXT;
ctx->Fog._Scale = 1.0f;
ctx->Fog.FogDistanceMode = GL_EYE_PLANE_ABSOLUTE_NV;
}
示例8: _mesa_Fogiv
void GLAPIENTRY
_mesa_Fogiv(GLenum pname, const GLint *params )
{
GLfloat p[4];
switch (pname) {
case GL_FOG_MODE:
case GL_FOG_DENSITY:
case GL_FOG_START:
case GL_FOG_END:
case GL_FOG_INDEX:
case GL_FOG_COORDINATE_SOURCE_EXT:
p[0] = (GLfloat) *params;
break;
case GL_FOG_COLOR:
p[0] = INT_TO_FLOAT( params[0] );
p[1] = INT_TO_FLOAT( params[1] );
p[2] = INT_TO_FLOAT( params[2] );
p[3] = INT_TO_FLOAT( params[3] );
break;
default:
/* Error will be caught later in _mesa_Fogfv */
ASSIGN_4V(p, 0.0F, 0.0F, 0.0F, 0.0F);
}
_mesa_Fogfv(pname, p);
}
示例9: _mesa_init_transform
/**
* Initialize the context transform attribute group.
*
* \param ctx GL context.
*
* \todo Move this to a new file with other 'transform' routines.
*/
void _mesa_init_transform( GLcontext *ctx )
{
GLint i;
/* Transformation group */
ctx->Transform.MatrixMode = GL_MODELVIEW;
ctx->Transform.Normalize = GL_FALSE;
ctx->Transform.RescaleNormals = GL_FALSE;
ctx->Transform.RasterPositionUnclipped = GL_FALSE;
for (i=0;i<MAX_CLIP_PLANES;i++) {
ASSIGN_4V( ctx->Transform.EyeUserPlane[i], 0.0, 0.0, 0.0, 0.0 );
}
ctx->Transform.ClipPlanesEnabled = 0;
ASSIGN_4V( ctx->Transform.CullObjPos, 0.0, 0.0, 1.0, 0.0 );
ASSIGN_4V( ctx->Transform.CullEyePos, 0.0, 0.0, 1.0, 0.0 );
}
示例10: _mesa_noop_VertexAttrib2fNV
static void GLAPIENTRY _mesa_noop_VertexAttrib2fNV( GLuint index, GLfloat x, GLfloat y )
{
GET_CURRENT_CONTEXT(ctx);
if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) {
ASSIGN_4V(ctx->Current.Attrib[index], x, y, 0, 1);
}
else
_mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib2fNV(index)" );
}
示例11: _mesa_noop_VertexAttrib2fARB
void GLAPIENTRY _mesa_noop_VertexAttrib2fARB( GLuint index, GLfloat x, GLfloat y )
{
GET_CURRENT_CONTEXT(ctx);
if (index < VERT_ATTRIB_MAX) {
ASSIGN_4V(ctx->Current.Attrib[index], x, y, 0, 1);
}
else
_mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib2fARB" );
}
示例12: _mesa_noop_VertexAttrib4fvARB
void GLAPIENTRY _mesa_noop_VertexAttrib4fvARB( GLuint index, const GLfloat *v )
{
GET_CURRENT_CONTEXT(ctx);
if (index < VERT_ATTRIB_MAX) {
ASSIGN_4V(ctx->Current.Attrib[index], v[0], v[1], v[2], v[3]);
}
else
_mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib4fvARB" );
}
示例13: _mesa_noop_VertexAttrib4fvNV
static void GLAPIENTRY _mesa_noop_VertexAttrib4fvNV( GLuint index, const GLfloat *v )
{
GET_CURRENT_CONTEXT(ctx);
if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) {
ASSIGN_4V(ctx->Current.Attrib[index], v[0], v[1], v[2], v[3]);
}
else
_mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib4fvNV(index)" );
}
示例14: _mesa_noop_VertexAttrib4fvARB
static void GLAPIENTRY _mesa_noop_VertexAttrib4fvARB( GLuint index, const GLfloat *v )
{
GET_CURRENT_CONTEXT(ctx);
if (index < MAX_VERTEX_GENERIC_ATTRIBS) {
ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], v[0], v[1], v[2], v[3]);
}
else
_mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib4fvARB(index)" );
}
示例15: _mesa_noop_VertexAttrib2fARB
static void GLAPIENTRY _mesa_noop_VertexAttrib2fARB( GLuint index, GLfloat x, GLfloat y )
{
GET_CURRENT_CONTEXT(ctx);
if (index < MAX_VERTEX_ATTRIBS) {
ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], x, y, 0, 1);
}
else
_mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib2fARB(index)" );
}