本文整理汇总了C++中TDFX_CONTEXT函数的典型用法代码示例。如果您正苦于以下问题:C++ TDFX_CONTEXT函数的具体用法?C++ TDFX_CONTEXT怎么用?C++ TDFX_CONTEXT使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TDFX_CONTEXT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: copy_pv
static void copy_pv( GLcontext *ctx, GLuint edst, GLuint esrc )
{
tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
tdfxVertex *dst = fxMesa->verts + edst;
tdfxVertex *src = fxMesa->verts + esrc;
*(GLuint *)&dst->color = *(GLuint *)&src->color;
}
示例2: tdfxDDDepthFunc
static void tdfxDDDepthFunc( GLcontext *ctx, GLenum func )
{
tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
FLUSH_BATCH( fxMesa );
fxMesa->new_state |= TDFX_NEW_DEPTH;
}
示例3: tdfxCheckTexSizes
void tdfxCheckTexSizes( GLcontext *ctx )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
if (!setup_tab[fxMesa->SetupIndex].check_tex_sizes(ctx)) {
GLuint ind = fxMesa->SetupIndex |= (TDFX_PTEX_BIT|TDFX_RGBA_BIT);
/* Tdfx handles projective textures nicely; just have to change
* up to the new vertex format.
*/
if (setup_tab[ind].vertex_format != fxMesa->vertexFormat) {
FLUSH_BATCH(fxMesa);
fxMesa->dirty |= TDFX_UPLOAD_VERTEX_LAYOUT;
fxMesa->vertexFormat = setup_tab[ind].vertex_format;
/* This is required as we have just changed the vertex
* format, so the interp and copy routines must also change.
* In the unfilled and twosided cases we are using the
* swrast_setup ones anyway, so leave them in place.
*/
if (!(ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) {
tnl->Driver.Render.Interp = setup_tab[fxMesa->SetupIndex].interp;
tnl->Driver.Render.CopyPV = setup_tab[fxMesa->SetupIndex].copy_pv;
}
}
}
}
示例4: tdfxDDStencilMask
static void tdfxDDStencilMask( GLcontext *ctx, GLuint mask )
{
tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
FLUSH_BATCH( fxMesa );
fxMesa->new_state |= TDFX_NEW_STENCIL;
}
示例5: tdfxDDFrontFace
static void tdfxDDFrontFace( GLcontext *ctx, GLenum mode )
{
tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
FLUSH_BATCH( fxMesa );
fxMesa->new_state |= TDFX_NEW_CULL;
}
示例6: tdfxDDDepthMask
static void tdfxDDDepthMask( GLcontext *ctx, GLboolean flag )
{
tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
FLUSH_BATCH( fxMesa );
fxMesa->new_state |= TDFX_NEW_DEPTH;
}
示例7: tdfxDDClearDepth
static void tdfxDDClearDepth( GLcontext *ctx, GLclampd d )
{
tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
FLUSH_BATCH( fxMesa );
fxMesa->new_state |= TDFX_NEW_DEPTH;
}
示例8: tdfxDDFogfv
static void tdfxDDFogfv( GLcontext *ctx, GLenum pname, const GLfloat *param )
{
tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
FLUSH_BATCH( fxMesa );
fxMesa->new_state |= TDFX_NEW_FOG;
switch (pname) {
case GL_FOG_COORDINATE_SOURCE_EXT: {
GLenum p = (GLenum)*param;
if (p == GL_FOG_COORDINATE_EXT) {
_swrast_allow_vertex_fog(ctx, GL_TRUE);
_swrast_allow_pixel_fog(ctx, GL_FALSE);
_tnl_allow_vertex_fog( ctx, GL_TRUE);
_tnl_allow_pixel_fog( ctx, GL_FALSE);
} else {
_swrast_allow_vertex_fog(ctx, GL_FALSE);
_swrast_allow_pixel_fog(ctx, GL_TRUE);
_tnl_allow_vertex_fog( ctx, GL_FALSE);
_tnl_allow_pixel_fog( ctx, GL_TRUE);
}
break;
}
default:
;
}
}
示例9: tdfxDDAlphaFunc
static void tdfxDDAlphaFunc( GLcontext *ctx, GLenum func, GLfloat ref )
{
tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
FLUSH_BATCH( fxMesa );
fxMesa->new_state |= TDFX_NEW_ALPHA;
}
示例10: tdfxDDScissor
static void
tdfxDDScissor(GLcontext * ctx, GLint x, GLint y, GLsizei w, GLsizei h)
{
tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
FLUSH_BATCH( fxMesa );
fxMesa->new_state |= TDFX_NEW_CLIP;
}
示例11: tdfxDDColorMask
static void tdfxDDColorMask( GLcontext *ctx,
GLboolean r, GLboolean g,
GLboolean b, GLboolean a )
{
tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
FLUSH_BATCH( fxMesa );
if ( fxMesa->Color.ColorMask[RCOMP] != r ||
fxMesa->Color.ColorMask[GCOMP] != g ||
fxMesa->Color.ColorMask[BCOMP] != b ||
fxMesa->Color.ColorMask[ACOMP] != a ) {
fxMesa->Color.ColorMask[RCOMP] = r;
fxMesa->Color.ColorMask[GCOMP] = g;
fxMesa->Color.ColorMask[BCOMP] = b;
fxMesa->Color.ColorMask[ACOMP] = a;
fxMesa->dirty |= TDFX_UPLOAD_COLOR_MASK;
if (ctx->Visual.redBits < 8) {
/* Can't do RGB colormasking in 16bpp mode. */
/* We can completely ignore the alpha mask. */
FALLBACK( fxMesa, TDFX_FALLBACK_COLORMASK, (r != g || g != b) );
}
}
}
示例12: tdfxDDDrawBuffer
/* XXX support for separate read/draw buffers hasn't been tested */
static void tdfxDDDrawBuffer( GLcontext *ctx, GLenum mode )
{
tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
if ( TDFX_DEBUG & DEBUG_VERBOSE_API ) {
fprintf( stderr, "%s()\n", __FUNCTION__ );
}
FLUSH_BATCH( fxMesa );
if (ctx->DrawBuffer->_NumColorDrawBuffers > 1) {
FALLBACK( fxMesa, TDFX_FALLBACK_DRAW_BUFFER, GL_TRUE );
return;
}
switch ( ctx->DrawBuffer->_ColorDrawBufferIndexes[0] ) {
case BUFFER_FRONT_LEFT:
fxMesa->DrawBuffer = fxMesa->ReadBuffer = GR_BUFFER_FRONTBUFFER;
fxMesa->new_state |= TDFX_NEW_RENDER;
FALLBACK( fxMesa, TDFX_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;
case BUFFER_BACK_LEFT:
fxMesa->DrawBuffer = fxMesa->ReadBuffer = GR_BUFFER_BACKBUFFER;
fxMesa->new_state |= TDFX_NEW_RENDER;
FALLBACK( fxMesa, TDFX_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;
case -1:
FX_grColorMaskv( ctx, false4 );
FALLBACK( fxMesa, TDFX_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;
default:
FALLBACK( fxMesa, TDFX_FALLBACK_DRAW_BUFFER, GL_TRUE );
break;
}
}
示例13: tdfxEndQuery
static void
tdfxEndQuery(GLcontext *ctx, struct gl_query_object *q)
{
tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
FxI32 total_pixels;
FxI32 z_fail_pixels;
if (q->Target == GL_SAMPLES_PASSED_ARB) {
LOCK_HARDWARE(fxMesa);
fxMesa->Glide.grFinish();
fxMesa->Glide.grGet(GR_STATS_PIXELS_DEPTHFUNC_FAIL, sizeof(FxI32),
&z_fail_pixels);
fxMesa->Glide.grGet(GR_STATS_PIXELS_IN, sizeof(FxI32), &total_pixels);
q->Result = total_pixels - z_fail_pixels;
/* Apparently, people have seen z_fail_pixels > total_pixels under
* some conditions on some 3Dfx hardware. The occlusion query spec
* requires that we clamp to 0.
*/
if (q->Result < 0) {
q->Result = 0;
}
q->Ready = GL_TRUE;
UNLOCK_HARDWARE(fxMesa);
}
}
示例14: tdfxDDViewport
static void tdfxDDViewport( GLcontext *ctx, GLint x, GLint y,
GLsizei w, GLsizei h )
{
tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
FLUSH_BATCH( fxMesa );
fxMesa->new_state |= TDFX_NEW_VIEWPORT;
}
示例15: tdfxDDInvalidateState
static void tdfxDDInvalidateState( GLcontext *ctx, GLuint new_state )
{
_swrast_InvalidateState( ctx, new_state );
_swsetup_InvalidateState( ctx, new_state );
_vbo_InvalidateState( ctx, new_state );
_tnl_InvalidateState( ctx, new_state );
TDFX_CONTEXT(ctx)->new_gl_state |= new_state;
}