当前位置: 首页>>代码示例>>C++>>正文


C++ qglLoadIdentity函数代码示例

本文整理汇总了C++中qglLoadIdentity函数的典型用法代码示例。如果您正苦于以下问题:C++ qglLoadIdentity函数的具体用法?C++ qglLoadIdentity怎么用?C++ qglLoadIdentity使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了qglLoadIdentity函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: RB_SetGL2D

/*
================
RB_SetGL2D

================
*/
void	RB_SetGL2D (void) {
	if ( tess.numIndexes | tess.numVertexes )
		Com_Printf(" Going 2d with verts?" );
	backEnd.projection2D = qtrue;
	backEnd.currentModel = 0;
	
	// set 2D virtual screen size
	qglViewport( 0, 0, glConfig.vidWidth, glConfig.vidHeight );
	qglScissor( 0, 0, glConfig.vidWidth, glConfig.vidHeight );
	qglMatrixMode(GL_PROJECTION);
    qglLoadIdentity ();
	qglOrtho (0, glConfig.vidWidth, glConfig.vidHeight, 0, 0, 1);
	qglMatrixMode(GL_MODELVIEW);
    qglLoadIdentity ();

	GL_State( GLS_DEPTHTEST_DISABLE |
			  GLS_SRCBLEND_SRC_ALPHA |
			  GLS_DSTBLEND_ONE_MINUS_SRC_ALPHA );

	GL_Cull( CT_TWO_SIDED );
	qglDisable( GL_CLIP_PLANE0 );

	// set time for 2D shaders
//	tess.shaderTime = ri.Milliseconds();
}
开发者ID:entdark,项目名称:q3mme,代码行数:31,代码来源:tr_backend.c

示例2: 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

示例3: RB_SetGL2D

/*
================
RB_SetGL2D

================
*/
void    RB_SetGL2D(void)
{
	backEnd.projection2D = qtrue;

	// set 2D virtual screen size
	qglViewport(0, 0, glConfig.vidWidth, glConfig.vidHeight);
	qglScissor(0, 0, glConfig.vidWidth, glConfig.vidHeight);
	qglMatrixMode(GL_PROJECTION);
	qglLoadIdentity();
	qglOrtho(0, glConfig.vidWidth, glConfig.vidHeight, 0, 0, 1);
	qglMatrixMode(GL_MODELVIEW);
	qglLoadIdentity();

	GL_State(GLS_DEPTHTEST_DISABLE |
	         GLS_SRCBLEND_SRC_ALPHA |
	         GLS_DSTBLEND_ONE_MINUS_SRC_ALPHA);

	qglDisable(GL_FOG);   //----(SA)    added

	qglDisable(GL_CULL_FACE);
	qglDisable(GL_CLIP_PLANE0);

	// set time for 2D shaders
	backEnd.refdef.time = ri.Milliseconds();
	backEnd.refdef.floatTime = backEnd.refdef.time * 0.001f;
}
开发者ID:Diskutant,项目名称:RTCW-SP,代码行数:32,代码来源:tr_backend.c

示例4: RB_STD_LightScale

/*
==================
RB_STD_LightScale

Perform extra blending passes to multiply the entire buffer by
a floating point value
==================
*/
void RB_STD_LightScale( void ) {
	float	v, f;

	if ( backEnd.overBright == 1.0f ) {
		return;
	}

	if ( r_skipLightScale.GetBool() ) {
		return;
	}

	// the scissor may be smaller than the viewport for subviews
	if ( r_useScissor.GetBool() ) {
		qglScissor( backEnd.viewDef->viewport.x1 + backEnd.viewDef->scissor.x1,
			backEnd.viewDef->viewport.y1 + backEnd.viewDef->scissor.y1,
			backEnd.viewDef->scissor.x2 - backEnd.viewDef->scissor.x1 + 1,
			backEnd.viewDef->scissor.y2 - backEnd.viewDef->scissor.y1 + 1 );
		backEnd.currentScissor = backEnd.viewDef->scissor;
	}

	// full screen blends
	qglLoadIdentity();
	qglMatrixMode( GL_PROJECTION );
	qglPushMatrix();
	qglLoadIdentity();
	qglOrtho( 0, 1, 0, 1, -1, 1 );

	GL_State( GLS_SRCBLEND_DST_COLOR | GLS_DSTBLEND_SRC_COLOR );
	GL_Cull( CT_TWO_SIDED );	// so mirror views also get it
	globalImages->BindNull();
	qglDisable( GL_DEPTH_TEST );
	qglDisable( GL_STENCIL_TEST );

	v = 1;
	while ( idMath::Fabs( v - backEnd.overBright ) > 0.01 ) {	// a little extra slop
		f = backEnd.overBright / v;
		f /= 2;
		if ( f > 1 ) {
			f = 1;
		}
		qglColor3f( f, f, f );
		v = v * f * 2;

		qglBegin( GL_QUADS );
		qglVertex2f( 0,0 );
		qglVertex2f( 0,1 );
		qglVertex2f( 1,1 );
		qglVertex2f( 1,0 );
		qglEnd();
	}


	qglPopMatrix();
	qglEnable( GL_DEPTH_TEST );
	qglMatrixMode( GL_MODELVIEW );
	GL_Cull( CT_FRONT_SIDED );
}
开发者ID:BielBdeLuna,项目名称:dhewm3,代码行数:65,代码来源:draw_common.cpp

