本文整理汇总了C++中qglDisableClientState函数的典型用法代码示例。如果您正苦于以下问题:C++ qglDisableClientState函数的具体用法?C++ qglDisableClientState怎么用?C++ qglDisableClientState使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了qglDisableClientState函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: DrawTris
/*
================
DrawTris
Draws triangle outlines for debugging
================
*/
static void DrawTris (shaderCommands_t *input) {
GL_Bind( tr.whiteImage );
qglColor3f (1,1,1);
GL_State( GLS_POLYMODE_LINE | GLS_DEPTHMASK_TRUE );
qglDepthRange( 0, 0 );
qglDisableClientState (GL_COLOR_ARRAY);
qglDisableClientState (GL_TEXTURE_COORD_ARRAY);
qglVertexPointer (3, GL_FLOAT, 16, input->xyz); // padded for SIMD
if (qglLockArraysEXT) {
qglLockArraysEXT(0, input->numVertexes);
GLimp_LogComment( "glLockArraysEXT\n" );
}
#ifdef HAVE_GLES
qglDrawElements( GL_LINE_STRIP,
input->numIndexes,
GL_INDEX_TYPE,
input->indexes );
#else
R_DrawElements( input->numIndexes, input->indexes );
#endif
if (qglUnlockArraysEXT) {
qglUnlockArraysEXT();
GLimp_LogComment( "glUnlockArraysEXT\n" );
}
qglDepthRange( 0, 1 );
}
开发者ID:ptitSeb,项目名称:ioq3,代码行数:39,代码来源:tr_shade.c
示例2: DrawSkySide
static void DrawSkySide( struct image_s *image, const int mins[2], const int maxs[2] )
{
int s, t;
GL_Bind( image );
#ifdef HAVE_GLES
GLfloat vtx[3*1024]; // arbitrary sized
GLfloat tex[2*1024];
int idx;
GLboolean text = qglIsEnabled(GL_TEXTURE_COORD_ARRAY);
GLboolean glcol = qglIsEnabled(GL_COLOR_ARRAY);
if (glcol)
qglDisableClientState(GL_COLOR_ARRAY);
if (!text)
qglEnableClientState( GL_TEXTURE_COORD_ARRAY );
#endif
for ( t = mins[1]+HALF_SKY_SUBDIVISIONS; t < maxs[1]+HALF_SKY_SUBDIVISIONS; t++ )
{
#ifdef HAVE_GLES
idx=0;
#else
qglBegin( GL_TRIANGLE_STRIP );
#endif
for ( s = mins[0]+HALF_SKY_SUBDIVISIONS; s <= maxs[0]+HALF_SKY_SUBDIVISIONS; s++ )
{
#ifdef HAVE_GLES
memcpy(tex+idx*2, s_skyTexCoords[t][s], sizeof(GLfloat)*2);
memcpy(vtx+idx*3, s_skyPoints[t][s], sizeof(GLfloat)*3);
idx++;
memcpy(tex+idx*2, s_skyTexCoords[t+1][s], sizeof(GLfloat)*2);
memcpy(vtx+idx*3, s_skyPoints[t+1][s], sizeof(GLfloat)*3);
idx++;
#else
qglTexCoord2fv( s_skyTexCoords[t][s] );
qglVertex3fv( s_skyPoints[t][s] );
qglTexCoord2fv( s_skyTexCoords[t+1][s] );
qglVertex3fv( s_skyPoints[t+1][s] );
#endif
}
#ifdef HAVE_GLES
//*TODO* Try to switch from many DrawArrays of GL_TRIANGLE_STRIP to a single DrawArrays of TRIANGLES to see if it perform better
qglVertexPointer (3, GL_FLOAT, 0, vtx);
qglTexCoordPointer(2, GL_FLOAT, 0, tex);
qglDrawArrays(GL_TRIANGLE_STRIP, 0, idx);
#else
qglEnd();
#endif
}
#ifdef HAVE_GLES
if (glcol)
qglEnableClientState(GL_COLOR_ARRAY);
if (!text)
qglDisableClientState( GL_TEXTURE_COORD_ARRAY );
#endif
}
开发者ID:ptitSeb,项目名称:ioq3,代码行数:60,代码来源:tr_sky.c
示例3: DrawCel
//DRAWCEL
static void DrawCel (shaderCommands_t *input) {
GL_Bind( tr.whiteImage );
qglColor3f (1,1,1);
GL_State( GLS_POLYMODE_LINE | GLS_DEPTHMASK_TRUE );
qglDisableClientState (GL_COLOR_ARRAY);
qglDisableClientState (GL_TEXTURE_COORD_ARRAY);
qglVertexPointer (3, GL_FLOAT, 16, input->xyz); // padded for SIMD
if (qglLockArraysEXT) {
qglLockArraysEXT(0, input->numVertexes);
GLimp_LogComment( "glLockArraysEXT\n" );
}
R_DrawCel( input->numIndexes, input->indexes );
if (qglUnlockArraysEXT) {
qglUnlockArraysEXT();
GLimp_LogComment( "glUnlockArraysEXT\n" );
}
}
开发者ID:massivehaxxor,项目名称:tremfusion,代码行数:26,代码来源:tr_shade.c
示例4: RB_NV20_DI_DiffuseColorPass
/*
==================
RB_NV20_DI_DiffuseColorPass
==================
*/
static void RB_NV20_DI_DiffuseColorPass(const drawInteraction_t *din)
{
RB_LogComment("---------- RB_NV20_DiffuseColorPass ----------\n");
GL_State(GLS_SRCBLEND_DST_ALPHA | GLS_DSTBLEND_ONE | GLS_DEPTHMASK | GLS_ALPHAMASK
| backEnd.depthFunc);
// texture 0 will be the per-surface diffuse map
#ifdef MACOS_X
GL_SelectTexture(0);
qglEnableClientState(GL_TEXTURE_COORD_ARRAY);
#else
GL_SelectTextureNoClient(0);
#endif
din->diffuseImage->Bind();
// texture 1 will be the light projected texture
#ifdef MACOS_X
GL_SelectTexture(1);
qglEnableClientState(GL_TEXTURE_COORD_ARRAY);
#else
GL_SelectTextureNoClient(1);
#endif
din->lightImage->Bind();
// texture 2 is disabled
#ifdef MACOS_X
GL_SelectTexture(2);
qglDisableClientState(GL_TEXTURE_COORD_ARRAY);
#else
GL_SelectTextureNoClient(2);
#endif
globalImages->BindNull();
// texture 3 is disabled
#ifdef MACOS_X
GL_SelectTexture(3);
qglDisableClientState(GL_TEXTURE_COORD_ARRAY);
#else
GL_SelectTextureNoClient(3);
#endif
globalImages->BindNull();
// bind our "fragment program"
RB_NV20_DiffuseColorFragment();
// override one parameter for inverted vertex color
if (din->vertexColor == SVC_INVERSE_MODULATE) {
qglCombinerInputNV(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_B_NV,
GL_PRIMARY_COLOR_NV, GL_UNSIGNED_INVERT_NV, GL_RGB);
}
// draw it
qglBindProgramARB(GL_VERTEX_PROGRAM_ARB, VPROG_NV20_DIFFUSE_COLOR);
RB_DrawElementsWithCounters(din->surf->geo);
}
开发者ID:AreaScout,项目名称:dante-doom3-odroid,代码行数:62,代码来源:draw_nv20.cpp
示例5: RB_ShadowFinish
/*
=================
RB_ShadowFinish
Darken everything that is is a shadow volume.
We have to delay this until everything has been shadowed,
because otherwise shadows from different body parts would
overlap and double darken.
=================
*/
void RB_ShadowFinish(void)
{
if (r_shadows->integer != 2)
{
return;
}
if (glConfig.stencilBits < 4)
{
return;
}
qglEnable(GL_STENCIL_TEST);
qglStencilFunc(GL_NOTEQUAL, 0, 255);
qglDisable(GL_CLIP_PLANE0);
qglDisable(GL_CULL_FACE);
GL_Bind(tr.whiteImage);
qglLoadIdentity();
qglColor3f(0.6f, 0.6f, 0.6f);
GL_State(GLS_DEPTHMASK_TRUE | GLS_SRCBLEND_DST_COLOR | GLS_DSTBLEND_ZERO);
GLboolean text = qglIsEnabled(GL_TEXTURE_COORD_ARRAY);
GLboolean glcol = qglIsEnabled(GL_COLOR_ARRAY);
if (text)
{
qglDisableClientState(GL_TEXTURE_COORD_ARRAY);
}
if (glcol)
{
qglDisableClientState(GL_COLOR_ARRAY);
}
GLfloat vtx[] =
{
-100, 100, -10,
100, 100, -10,
100, -100, -10,
-100, -100, -10
};
qglVertexPointer(3, GL_FLOAT, 0, vtx);
qglDrawArrays(GL_TRIANGLE_FAN, 0, 4);
if (text)
{
qglEnableClientState(GL_TEXTURE_COORD_ARRAY);
}
if (glcol)
{
qglEnableClientState(GL_COLOR_ARRAY);
}
qglColor4f(1, 1, 1, 1);
qglDisable(GL_STENCIL_TEST);
}
开发者ID:Mailaender,项目名称:etlegacy,代码行数:64,代码来源:tr_shadows.c
示例6: DrawSkySide
static void DrawSkySide( struct image_s *image, const int mins[2], const int maxs[2] )
{
int s, t, i = 0;
int size;
glIndex_t *indicies;
size = (maxs[1] - mins[1]) * (maxs[0] - mins[0] + 1);
indicies = ri.Hunk_AllocateTempMemory(sizeof(glIndex_t) * size);
GL_Bind( image );
for ( t = mins[1]+HALF_SKY_SUBDIVISIONS; t < maxs[1]+HALF_SKY_SUBDIVISIONS; t++ )
{
for ( s = mins[0]+HALF_SKY_SUBDIVISIONS; s <= maxs[0]+HALF_SKY_SUBDIVISIONS; s++ )
{
indicies[i++] = t * (SKY_SUBDIVISIONS + 1) + s;
indicies[i++] = (t + 1) * (SKY_SUBDIVISIONS + 1) + s;
}
}
qglDisableClientState(GL_COLOR_ARRAY);
qglEnableClientState(GL_TEXTURE_COORD_ARRAY);
qglTexCoordPointer(2, GL_FLOAT, 0, s_skyTexCoords);
qglVertexPointer(3, GL_FLOAT, 0, s_skyPoints);
qglDrawElements(GL_TRIANGLE_STRIP, i, GL_INDEX_TYPE, indicies);
Hunk_FreeTempMemory(indicies);
}
开发者ID:AbandonedCart,项目名称:XperiaPlayNative,代码行数:27,代码来源:tr_sky.c
示例7: RB_FinishStageTexture
/*
======================
RB_FinishStageTexture
======================
*/
void RB_FinishStageTexture( const textureStage_t *texture, const drawSurf_t *surf ) {
if ( texture->texgen == TG_DIFFUSE_CUBE || texture->texgen == TG_SKYBOX_CUBE
|| texture->texgen == TG_WOBBLESKY_CUBE ) {
qglTexCoordPointer( 2, GL_FLOAT, sizeof( idDrawVert ),
(void *)&(((idDrawVert *)vertexCache.Position( surf->geo->ambientCache ))->st) );
}
if ( texture->texgen == TG_REFLECT_CUBE ) {
qglDisable( GL_TEXTURE_GEN_S );
qglDisable( GL_TEXTURE_GEN_T );
qglDisable( GL_TEXTURE_GEN_R );
qglTexGenf( GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
qglTexGenf( GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
qglTexGenf( GL_R, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
qglDisableClientState( GL_NORMAL_ARRAY );
qglMatrixMode( GL_TEXTURE );
qglLoadIdentity();
qglMatrixMode( GL_MODELVIEW );
}
if ( texture->hasMatrix ) {
qglMatrixMode( GL_TEXTURE );
qglLoadIdentity();
qglMatrixMode( GL_MODELVIEW );
}
}
开发者ID:0culus,项目名称:Doom3-for-MacOSX-,代码行数:32,代码来源:tr_render.cpp
示例8: RB_DrawMeshTris
/*
=============
RB_DrawMeshTris
Re-draws a mesh in outline mode
=============
*/
void RB_DrawMeshTris (void)
{
int i, numTMUs = 0;
if (!r_showtris->value)
return;
if (r_showtris->value == 1)
GL_Disable(GL_DEPTH_TEST);
qglPolygonMode (GL_FRONT_AND_BACK, GL_LINE);
for (i=0; i<glConfig.max_texunits; i++)
if (glState.activetmu[i])
{ numTMUs++; GL_DisableTexture (i); }
qglDisableClientState (GL_COLOR_ARRAY);
qglColor4f(1.0, 1.0, 1.0, 1.0);
RB_DrawArrays ();
qglEnableClientState (GL_COLOR_ARRAY);
for (i=0; i<numTMUs; i++)
GL_EnableTexture(i);
qglPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
if (r_showtris->value == 1)
GL_Enable(GL_DEPTH_TEST);
}
开发者ID:Kiln707,项目名称:KMQuake2,代码行数:33,代码来源:r_backend.c
示例9: RB_DrawMeshTris
/*
=============
RB_DrawMeshTris
Re-draws a mesh in outline mode
=============
*/
void RB_DrawMeshTris (GLenum polyMode, int numTMUs)
{
int i;
if (!r_showtris->value)
return;
if (r_showtris->value == 1)
GL_Disable(GL_DEPTH_TEST);
qglPolygonMode (GL_FRONT_AND_BACK, GL_LINE);
for (i=0; i<numTMUs; i++)
GL_DisableTexture (i);
qglDisableClientState (GL_COLOR_ARRAY);
qglColor4f(1.0, 1.0, 1.0, 1.0);
RB_DrawArrays(polyMode);
qglEnableClientState (GL_COLOR_ARRAY);
for (i=0; i<numTMUs; i++)
GL_EnableTexture(i);
qglPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
if (r_showtris->value == 1)
GL_Enable(GL_DEPTH_TEST);
}
开发者ID:AimHere,项目名称:thirty-flights-of-linux,代码行数:32,代码来源:r_backend.c
示例10: RB_SetDefaultGLState
/*
======================
RB_SetDefaultGLState
This should initialize all GL state that any part of the entire program
may touch, including the editor.
======================
*/
void RB_SetDefaultGLState( void ) {
int i;
RB_LogComment( "--- R_SetDefaultGLState ---\n" );
qglClearDepth( 1.0f );
qglColor4f (1,1,1,1);
// the vertex array is always enabled
qglEnableClientState( GL_VERTEX_ARRAY );
qglEnableClientState( GL_TEXTURE_COORD_ARRAY );
qglDisableClientState( GL_COLOR_ARRAY );
//
// make sure our GL state vector is set correctly
//
memset( &backEnd.glState, 0, sizeof( backEnd.glState ) );
backEnd.glState.forceGlState = true;
qglColorMask( 1, 1, 1, 1 );
qglEnable( GL_DEPTH_TEST );
qglEnable( GL_BLEND );
qglEnable( GL_SCISSOR_TEST );
qglEnable( GL_CULL_FACE );
qglDisable( GL_LIGHTING );
qglDisable( GL_LINE_STIPPLE );
qglDisable( GL_STENCIL_TEST );
qglPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
qglDepthMask( GL_TRUE );
qglDepthFunc( GL_ALWAYS );
qglCullFace( GL_FRONT_AND_BACK );
qglShadeModel( GL_SMOOTH );
if ( r_useScissor.GetBool() ) {
qglScissor( 0, 0, glConfig.vidWidth, glConfig.vidHeight );
}
for ( i = glConfig.maxTextureUnits - 1 ; i >= 0 ; i-- ) {
GL_SelectTexture( i );
// object linear texgen is our default
qglTexGenf( GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
qglTexGenf( GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
qglTexGenf( GL_R, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
qglTexGenf( GL_Q, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
GL_TexEnv( GL_MODULATE );
qglDisable( GL_TEXTURE_2D );
if ( glConfig.texture3DAvailable ) {
qglDisable( GL_TEXTURE_3D );
}
if ( glConfig.cubeMapAvailable ) {
qglDisable( GL_TEXTURE_CUBE_MAP_EXT );
}
}
}
开发者ID:albertz,项目名称:iodoom3,代码行数:67,代码来源:tr_backend.cpp
示例11: RB_NV20_DrawInteraction
/*
==================
RB_NV20_DrawInteraction
==================
*/
static void RB_NV20_DrawInteraction(const drawInteraction_t *din)
{
const drawSurf_t *surf = din->surf;
// load all the vertex program parameters
qglProgramEnvParameter4fvARB(GL_VERTEX_PROGRAM_ARB, PP_LIGHT_ORIGIN, din->localLightOrigin.ToFloatPtr());
qglProgramEnvParameter4fvARB(GL_VERTEX_PROGRAM_ARB, PP_VIEW_ORIGIN, din->localViewOrigin.ToFloatPtr());
qglProgramEnvParameter4fvARB(GL_VERTEX_PROGRAM_ARB, PP_LIGHT_PROJECT_S, din->lightProjection[0].ToFloatPtr());
qglProgramEnvParameter4fvARB(GL_VERTEX_PROGRAM_ARB, PP_LIGHT_PROJECT_T, din->lightProjection[1].ToFloatPtr());
qglProgramEnvParameter4fvARB(GL_VERTEX_PROGRAM_ARB, PP_LIGHT_PROJECT_Q, din->lightProjection[2].ToFloatPtr());
qglProgramEnvParameter4fvARB(GL_VERTEX_PROGRAM_ARB, PP_LIGHT_FALLOFF_S, din->lightProjection[3].ToFloatPtr());
qglProgramEnvParameter4fvARB(GL_VERTEX_PROGRAM_ARB, PP_BUMP_MATRIX_S, din->bumpMatrix[0].ToFloatPtr());
qglProgramEnvParameter4fvARB(GL_VERTEX_PROGRAM_ARB, PP_BUMP_MATRIX_T, din->bumpMatrix[1].ToFloatPtr());
qglProgramEnvParameter4fvARB(GL_VERTEX_PROGRAM_ARB, PP_DIFFUSE_MATRIX_S, din->diffuseMatrix[0].ToFloatPtr());
qglProgramEnvParameter4fvARB(GL_VERTEX_PROGRAM_ARB, PP_DIFFUSE_MATRIX_T, din->diffuseMatrix[1].ToFloatPtr());
qglProgramEnvParameter4fvARB(GL_VERTEX_PROGRAM_ARB, PP_SPECULAR_MATRIX_S, din->specularMatrix[0].ToFloatPtr());
qglProgramEnvParameter4fvARB(GL_VERTEX_PROGRAM_ARB, PP_SPECULAR_MATRIX_T, din->specularMatrix[1].ToFloatPtr());
// set the constant colors
qglCombinerParameterfvNV(GL_CONSTANT_COLOR0_NV, din->diffuseColor.ToFloatPtr());
qglCombinerParameterfvNV(GL_CONSTANT_COLOR1_NV, din->specularColor.ToFloatPtr());
// vertex color passes should be pretty rare (cross-faded bump map surfaces), so always
// run them down as three-passes
if (din->vertexColor != SVC_IGNORE) {
qglEnableClientState(GL_COLOR_ARRAY);
RB_NV20_DI_BumpAndLightPass(din, false);
RB_NV20_DI_DiffuseColorPass(din);
RB_NV20_DI_SpecularColorPass(din);
qglDisableClientState(GL_COLOR_ARRAY);
return;
}
qglColor3f(1, 1, 1);
// on an ideal card, we would now just bind the textures and call a
// single pass vertex / fragment program, but
// on NV20, we need to decide which single / dual / tripple pass set of programs to use
// ambient light could be done as a single pass if we want to optimize for it
// monochrome light is two passes
int internalFormat = din->lightImage->internalFormat;
if ((r_useNV20MonoLights.GetInteger() == 2) ||
(din->lightImage->isMonochrome && r_useNV20MonoLights.GetInteger())) {
// do a two-pass rendering
RB_NV20_DI_BumpAndLightPass(din, true);
RB_NV20_DI_DiffuseAndSpecularColorPass(din);
} else {
// general case is three passes
// ( bump dot lightDir ) * lightFalloff
// diffuse * lightProject
// specular * ( bump dot halfAngle extended ) * lightProject
RB_NV20_DI_BumpAndLightPass(din, false);
RB_NV20_DI_DiffuseColorPass(din);
RB_NV20_DI_SpecularColorPass(din);
}
}
开发者ID:AreaScout,项目名称:dante-doom3-odroid,代码行数:64,代码来源:draw_nv20.cpp
示例12: RB_StencilShadowPass
/*
=====================
RB_StencilShadowPass
Stencil test should already be enabled, and the stencil buffer should have
been set to 128 on any surfaces that might receive shadows
=====================
*/
void RB_StencilShadowPass(const drawSurf_t *drawSurfs)
{
if (!r_shadows.GetBool()) {
return;
}
if (!drawSurfs) {
return;
}
RB_LogComment("---------- RB_StencilShadowPass ----------\n");
globalImages->BindNull();
qglDisableClientState(GL_TEXTURE_COORD_ARRAY);
// for visualizing the shadows
if (r_showShadows.GetInteger()) {
if (r_showShadows.GetInteger() == 2) {
// draw filled in
GL_State(GLS_DEPTHMASK | GLS_SRCBLEND_ONE | GLS_DSTBLEND_ONE | GLS_DEPTHFUNC_LESS);
} else {
// draw as lines, filling the depth buffer
GL_State(GLS_SRCBLEND_ONE | GLS_DSTBLEND_ZERO | GLS_POLYMODE_LINE | GLS_DEPTHFUNC_ALWAYS);
}
} else {
// don't write to the color buffer, just the stencil buffer
GL_State(GLS_DEPTHMASK | GLS_COLORMASK | GLS_ALPHAMASK | GLS_DEPTHFUNC_LESS);
}
if (r_shadowPolygonFactor.GetFloat() || r_shadowPolygonOffset.GetFloat()) {
qglPolygonOffset(r_shadowPolygonFactor.GetFloat(), -r_shadowPolygonOffset.GetFloat());
qglEnable(GL_POLYGON_OFFSET_FILL);
}
qglStencilFunc(GL_ALWAYS, 1, 255);
if (glConfig.depthBoundsTestAvailable && r_useDepthBoundsTest.GetBool()) {
qglEnable(GL_DEPTH_BOUNDS_TEST_EXT);
}
RB_RenderDrawSurfChainWithFunction(drawSurfs, RB_T_Shadow);
GL_Cull(CT_FRONT_SIDED);
if (r_shadowPolygonFactor.GetFloat() || r_shadowPolygonOffset.GetFloat()) {
qglDisable(GL_POLYGON_OFFSET_FILL);
}
if (glConfig.depthBoundsTestAvailable && r_useDepthBoundsTest.GetBool()) {
qglDisable(GL_DEPTH_BOUNDS_TEST_EXT);
}
qglEnableClientState(GL_TEXTURE_COORD_ARRAY);
qglStencilFunc(GL_GEQUAL, 128, 255);
qglStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
}
开发者ID:AreaScout,项目名称:dante-doom3-odroid,代码行数:65,代码来源:draw_common.cpp
示例13: RB_OutlinesPass
/*
===================
RB_OutlinesPass
Draws outlines on surfaces with shader.hasOutlines set
===================
*/
static void RB_OutlinesPass( void ) {
int outlines;
float outlinesAlpha;
outlines = r_outlines->value;
outlinesAlpha = r_outlinesAlpha->value;
if ( !tess.shader->hasOutlines )
return;
if ( !r_outlines->integer )
return;
GL_Bind( tr.whiteImage );
qglColor4f( 0, 0, 0, outlinesAlpha );
GL_State( GLS_POLYMODE_LINE | GLS_DEPTHMASK_TRUE | GLS_SRCBLEND_SRC_ALPHA | GLS_DSTBLEND_ONE_MINUS_SRC_ALPHA );
qglPolygonMode( GL_BACK, GL_LINE );
qglLineWidth( outlines + 1 );
qglCullFace( GL_BACK );
qglDisableClientState( GL_COLOR_ARRAY );
qglDisableClientState( GL_TEXTURE_COORD_ARRAY );
qglVertexPointer (3, GL_FLOAT, 16, tess.xyz); // padded for SIMD
if (qglLockArraysEXT) {
qglLockArraysEXT(0, tess.numVertexes);
GLimp_LogComment( "glLockArraysEXT\n" );
}
R_DrawElements( tess.numIndexes, tess.indexes );
if (qglUnlockArraysEXT) {
qglUnlockArraysEXT();
GLimp_LogComment( "glUnlockArraysEXT\n" );
}
// FIX: Must reset these manually or renderer will b0rk!
qglCullFace( GL_FRONT );
qglLineWidth( 1 );
}
开发者ID:burzumishi,项目名称:dragonballworld,代码行数:51,代码来源:tr_shade.c
示例14: qglMatrixMode
void CMistyFog2::Render(CWorldEffectsSystem *system)
{
if (mFadeAlpha <= 0.0)
{
return;
}
qglMatrixMode(GL_PROJECTION);
qglPushMatrix();
qglLoadIdentity ();
MYgluPerspective (80.0, 1.0, 4, 2048.0);
qglMatrixMode(GL_MODELVIEW);
qglPushMatrix();
qglLoadIdentity ();
qglRotatef (-90, 1, 0, 0); // put Z going up
qglRotatef (90, 0, 0, 1); // put Z going up
qglRotatef (0, 1, 0, 0);
qglRotatef (-90, 0, 1, 0);
qglRotatef (-90, 0, 0, 1);
qglDisable(GL_TEXTURE_2D);
GL_State(GLS_SRCBLEND_SRC_ALPHA|GLS_DSTBLEND_ONE);
qglShadeModel (GL_SMOOTH);
qglColorPointer(4, GL_FLOAT, 0, mColors);
qglEnableClientState(GL_COLOR_ARRAY);
qglVertexPointer( 3, GL_FLOAT, 0, mVerts );
qglEnableClientState(GL_VERTEX_ARRAY);
if (qglLockArraysEXT)
{
qglLockArraysEXT(0, MISTYFOG_HEIGHT*MISTYFOG_WIDTH);
}
qglDrawElements(GL_QUADS, (MISTYFOG_HEIGHT-1)*(MISTYFOG_WIDTH-1)*4, GL_UNSIGNED_INT, mIndexes);
if ( qglUnlockArraysEXT )
{
qglUnlockArraysEXT();
}
qglDisableClientState(GL_COLOR_ARRAY);
// qglDisableClientState(GL_VERTEX_ARRAY); backend doesn't ever re=enable this properly
qglPopMatrix();
qglMatrixMode(GL_PROJECTION);
qglPopMatrix();
qglMatrixMode(GL_MODELVIEW); // bug somewhere in the backend which requires this
}
开发者ID:5Quintessential,项目名称:jedioutcast,代码行数:49,代码来源:tr_worldeffects.cpp
示例15: DrawSkySideInner
static void DrawSkySideInner(struct image_s *image, const int mins[2], const int maxs[2])
{
int s, t;
GL_Bind(image);
GLfloat vtx[3 * 1024]; // arbitrary sized
GLfloat tex[2 * 1024];
int idx;
GLboolean text = qglIsEnabled(GL_TEXTURE_COORD_ARRAY);
GLboolean glcol = qglIsEnabled(GL_COLOR_ARRAY);
if (glcol)
{
qglDisableClientState(GL_COLOR_ARRAY);
}
if (!text)
{
qglEnableClientState(GL_TEXTURE_COORD_ARRAY);
}
//qglDisable (GL_BLEND);
qglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
qglEnable(GL_BLEND);
GL_TexEnv(GL_MODULATE);
for (t = mins[1] + HALF_SKY_SUBDIVISIONS; t < maxs[1] + HALF_SKY_SUBDIVISIONS; t++)
{
idx = 0;
for (s = mins[0] + HALF_SKY_SUBDIVISIONS; s <= maxs[0] + HALF_SKY_SUBDIVISIONS; s++)
{
memcpy(tex + idx * 2, s_skyTexCoords[t][s], sizeof(GLfloat) * 2);
memcpy(vtx + idx * 3, s_skyPoints[t][s], sizeof(GLfloat) * 3);
idx++;
memcpy(tex + idx * 2, s_skyTexCoords[t + 1][s], sizeof(GLfloat) * 2);
memcpy(vtx + idx * 3, s_skyPoints[t + 1][s], sizeof(GLfloat) * 3);
idx++;
}
qglVertexPointer(3, GL_FLOAT, 0, vtx);
qglTexCoordPointer(2, GL_FLOAT, 0, tex);
qglDrawArrays(GL_TRIANGLE_STRIP, 0, idx);
}
qglDisable(GL_BLEND);
}
开发者ID:grepwood,项目名称:etlegacy,代码行数:46,代码来源:tr_sky.c
示例16: RB_STD_FillDepthBuffer
/*
=====================
RB_STD_FillDepthBuffer
If we are rendering a subview with a near clip plane, use a second texture
to force the alpha test to fail when behind that clip plane
=====================
*/
void RB_STD_FillDepthBuffer(drawSurf_t **drawSurfs, int numDrawSurfs)
{
// if we are just doing 2D rendering, no need to fill the depth buffer
if (!backEnd.viewDef->viewEntitys) {
return;
}
RB_LogComment("---------- RB_STD_FillDepthBuffer ----------\n");
// enable the second texture for mirror plane clipping if needed
if (backEnd.viewDef->numClipPlanes) {
GL_SelectTexture(1);
globalImages->alphaNotchImage->Bind();
qglDisableClientState(GL_TEXTURE_COORD_ARRAY);
qglEnable(GL_TEXTURE_GEN_S);
qglTexCoord2f(1, 0.5);
}
// the first texture will be used for alpha tested surfaces
GL_SelectTexture(0);
qglEnableClientState(GL_TEXTURE_COORD_ARRAY);
// decal surfaces may enable polygon offset
qglPolygonOffset(r_offsetFactor.GetFloat(), r_offsetUnits.GetFloat());
GL_State(GLS_DEPTHFUNC_LESS);
// Enable stencil test if we are going to be using it for shadows.
// If we didn't do this, it would be legal behavior to get z fighting
// from the ambient pass and the light passes.
qglEnable(GL_STENCIL_TEST);
qglStencilFunc(GL_ALWAYS, 1, 255);
RB_RenderDrawSurfListWithFunction(drawSurfs, numDrawSurfs, RB_T_FillDepthBuffer);
if (backEnd.viewDef->numClipPlanes) {
GL_SelectTexture(1);
globalImages->BindNull();
qglDisable(GL_TEXTURE_GEN_S);
GL_SelectTexture(0);
}
}
开发者ID:AreaScout,项目名称:dante-doom3-odroid,代码行数:51,代码来源:draw_common.cpp
示例17: Gui_DrawLoadScreen
void Gui_DrawLoadScreen(int value)
{
qglClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
qglPushAttrib(GL_ENABLE_BIT | GL_PIXEL_MODE_BIT | GL_COLOR_BUFFER_BIT);
qglPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
qglPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE);
qglPixelStorei(GL_UNPACK_ALIGNMENT, 1);
qglEnableClientState(GL_VERTEX_ARRAY);
qglEnableClientState(GL_TEXTURE_COORD_ARRAY);
qglEnableClientState(GL_COLOR_ARRAY);
qglDisableClientState(GL_NORMAL_ARRAY);
qglEnable(GL_BLEND);
qglEnable(GL_TEXTURE_2D);
qglDisable(GL_ALPHA_TEST);
qglDepthMask(GL_FALSE);
qglPolygonMode(GL_FRONT, GL_FILL);
qglFrontFace(GL_CCW);
const GLfloat color_w[4] = {1.0f, 1.0f, 1.0f, 1.0f};
const text_shader_description *shader = renderer.shaderManager->getTextShader();
screenSize[0] = screen_info.w;
screenSize[1] = screen_info.h;
qglUseProgramObjectARB(shader->program);
qglUniform1iARB(shader->sampler, 0);
qglUniform2fvARB(shader->screenSize, 1, screenSize);
Gui_DrawRect(0.0, 0.0, screen_info.w, screen_info.h, color_w, color_w, color_w, color_w, BM_OPAQUE, load_screen_tex);
if(value >= 0)
{
Bar[BAR_LOADING].Show(value);
}
qglDepthMask(GL_TRUE);
qglPopClientAttrib();
qglPopAttrib();
Engine_GLSwapWindow();
}
开发者ID:teacoffee2017,项目名称:OpenTomb,代码行数:41,代码来源:gui.cpp
示例18: RB_STD_T_RenderShaderPasses
//.........这里部分代码省略.........
parm[3] = regs[ newStage->vertexParms[i][3] ];
qglProgramLocalParameter4fvARB( GL_VERTEX_PROGRAM_ARB, i, parm );
}
for ( int i = 0 ; i < newStage->numFragmentProgramImages ; i++ ) {
if ( newStage->fragmentProgramImages[i] ) {
GL_SelectTexture( i );
newStage->fragmentProgramImages[i]->Bind();
}
}
qglBindProgramARB( GL_FRAGMENT_PROGRAM_ARB, newStage->fragmentProgram );
qglEnable( GL_FRAGMENT_PROGRAM_ARB );
// draw it
RB_DrawElementsWithCounters( tri );
for ( int i = 1 ; i < newStage->numFragmentProgramImages ; i++ ) {
if ( newStage->fragmentProgramImages[i] ) {
GL_SelectTexture( i );
globalImages->BindNull();
}
}
if ( newStage->megaTexture ) {
newStage->megaTexture->Unbind();
}
GL_SelectTexture( 0 );
qglDisable( GL_VERTEX_PROGRAM_ARB );
qglDisable( GL_FRAGMENT_PROGRAM_ARB );
// Fixme: Hack to get around an apparent bug in ATI drivers. Should remove as soon as it gets fixed.
qglBindProgramARB( GL_VERTEX_PROGRAM_ARB, 0 );
qglDisableClientState( GL_COLOR_ARRAY );
qglDisableVertexAttribArrayARB( 9 );
qglDisableVertexAttribArrayARB( 10 );
qglDisableClientState( GL_NORMAL_ARRAY );
continue;
}
//--------------------------
//
// old style stages
//
//--------------------------
// set the color
color[0] = regs[ pStage->color.registers[0] ];
color[1] = regs[ pStage->color.registers[1] ];
color[2] = regs[ pStage->color.registers[2] ];
color[3] = regs[ pStage->color.registers[3] ];
// skip the entire stage if an add would be black
if ( ( pStage->drawStateBits & (GLS_SRCBLEND_BITS|GLS_DSTBLEND_BITS) ) == ( GLS_SRCBLEND_ONE | GLS_DSTBLEND_ONE )
&& color[0] <= 0 && color[1] <= 0 && color[2] <= 0 ) {
continue;
}
// skip the entire stage if a blend would be completely transparent
if ( ( pStage->drawStateBits & (GLS_SRCBLEND_BITS|GLS_DSTBLEND_BITS) ) == ( GLS_SRCBLEND_SRC_ALPHA | GLS_DSTBLEND_ONE_MINUS_SRC_ALPHA )
&& color[3] <= 0 ) {
continue;
}
// select the vertex color source
if ( pStage->vertexColor == SVC_IGNORE ) {
开发者ID:BielBdeLuna,项目名称:dhewm3,代码行数:67,代码来源:draw_common.cpp
示例19: RB_StageIteratorLightmappedMultitexture
void RB_StageIteratorLightmappedMultitexture( void ) {
shaderCommands_t *input;
shader_t *shader;
input = &tess;
shader = input->shader;
//
// log this call
//
if ( r_logFile->integer ) {
// don't just call LogComment, or we will get
// a call to va() every frame!
GLimp_LogComment( va("--- RB_StageIteratorLightmappedMultitexture( %s ) ---\n", tess.shader->name) );
}
//
// set face culling appropriately
//
GL_Cull( shader->cullType );
//
// set color, pointers, and lock
//
GL_State( GLS_DEFAULT );
qglVertexPointer( 3, GL_FLOAT, 16, input->xyz );
#ifdef REPLACE_MODE
qglDisableClientState( GL_COLOR_ARRAY );
qglColor3f( 1, 1, 1 );
qglShadeModel( GL_FLAT );
#else
qglEnableClientState( GL_COLOR_ARRAY );
qglColorPointer( 4, GL_UNSIGNED_BYTE, 0, tess.constantColor255 );
#endif
//
// select base stage
//
GL_SelectTexture( 0 );
qglEnableClientState( GL_TEXTURE_COORD_ARRAY );
R_BindAnimatedImage( &tess.xstages[0]->bundle[0] );
qglTexCoordPointer( 2, GL_FLOAT, 16, tess.texCoords[0][0] );
//
// configure second stage
//
GL_SelectTexture( 1 );
qglEnable( GL_TEXTURE_2D );
if ( r_lightmap->integer ) {
GL_TexEnv( GL_REPLACE );
} else {
GL_TexEnv( GL_MODULATE );
}
R_BindAnimatedImage( &tess.xstages[0]->bundle[1] );
qglEnableClientState( GL_TEXTURE_COORD_ARRAY );
qglTexCoordPointer( 2, GL_FLOAT, 16, tess.texCoords[0][1] );
//
// lock arrays
//
if ( qglLockArraysEXT ) {
qglLockArraysEXT(0, input->numVertexes);
GLimp_LogComment( "glLockArraysEXT\n" );
}
R_DrawElements( input->numIndexes, input->indexes );
//
// disable texturing on TEXTURE1, then select TEXTURE0
//
qglDisable( GL_TEXTURE_2D );
qglDisableClientState( GL_TEXTURE_COORD_ARRAY );
GL_SelectTexture( 0 );
#ifdef REPLACE_MODE
GL_TexEnv( GL_MODULATE );
qglShadeModel( GL_SMOOTH );
#endif
//
// now do any dynamic lighting needed
//
if ( tess.dlightBits && tess.shader->sort <= SS_OPAQUE ) {
ProjectDlightTexture();
}
//
// now do fog
//
if ( tess.fogNum && tess.shader->fogPass ) {
RB_FogPass();
}
//
// unlock arrays
//
if ( qglUnlockArraysEXT ) {
qglUnlockArraysEXT();
//.........这里部分代码省略.........
开发者ID:ptitSeb,项目名称:ioq3,代码行数:101,代码来源:tr_shade.c
示例20: RB_StageIteratorGeneric
/*
** RB_StageIteratorGeneric
*/
void RB_StageIteratorGeneric( void )
{
shaderCommands_t *input;
shader_t *shader;
input = &tess;
shader = input->shader;
RB_DeformTessGeometry();
//
// log this call
//
if ( r_logFile->integer )
{
// don't just call LogComment, or we will get
// a call to va() every frame!
GLimp_LogComment( va("--- RB_StageIteratorGeneric( %s ) ---\n", tess.shader->name) );
}
//
// set face culling appropriately
//
GL_Cull( shader->cullType );
// set polygon offset if necessary
if ( shader->polygonOffset )
{
qglEnable( GL_POLYGON_OFFSET_FILL );
qglPolygonOffset( r_offsetFactor->value, r_offsetUnits->value );
}
//
// if there is only a single pass then we can enable color
// and texture arrays before we compile, otherwise we need
// to avoid compiling those arrays since they will change
// during multipass rendering
//
if ( tess.numPasses > 1 || shader->multitextureEnv )
{
setArraysOnce = qfalse;
qglDisableClientState (GL_COLOR_ARRAY);
qglDisableClientState (GL_TEXTURE_COORD_ARRAY);
}
else
{
setArraysOnce = qtrue;
qglEnableClientState( GL_COLOR_ARRAY);
qglColorPointer( 4, GL_UNSIGNED_BYTE, 0, tess.svars.colors );
qglEnableClientState( GL_TEXTURE_COORD_ARRAY);
qglTexCoordPointer( 2, GL_FLOAT, 0, tess.svars.texcoords[0] );
}
//
// lock XYZ
//
qglVertexPointer (3, GL_FLOAT, 16, input->xyz); // padded for SIMD
if (qglLockArraysEXT)
{
qglLockArraysEXT(0, input->numVertexes);
GLimp_LogComment( "glLockArraysEXT\n" );
}
//
// enable color and texcoord arrays after the lock if necessary
//
if ( !setArraysOnce )
{
qglEnableClientState( GL_TEXTURE_COORD_ARRAY );
qglEnableClientState( GL_COLOR_ARRAY );
}
//
// call shader function
//
RB_IterateStagesGeneric( input );
//
// now do any dynamic lighting needed
//
if ( tess.dlightBits && tess.shader->sort <= SS_OPAQUE
&& !(tess.shader->surfaceFlags & (SURF_NODLIGHT | SURF_SKY) ) ) {
ProjectDlightTexture();
}
//
// now do fog
//
if ( tess.fogNum && tess.shader->fogPass ) {
RB_FogPass();
}
//
// unlock arrays
//
//.........这里部分代码省略.........
开发者ID:ptitSeb,项目名称:ioq3,代码行数:101,代码来源:tr_shade.c
注:本文中的qglDisableClientState函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论