本文整理汇总了C++中qglDisableClientState函数的典型用法代码示例。如果您正苦于以下问题:C++ qglDisableClientState函数的具体用法?C++ qglDisableClientState怎么用?C++ qglDisableClientState使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了qglDisableClientState函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 );
}
示例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
}
示例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" );
}
}
示例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);
}
示例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);
}
示例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);
}
示例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 );
}
}
示例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);
}
示例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);
}
示例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 );
}
}
}
示例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);
}
}
示例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);
}
示例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 );
}
示例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
}
示例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);
}