示例5: R_BloomScreen

/*
=================
R_BloomScreen
=================
*/
void R_BloomScreen( void )
{
	if( !r_bloom->integer )
		return;
	if(r_bloom_sky_only->integer)
		return;
	if ( backEnd.doneBloom )
		return;
	if ( !backEnd.doneSurfaces )
		return;
	backEnd.doneBloom = qtrue;
	if( !bloom.started ) {
		R_Bloom_InitTextures();
		if( !bloom.started )
			return;
	}

	if ( !backEnd.projection2D )
		RB_SetGL2D();
#if 0
	// set up full screen workspace
	GL_TexEnv( GL_MODULATE );
	qglScissor( 0, 0, glConfig.vidWidth, glConfig.vidHeight );
	qglViewport( 0, 0, glConfig.vidWidth, glConfig.vidHeight );
	qglMatrixMode( GL_PROJECTION );
    qglLoadIdentity ();
	qglOrtho( 0, glConfig.vidWidth, glConfig.vidHeight, 0, 0, 1 );
	qglMatrixMode( GL_MODELVIEW );
    qglLoadIdentity ();

	GL_Cull( CT_TWO_SIDED );
#endif

	qglColor4f( 1, 1, 1, 1 );

	//Backup the old screen in a texture
	R_Bloom_BackupScreen();
	// create the bloom texture using one of a few methods
	if(r_bloom_cascade->integer)
		R_Bloom_Cascaded();
	else
		R_Bloom_WarsowEffect ();
//	R_Bloom_CreateEffect();
	// restore the screen-backup to the screen
	R_Bloom_RestoreScreen();
	// Do the final pass using the bloom texture for the final effect
	R_Bloom_DrawEffect ();

// 	LEILEI - Lens Bloom Hack
//		The concept of this is to inverse the coordinates on both X and Y,
//		then scale outward using the offset value applied, as well as the modulated color
//		applied to give a rainbow streak effect.  Most effective with high bloom darkness
//		values.
	if(r_bloom_reflection->integer)
	R_Bloom_LensEffect ();
}
开发者ID:lrq3000,项目名称:openarena_engine,代码行数:61,代码来源:tr_bloom.c

示例6: GetDC

void idGLWidget::OnPaint()
{

    if (!initialized)
    {
        CDC *dc = GetDC();
        QEW_SetupPixelFormat(dc->m_hDC);
        ReleaseDC(dc);
        initialized = true;
    }
    CPaintDC dc(this); // device context for painting

    CRect rect;
    GetClientRect(rect);

    if (!qwglMakeCurrent(dc.m_hDC, win32.hGLRC))
    {
    }

    qglViewport(0, 0, rect.Width(), rect.Height());
    qglScissor(0, 0, rect.Width(), rect.Height());
    qglMatrixMode(GL_PROJECTION);
    qglLoadIdentity();
    qglClearColor (0.4f, 0.4f, 0.4f, 0.7f);
    qglClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);


    qglDisable(GL_DEPTH_TEST);
    qglDisable(GL_BLEND);
    qglOrtho(0, rect.Width(), 0, rect.Height(), -256, 256);

    if (drawable)
    {
        drawable->draw(1, 1, rect.Width()-1, rect.Height()-1);
    }
    else
    {
        qglViewport(0, 0, rect.Width(), rect.Height());
        qglScissor(0, 0, rect.Width(), rect.Height());
        qglMatrixMode(GL_PROJECTION);
        qglLoadIdentity();
        qglClearColor (0.4f, 0.4f, 0.4f, 0.7f);
        qglClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    }

    qwglSwapBuffers(dc);
    qglFlush();
    qwglMakeCurrent(win32.hDC, win32.hGLRC);

}
开发者ID:revelator,项目名称:Revelator-Doom3,代码行数:50,代码来源:GLWidget.cpp

