这篇教程C++ ASSIGN_4V函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ASSIGN_4V函数的典型用法代码示例。如果您正苦于以下问题:C++ ASSIGN_4V函数的具体用法?C++ ASSIGN_4V怎么用?C++ ASSIGN_4V使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ASSIGN_4V函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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; }}
开发者ID:MttDs,项目名称:new-rexeno-tindpe,代码行数:36,
示例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); }}
开发者ID:basecq,项目名称:q2dos,代码行数:30,
示例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;}
开发者ID:GYGit,项目名称:reactos,代码行数:17,
示例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;}
开发者ID:mdaniel,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:21,
示例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;}
开发者ID:astrofimov,项目名称:vgallium,代码行数:22,
示例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;}
开发者ID:etnaviv,项目名称:mesa,代码行数:57,
示例7: _mesa_init_fogvoid _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;}
开发者ID:FASTCHIP,项目名称:kernel_3.4.67_lenovo_s939_mtk6592,代码行数:16,
示例8: _mesa_Fogivvoid 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);}
开发者ID:chemecse,项目名称:mesa,代码行数:25,
示例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 );}
开发者ID:mariuz,项目名称:haiku,代码行数:24,
示例10: _mesa_noop_VertexAttrib2fNVstatic 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)" );}
开发者ID:AchironOS,项目名称:chromium.src,代码行数:9,
示例11: _mesa_noop_VertexAttrib2fARBvoid 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" );}
开发者ID:Magister,项目名称:x11rdp_xorg71,代码行数:9,
示例12: _mesa_noop_VertexAttrib4fvARBvoid 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" );}
开发者ID:Magister,项目名称:x11rdp_xorg71,代码行数:9,
示例13: _mesa_noop_VertexAttrib4fvNVstatic 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)" );}
开发者ID:AchironOS,项目名称:chromium.src,代码行数:9,
示例14: _mesa_noop_VertexAttrib4fvARBstatic 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)" );}
开发者ID:AchironOS,项目名称:chromium.src,代码行数:9,
示例15: _mesa_noop_VertexAttrib2fARBstatic 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)" );}
开发者ID:Starlink,项目名称:mesa,代码行数:9,
示例16: vbo_exec_do_EvalCoord1fvoid vbo_exec_do_EvalCoord1f(struct vbo_exec_context *exec, GLfloat u){ GLuint attr; for (attr = 1; attr <= VBO_ATTRIB_TEX7; attr++) { struct gl_1d_map *map = exec->eval.map1[attr].map; if (map) { GLfloat uu = (u - map->u1) * map->du; GLfloat data[4]; ASSIGN_4V(data, 0, 0, 0, 1); _math_horner_bezier_curve(map->Points, data, uu, exec->eval.map1[attr].sz, map->Order); COPY_SZ_4V( exec->vtx.attrptr[attr], exec->vtx.attrsz[attr], data ); } } /** Vertex -- EvalCoord1f is a noop if this map not enabled: **/ if (exec->eval.map1[0].map) { struct gl_1d_map *map = exec->eval.map1[0].map; GLfloat uu = (u - map->u1) * map->du; GLfloat vertex[4]; ASSIGN_4V(vertex, 0, 0, 0, 1); _math_horner_bezier_curve(map->Points, vertex, uu, exec->eval.map1[0].sz, map->Order); if (exec->eval.map1[0].sz == 4) CALL_Vertex4fv(GET_DISPATCH(), ( vertex )); else CALL_Vertex3fv(GET_DISPATCH(), ( vertex )); }}
开发者ID:MaikuMori,项目名称:mesa,代码行数:41,
示例17: init_machine/** * Initialize virtual machine state prior to executing vertex program. */static voidinit_machine(struct gl_context *ctx, struct gl_program_machine *machine, GLuint instID){ /* Input registers get initialized from the current vertex attribs */ memcpy(machine->VertAttribs, ctx->Current.Attrib, MAX_VERTEX_GENERIC_ATTRIBS * 4 * sizeof(GLfloat)); if (ctx->VertexProgram._Current->IsNVProgram) { GLuint i; /* Output/result regs are initialized to [0,0,0,1] */ for (i = 0; i < MAX_NV_VERTEX_PROGRAM_OUTPUTS; i++) { ASSIGN_4V(machine->Outputs[i], 0.0F, 0.0F, 0.0F, 1.0F); } /* Temp regs are initialized to [0,0,0,0] */ for (i = 0; i < MAX_NV_VERTEX_PROGRAM_TEMPS; i++) { ASSIGN_4V(machine->Temporaries[i], 0.0F, 0.0F, 0.0F, 0.0F); } for (i = 0; i < MAX_VERTEX_PROGRAM_ADDRESS_REGS; i++) { ASSIGN_4V(machine->AddressReg[i], 0, 0, 0, 0); } } machine->NumDeriv = 0; /* init condition codes */ machine->CondCodes[0] = COND_EQ; machine->CondCodes[1] = COND_EQ; machine->CondCodes[2] = COND_EQ; machine->CondCodes[3] = COND_EQ; /* init call stack */ machine->StackDepth = 0; machine->FetchTexelLod = vp_fetch_texel; machine->FetchTexelDeriv = NULL; /* not used by vertex programs */ machine->Samplers = ctx->VertexProgram._Current->Base.SamplerUnits; machine->SystemValues[SYSTEM_VALUE_INSTANCE_ID][0] = (GLfloat) instID;}
开发者ID:FASTCHIP,项目名称:kernel_3.4.67_lenovo_s939_mtk6592,代码行数:44,
示例18: meta_color_maskstatic void meta_color_mask( struct intel_context *intel, GLboolean state ){ struct brw_context *brw = brw_context(&intel->ctx); if (state) COPY_4V(brw->metaops.attribs.Color->ColorMask, brw->intel.ctx.Color.ColorMask); else ASSIGN_4V(brw->metaops.attribs.Color->ColorMask, 0, 0, 0, 0); brw->state.dirty.mesa |= _NEW_COLOR;}
开发者ID:astrofimov,项目名称:vgallium,代码行数:12,
示例19: _mesa_GetProgramLocalParameterdvARB/** * Note, this function is also used by the GL_NV_fragment_program extension. */void GLAPIENTRY_mesa_GetProgramLocalParameterdvARB(GLenum target, GLuint index, GLdouble *params){ GET_CURRENT_CONTEXT(ctx); GLfloat floatParams[4]; ASSIGN_4V(floatParams, 0.0F, 0.0F, 0.0F, 0.0F); _mesa_GetProgramLocalParameterfvARB(target, index, floatParams); if (ctx->ErrorValue == GL_NO_ERROR) { COPY_4V(params, floatParams); }}
开发者ID:MttDs,项目名称:new-rexeno-tindpe,代码行数:15,
示例20: CALLOC_STRUCTstruct draw_context *draw_create( void ){ struct draw_context *draw = CALLOC_STRUCT( draw_context ); if (draw == NULL) goto fail; ASSIGN_4V( draw->plane[0], -1, 0, 0, 1 ); ASSIGN_4V( draw->plane[1], 1, 0, 0, 1 ); ASSIGN_4V( draw->plane[2], 0, -1, 0, 1 ); ASSIGN_4V( draw->plane[3], 0, 1, 0, 1 ); ASSIGN_4V( draw->plane[4], 0, 0, 1, 1 ); /* yes these are correct */ ASSIGN_4V( draw->plane[5], 0, 0, -1, 1 ); /* mesa's a bit wonky */ draw->nr_planes = 6; draw->reduced_prim = ~0; /* != any of PIPE_PRIM_x */ if (!draw_pipeline_init( draw )) goto fail; if (!draw_pt_init( draw )) goto fail; if (!draw_vs_init( draw )) goto fail; return draw;fail: draw_destroy( draw ); return NULL;}
开发者ID:astrofimov,项目名称:vgallium,代码行数:33,
示例21: _mesa_init_fogvoid _mesa_init_fog( GLcontext * 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 ); 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;}
开发者ID:toastpp,项目名称:toastpp,代码行数:14,
示例22: _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( struct gl_context *ctx ){ GLuint 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<ctx->Const.MaxClipPlanes; i++) { ASSIGN_4V( ctx->Transform.EyeUserPlane[i], 0.0, 0.0, 0.0, 0.0 ); } ctx->Transform.ClipPlanesEnabled = 0;}
开发者ID:krnowak,项目名称:mesa,代码行数:21,
示例23: _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, * __GLcontextRec::Color. */void _mesa_init_color( GLcontext * ctx ){ /* Color buffer group */ ctx->Color.IndexMask = ~0u; ctx->Color.ColorMask[0] = 0xff; ctx->Color.ColorMask[1] = 0xff; ctx->Color.ColorMask[2] = 0xff; ctx->Color.ColorMask[3] = 0xff; ctx->Color.ClearIndex = 0; ASSIGN_4V( ctx->Color.ClearColor, 0, 0, 0, 0 ); ctx->Color.AlphaEnabled = GL_FALSE; ctx->Color.AlphaFunc = GL_ALWAYS; ctx->Color.AlphaRef = 0; ctx->Color.BlendEnabled = GL_FALSE; ctx->Color.BlendSrcRGB = GL_ONE; ctx->Color.BlendDstRGB = GL_ZERO; ctx->Color.BlendSrcA = GL_ONE; ctx->Color.BlendDstA = GL_ZERO; ctx->Color.BlendEquationRGB = GL_FUNC_ADD; ctx->Color.BlendEquationA = GL_FUNC_ADD; ASSIGN_4V( ctx->Color.BlendColor, 0.0, 0.0, 0.0, 0.0 ); ctx->Color.IndexLogicOpEnabled = GL_FALSE; ctx->Color.ColorLogicOpEnabled = GL_FALSE; ctx->Color._LogicOpEnabled = GL_FALSE; ctx->Color.LogicOp = GL_COPY; ctx->Color.DitherFlag = GL_TRUE; if (ctx->Visual.doubleBufferMode) { ctx->Color.DrawBuffer[0] = GL_BACK; } else { ctx->Color.DrawBuffer[0] = GL_FRONT; } ctx->Color.ClampFragmentColor = GL_FIXED_ONLY_ARB; ctx->Color.ClampReadColor = GL_FIXED_ONLY_ARB;}
开发者ID:aljen,项目名称:haiku-opengl,代码行数:45,
示例24: align_mallocstruct aos_machine *draw_vs_aos_machine( void ){ struct aos_machine *machine; unsigned i; float inv = 1.0f/255.0f; float f255 = 255.0f; machine = align_malloc(sizeof(struct aos_machine), 16); if (!machine) return NULL; memset(machine, 0, sizeof(*machine)); ASSIGN_4V(machine->internal[IMM_SWZ], 1.0f, -1.0f, 0.0f, 1.0f); *(unsigned *)&machine->internal[IMM_SWZ][3] = 0xffffffff; ASSIGN_4V(machine->internal[IMM_ONES], 1.0f, 1.0f, 1.0f, 1.0f); ASSIGN_4V(machine->internal[IMM_NEGS], -1.0f, -1.0f, -1.0f, -1.0f); ASSIGN_4V(machine->internal[IMM_IDENTITY], 0.0f, 0.0f, 0.0f, 1.0f); ASSIGN_4V(machine->internal[IMM_INV_255], inv, inv, inv, inv); ASSIGN_4V(machine->internal[IMM_255], f255, f255, f255, f255); ASSIGN_4V(machine->internal[IMM_RSQ], -.5f, 1.5f, 0.0f, 0.0f); machine->fpu_rnd_nearest = (X87_CW_EXCEPTION_INV_OP | X87_CW_EXCEPTION_DENORM_OP | X87_CW_EXCEPTION_ZERO_DIVIDE | X87_CW_EXCEPTION_OVERFLOW | X87_CW_EXCEPTION_UNDERFLOW | X87_CW_EXCEPTION_PRECISION | (1<<6) | X87_CW_ROUND_NEAREST | X87_CW_PRECISION_DOUBLE_EXT); assert(machine->fpu_rnd_nearest == 0x37f); machine->fpu_rnd_neg_inf = (X87_CW_EXCEPTION_INV_OP | X87_CW_EXCEPTION_DENORM_OP | X87_CW_EXCEPTION_ZERO_DIVIDE | X87_CW_EXCEPTION_OVERFLOW | X87_CW_EXCEPTION_UNDERFLOW | X87_CW_EXCEPTION_PRECISION | (1<<6) | X87_CW_ROUND_DOWN | X87_CW_PRECISION_DOUBLE_EXT); for (i = 0; i < MAX_SHINE_TAB; i++) do_populate_lut( &machine->shine_tab[i], 1.0f ); return machine;}
开发者ID:astrofimov,项目名称:vgallium,代码行数:51,
示例25: Parse_SwizzleSuffix/** * Parse a scalar suffix like .x, .y, .z or .w or parse a swizzle suffix * like .wxyz, .xxyy, etc and return the swizzle indexes. */static GLbooleanParse_SwizzleSuffix(const GLubyte *token, GLuint swizzle[4]){ if (token[1] == 0) { /* single letter swizzle (scalar) */ if (token[0] == 'x') ASSIGN_4V(swizzle, 0, 0, 0, 0); else if (token[0] == 'y') ASSIGN_4V(swizzle, 1, 1, 1, 1); else if (token[0] == 'z') ASSIGN_4V(swizzle, 2, 2, 2, 2); else if (token[0] == 'w') ASSIGN_4V(swizzle, 3, 3, 3, 3); else return GL_FALSE; } else { /* 4-component swizzle (vector) */ GLint k; for (k = 0; k < 4 && token[k]; k++) { if (token[k] == 'x') swizzle[k] = 0; else if (token[k] == 'y') swizzle[k] = 1; else if (token[k] == 'z') swizzle[k] = 2; else if (token[k] == 'w') swizzle[k] = 3; else return GL_FALSE; } if (k != 4) return GL_FALSE; } return GL_TRUE;}
开发者ID:GunioRobot,项目名称:mesa-7.10.2-PS3,代码行数:40,
示例26: init_texture_unit/** * Initialize a texture unit. * * /param ctx GL context. * /param unit texture unit number to be initialized. */static voidinit_texture_unit( struct gl_context *ctx, GLuint unit ){ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; GLuint tex; texUnit->EnvMode = GL_MODULATE; ASSIGN_4V( texUnit->EnvColor, 0.0, 0.0, 0.0, 0.0 ); texUnit->Combine = default_combine_state; texUnit->_EnvMode = default_combine_state; texUnit->_CurrentCombine = & texUnit->_EnvMode; texUnit->TexGenEnabled = 0x0; texUnit->GenS.Mode = GL_EYE_LINEAR; texUnit->GenT.Mode = GL_EYE_LINEAR; texUnit->GenR.Mode = GL_EYE_LINEAR; texUnit->GenQ.Mode = GL_EYE_LINEAR; texUnit->GenS._ModeBit = TEXGEN_EYE_LINEAR; texUnit->GenT._ModeBit = TEXGEN_EYE_LINEAR; texUnit->GenR._ModeBit = TEXGEN_EYE_LINEAR; texUnit->GenQ._ModeBit = TEXGEN_EYE_LINEAR; /* Yes, these plane coefficients are correct! */ ASSIGN_4V( texUnit->GenS.ObjectPlane, 1.0, 0.0, 0.0, 0.0 ); ASSIGN_4V( texUnit->GenT.ObjectPlane, 0.0, 1.0, 0.0, 0.0 ); ASSIGN_4V( texUnit->GenR.ObjectPlane, 0.0, 0.0, 0.0, 0.0 ); ASSIGN_4V( texUnit->GenQ.ObjectPlane, 0.0, 0.0, 0.0, 0.0 ); ASSIGN_4V( texUnit->GenS.EyePlane, 1.0, 0.0, 0.0, 0.0 ); ASSIGN_4V( texUnit->GenT.EyePlane, 0.0, 1.0, 0.0, 0.0 ); ASSIGN_4V( texUnit->GenR.EyePlane, 0.0, 0.0, 0.0, 0.0 ); ASSIGN_4V( texUnit->GenQ.EyePlane, 0.0, 0.0, 0.0, 0.0 ); /* initialize current texture object ptrs to the shared default objects */ for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) { _mesa_reference_texobj(&texUnit->CurrentTex[tex], ctx->Shared->DefaultTex[tex]); } texUnit->_BoundTextures = 0;}
开发者ID:karolherbst,项目名称:mesa,代码行数:47,
示例27: _playback_copy_to_currentstatic void _playback_copy_to_current( GLcontext *ctx, const struct tnl_vertex_list *node ){ TNLcontext *tnl = TNL_CONTEXT(ctx); const GLfloat *data; GLuint i; if (node->count) data = node->buffer + (node->count-1) * node->vertex_size; else data = node->buffer; for (i = _TNL_ATTRIB_POS+1 ; i <= _TNL_ATTRIB_INDEX ; i++) { if (node->attrsz[i]) { ASSIGN_4V(tnl->vtx.current[i], 0, 0, 0, 1); COPY_SZ_4V(tnl->vtx.current[i], node->attrsz[i], data); data += node->attrsz[i]; } } /* Edgeflag requires special treatment: */ if (node->attrsz[_TNL_ATTRIB_EDGEFLAG]) { ctx->Current.EdgeFlag = (data[0] == 1.0); } /* Colormaterial -- this kindof sucks. */ if (ctx->Light.ColorMaterialEnabled) { _mesa_update_color_material(ctx, ctx->Current.Attrib[VERT_ATTRIB_COLOR0]); } if (node->have_materials) { tnl->Driver.NotifyMaterialChange( ctx ); } /* CurrentExecPrimitive */ if (node->prim_count) { GLenum mode = node->prim[node->prim_count - 1].mode; if (mode & PRIM_END) ctx->Driver.CurrentExecPrimitive = PRIM_OUTSIDE_BEGIN_END; else ctx->Driver.CurrentExecPrimitive = (mode & PRIM_MODE_MASK); }}
开发者ID:basecq,项目名称:q2dos,代码行数:46,
注:本文中的ASSIGN_4V函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ ASSIGN_STATE函数代码示例 C++ ASSERTne函数代码示例 |