示例7: 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

示例8: GL_LoadIdentity

/*
 ==================
 GL_LoadIdentity
 ==================
*/
void GL_LoadIdentity (uint mode){

	switch (mode){
	case GL_PROJECTION:
		if (glState.projectionMatrixIdentity)
			return;
		glState.projectionMatrixIdentity = true;

		break;
	case GL_MODELVIEW:
		if (glState.modelviewMatrixIdentity)
			return;
		glState.modelviewMatrixIdentity = true;

		break;
	case GL_TEXTURE:
		if (glState.textureMatrixIdentity[glState.texUnit])
			return;
		glState.textureMatrixIdentity[glState.texUnit] = true;

		break;
	}

	qglMatrixMode(mode);
	qglLoadIdentity();
}
开发者ID:Mirrorman95,项目名称:quake-2-evolved,代码行数:31,代码来源:r_glState.c

示例9: 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 defined(VV_LIGHTING) && defined(_XBOX)
	StencilShadower.FinishShadows();
#else
	if ( r_shadows->integer != 2 ) {
		return;
	}
	if ( glConfig.stencilBits < 4 ) {
		return;
	}

#ifdef _DEBUG_STENCIL_SHADOWS
	return;
#endif

	qglEnable( GL_STENCIL_TEST );
	qglStencilFunc( GL_NOTEQUAL, 0, 255 );

	qglStencilOp( GL_KEEP, GL_KEEP, GL_KEEP );

	bool planeZeroBack = false;
	if (qglIsEnabled(GL_CLIP_PLANE0))
	{
		planeZeroBack = true;
		qglDisable (GL_CLIP_PLANE0);
	}
	GL_Cull(CT_TWO_SIDED);
	//qglDisable (GL_CULL_FACE);

	GL_Bind( tr.whiteImage );

	qglPushMatrix();
    qglLoadIdentity ();

//	qglColor3f( 0.6f, 0.6f, 0.6f );
//	GL_State( GLS_DEPTHMASK_TRUE | GLS_SRCBLEND_DST_COLOR | GLS_DSTBLEND_ZERO );

//	qglColor3f( 1, 0, 0 );
//	GL_State( GLS_DEPTHMASK_TRUE | GLS_SRCBLEND_ONE | GLS_DSTBLEND_ZERO );

	qglColor4f( 0.0f, 0.0f, 0.0f, 0.5f );
	//GL_State( GLS_DEPTHMASK_TRUE | GLS_SRCBLEND_SRC_ALPHA | GLS_DSTBLEND_ONE_MINUS_SRC_ALPHA );
	GL_State( GLS_SRCBLEND_SRC_ALPHA | GLS_DSTBLEND_ONE_MINUS_SRC_ALPHA );

	qglBegin( GL_QUADS );
	qglVertex3f( -100, 100, -10 );
	qglVertex3f( 100, 100, -10 );
	qglVertex3f( 100, -100, -10 );
	qglVertex3f( -100, -100, -10 );
	qglEnd ();

	qglColor4f(1,1,1,1);
	qglDisable( GL_STENCIL_TEST );
	if (planeZeroBack)
	{
		qglEnable (GL_CLIP_PLANE0);
	}
	qglPopMatrix();
#endif // VV_LIGHTING && _XBOX
}
开发者ID:3ddy,项目名称:Jedi-Outcast,代码行数:70,代码来源:tr_shadows.cpp

示例10: 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 );

//	qglColor3f( 1, 0, 0 );
//	GL_State( GLS_DEPTHMASK_TRUE | GLS_SRCBLEND_ONE | GLS_DSTBLEND_ZERO );

	qglBegin( GL_QUADS );
	qglVertex3f( -100, 100, -10 );
	qglVertex3f( 100, 100, -10 );
	qglVertex3f( 100, -100, -10 );
	qglVertex3f( -100, -100, -10 );
	qglEnd();

	qglColor4f( 1,1,1,1 );
	qglDisable( GL_STENCIL_TEST );
}
开发者ID:JackalFrost,项目名称:RTCW-WSGF,代码行数:43,代码来源:tr_shadows.c

示例11: GLRB_ResetState3D

void GLRB_ResetState3D( void )
{
    // @pjb: todo

    qglLoadIdentity();

    GL_State( GLS_DEFAULT );
}
开发者ID:Avatarchik,项目名称:Quake-III-Arena-D3D11,代码行数:8,代码来源:gl_driver.c

示例12: 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

示例13: GLRB_ResetState2D

void GLRB_ResetState2D( void )
{
    qglLoadIdentity();

	GL_State( GLS_DEPTHTEST_DISABLE |
			  GLS_SRCBLEND_SRC_ALPHA |
			  GLS_DSTBLEND_ONE_MINUS_SRC_ALPHA );
    GL_Cull( CT_TWO_SIDED );

	qglDisable( GL_CLIP_PLANE0 );
}
开发者ID:Avatarchik,项目名称:Quake-III-Arena-D3D11,代码行数:11,代码来源:gl_driver.c

示例14: RB_SetGL2D

/*
=============
RB_SetGL2D

This is not used by the normal game paths, just by some tools
=============
*/
void RB_SetGL2D( void ) {
	// set 2D virtual screen size
	qglViewport( 0, 0, glConfig.vidWidth, glConfig.vidHeight );
	if ( r_useScissor.GetBool() ) {
		qglScissor( 0, 0, glConfig.vidWidth, glConfig.vidHeight );
	}
	qglMatrixMode( GL_PROJECTION );
    qglLoadIdentity();
	qglOrtho( 0, 640, 480, 0, 0, 1 );		// always assume 640x480 virtual coordinates
	qglMatrixMode( GL_MODELVIEW );
    qglLoadIdentity();

	GL_State( GLS_DEPTHFUNC_ALWAYS |
			  GLS_SRCBLEND_SRC_ALPHA |
			  GLS_DSTBLEND_ONE_MINUS_SRC_ALPHA );

	GL_Cull( CT_TWO_SIDED );

	qglDisable( GL_DEPTH_TEST );
	qglDisable( GL_STENCIL_TEST );
}
开发者ID:albertz,项目名称:iodoom3,代码行数:28,代码来源:tr_backend.cpp

示例15: qglViewport

void idGLDrawableView::draw(int x, int y, int w, int h)
{
    int i;
    renderView_t	refdef;
    const idMaterial		*mat = material;

    if (mat)
    {
        qglViewport(x, y, w, h);
        qglScissor(x, y, w, h);
        qglMatrixMode(GL_PROJECTION);
        qglClearColor( 0.1f, 0.1f, 0.1f, 0.0f );
        qglClear(GL_COLOR_BUFFER_BIT);

        UpdateLights();

        // render it
        renderSystem->BeginFrame(w, h);

        memset( &refdef, 0, sizeof( refdef ) );

        UpdateCamera( &refdef );

        // Copy global shaderparms to view
        for( i = 0; i < MAX_GLOBAL_SHADER_PARMS; i++ )
        {
            refdef.shaderParms[ i ] = globalParms[ i ];
        }

        refdef.width = SCREEN_WIDTH;
        refdef.height = SCREEN_HEIGHT;
        refdef.fov_x = 90;
        refdef.fov_y = 2 * atan((float)h / w) * idMath::M_RAD2DEG;

        refdef.time = eventLoop->Milliseconds();

        world->RenderScene( &refdef );

        if ( showLights )
        {
            drawLights( &refdef );
        }

        renderSystem->EndFrame( NULL, NULL );

        world->DebugClearLines( refdef.time );

        qglMatrixMode( GL_MODELVIEW );
        qglLoadIdentity();
    }
}
开发者ID:revelator,项目名称:Revelator-Doom3,代码行数:51,代码来源:MaterialPreviewView.cpp


注:本文中的qglLoadIdentity函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。