• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ qglTexCoord2f函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: R_Bloom_Quad_Lens

static void ID_INLINE R_Bloom_Quad_Lens(float offsert, int width, int height, float texX, float texY, float texWidth, float texHeight) {
	int x = 0;
	int y = 0;
	x = 0;
	y += glConfig.vidHeight - height;
	width += x;
	height += y;
	offsert = offsert * 9; // bah
	texWidth -= texX;
	texHeight -= texY;

	qglBegin( GL_QUADS );							
	qglTexCoord2f(	texX,						texHeight	);	
	qglVertex2f(	width + offsert,							height + offsert	);

	qglTexCoord2f(	texX,						texY	);				
	qglVertex2f(	width + offsert,							y	- offsert);	

	qglTexCoord2f(	texWidth,					texY	);				
	qglVertex2f(	x - offsert,						y	- offsert);	

	qglTexCoord2f(	texWidth,					texHeight	);	
	qglVertex2f(	x - offsert,						height	+ offsert);			
	qglEnd ();
}
开发者ID:lrq3000,项目名称:openarena_engine,代码行数:25,代码来源:tr_bloom.c


示例2: Draw_Pic

/*
=============
Draw_Pic
=============
*/
void Draw_Pic (int x, int y, char *pic)
{
	image_t *gl;

	gl = Draw_FindPic (pic);
	if (!gl)
	{
		ri.Con_Printf (PRINT_ALL, "Can't find pic: %s\n", pic);
		return;
	}
	if (scrap_dirty)
		Scrap_Upload ();

	if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( gl_config.renderer & GL_RENDERER_RENDITION ) ) && !gl->has_alpha)
		qglDisable (GL_ALPHA_TEST);

	GL_Bind (gl->texnum);
	qglBegin (GL_QUADS);
	qglTexCoord2f (gl->sl, gl->tl);
	qglVertex2f (x, y);
	qglTexCoord2f (gl->sh, gl->tl);
	qglVertex2f (x+gl->width, y);
	qglTexCoord2f (gl->sh, gl->th);
	qglVertex2f (x+gl->width, y+gl->height);
	qglTexCoord2f (gl->sl, gl->th);
	qglVertex2f (x, y+gl->height);
	qglEnd ();

	if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( gl_config.renderer & GL_RENDERER_RENDITION ) )  && !gl->has_alpha)
		qglEnable (GL_ALPHA_TEST);
}
开发者ID:TechnoCrunch,项目名称:dxquake2,代码行数:36,代码来源:dx_draw.c


示例3: Draw_TileClear

/*
=============
Draw_TileClear

This repeats a 64*64 tile graphic to fill the screen around a sized down
refresh window.
=============
*/
void Draw_TileClear (int x, int y, int w, int h, char *pic)
{
	image_t	*image;

	image = Draw_FindPic (pic);
	if (!image)
	{
		ri.Con_Printf (PRINT_ALL, "Can't find pic: %s\n", pic);
		return;
	}

	if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( gl_config.renderer & GL_RENDERER_RENDITION ) )  && !image->has_alpha)
		qglDisable (GL_ALPHA_TEST);

	GL_Bind (image->texnum);
	qglBegin (GL_QUADS);
	qglTexCoord2f (x/64.0, y/64.0);
	qglVertex2f (x, y);
	qglTexCoord2f ( (x+w)/64.0, y/64.0);
	qglVertex2f (x+w, y);
	qglTexCoord2f ( (x+w)/64.0, (y+h)/64.0);
	qglVertex2f (x+w, y+h);
	qglTexCoord2f ( x/64.0, (y+h)/64.0 );
	qglVertex2f (x, y+h);
	qglEnd ();

	if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( gl_config.renderer & GL_RENDERER_RENDITION ) )  && !image->has_alpha)
		qglEnable (GL_ALPHA_TEST);
}
开发者ID:TechnoCrunch,项目名称:dxquake2,代码行数:37,代码来源:dx_draw.c


示例4: R_Bloom_Quad

static void ID_INLINE R_Bloom_Quad( int width, int height, float texX, float texY, float texWidth, float texHeight ) {
	int x = 0;
	int y = 0;
	x = 0;
	y += glConfig.vidHeight - height;
	width += x;
	height += y;
	
	texWidth += texX;
	texHeight += texY;

	qglBegin( GL_QUADS );							
	qglTexCoord2f(	texX,						texHeight	);	
	qglVertex2f(	x,							y	);

	qglTexCoord2f(	texX,						texY	);				
	qglVertex2f(	x,							height	);	

	qglTexCoord2f(	texWidth,					texY	);				
	qglVertex2f(	width,						height	);	

	qglTexCoord2f(	texWidth,					texHeight	);	
	qglVertex2f(	width,						y	);				
	qglEnd ();
}
开发者ID:lrq3000,项目名称:openarena_engine,代码行数:25,代码来源:tr_bloom.c


示例5: Draw_Char

/*
================
Draw_Char

Draws one 8*8 graphics character with 0 being transparent.
It can be clipped to the top of the screen to allow the console to be
smoothly scrolled off.
================
*/
void Draw_Char (int x, int y, int num)
{
	int				row, col;
	float			frow, fcol, size;

	num &= 255;
	
	if ( (num&127) == 32 )
		return;		// space

	if (y <= -8)
		return;			// totally off screen

	row = num>>4;
	col = num&15;

	frow = row*0.0625;
	fcol = col*0.0625;
	size = 0.0625;

	GL_Bind (draw_chars->texnum);

	qglBegin (GL_QUADS);
	qglTexCoord2f (fcol, frow);
	qglVertex2f (x, y);
	qglTexCoord2f (fcol + size, frow);
	qglVertex2f (x+8, y);
	qglTexCoord2f (fcol + size, frow + size);
	qglVertex2f (x+8, y+8);
	qglTexCoord2f (fcol, frow + size);
	qglVertex2f (x, y+8);
	qglEnd ();
}
开发者ID:TechnoCrunch,项目名称:dxquake2,代码行数:42,代码来源:dx_draw.c


示例6: Draw_Char

/*
 * ================ Draw_Char
 *
 * Draws one 8*8 graphics character with 0 being transparent. It can be clipped
 * to the top of the screen to allow the console to be smoothly scrolled off.
 * ================
 */
void
Draw_Char(int x, int y, int num, int alpha)
{
	int		row, col;
	float		frow, fcol, size;

	num &= 255;

	if (alpha >= 254)
		alpha = 254;
	else if (alpha <= 1)
		alpha = 1;

	if ((num & 127) == 32)
		return;		/* space */

	if (y <= -8)
		return;		/* totally off screen */

	row = num >> 4;
	col = num & 15;

	frow = row * 0.0625;
	fcol = col * 0.0625;
	size = 0.0625;

	{
		/* GLSTATE_DISABLE_ALPHATEST */
		qglDisable(GL_ALPHA_TEST);
		GL_TexEnv(GL_MODULATE);
		qglColor4ub(255, 255, 255, alpha);
		/* GLSTATE_ENABLE_BLEND */
		qglEnable(GL_BLEND);
		qglDepthMask(false);
	}

	GL_Bind(draw_chars->texnum);

	qglBegin(GL_QUADS);
	qglTexCoord2f(fcol, frow);
	qglVertex2f(x, y);
	qglTexCoord2f(fcol + size, frow);
	qglVertex2f(x + 8, y);
	qglTexCoord2f(fcol + size, frow + size);
	qglVertex2f(x + 8, y + 8);
	qglTexCoord2f(fcol, frow + size);
	qglVertex2f(x, y + 8);
	qglEnd();

	{
		qglDepthMask(true);
		GL_TexEnv(GL_REPLACE);
		/* GLSTATE_DISABLE_BLEND */
		qglDisable(GL_BLEND);
		qglColor4f(1,1,1,1);
		/* GLSTATE_ENABLE_ALPHATEST */
		qglEnable(GL_ALPHA_TEST);
	}
}
开发者ID:ZwS,项目名称:qudos,代码行数:66,代码来源:gl_draw.c


示例7: RB_SetGL2D

/*
=============
RB_DrawRotatePic2
=============
*/
const void *RB_RotatePic2 ( const void *data ) 
{
	const rotatePicCommand_t	*cmd;
	image_t *image;
	shader_t *shader;

	cmd = (const rotatePicCommand_t *)data;

	shader = cmd->shader;

	if ( shader->stages[0] )
	{
		image = shader->stages[0]->bundle[0].image[0];

		if ( image ) 
		{
			if ( !backEnd.projection2D ) 
			{
				RB_SetGL2D();
			}

			// Get our current blend mode, etc.
			GL_State( shader->stages[0]->stateBits );

			qglColor4ubv( backEnd.color2D );
			qglPushMatrix();

			// rotation point is going to be around the center of the passed in coordinates
			qglTranslatef( cmd->x, cmd->y, 0 );
			qglRotatef( cmd->a, 0.0, 0.0, 1.0 );
			
			GL_Bind( image );
			qglBegin( GL_QUADS );
				qglTexCoord2f( cmd->s1, cmd->t1);
				qglVertex2f( -cmd->w * 0.5f, -cmd->h * 0.5f );

				qglTexCoord2f( cmd->s2, cmd->t1 );
				qglVertex2f( cmd->w * 0.5f, -cmd->h * 0.5f );

				qglTexCoord2f( cmd->s2, cmd->t2 );
				qglVertex2f( cmd->w * 0.5f, cmd->h * 0.5f );

				qglTexCoord2f( cmd->s1, cmd->t2 );
				qglVertex2f( -cmd->w * 0.5f, cmd->h * 0.5f );
			qglEnd();
			
			qglPopMatrix();

			// Hmmm, this is not too cool
			GL_State( GLS_DEPTHTEST_DISABLE |
				  GLS_SRCBLEND_SRC_ALPHA |
				  GLS_DSTBLEND_ONE_MINUS_SRC_ALPHA );
		}
	}

	return (const void *)(cmd + 1);
}
开发者ID:CairnTrenor,项目名称:OpenJK,代码行数:62,代码来源:tr_backend.cpp


示例8: RB_ShowImages

/*
===============
RB_ShowImages

Draw all the images to the screen, on top of whatever
was there.  This is used to test for texture thrashing.

Also called by RE_EndRegistration
===============
*/
void RB_ShowImages(void)
{
	int i;
	image_t *image;
	float x, y, w, h;
	int start, end;

	if(!backEnd.projection2D)
	{
		RB_SetGL2D();
	}

	qglClear(GL_COLOR_BUFFER_BIT);

	qglFinish();


	start = ri.Milliseconds();

	for(i = 0 ; i < tr.numImages ; i++)
	{
		image = tr.images[i];

		w = glConfig.vidWidth / 40;
		h = glConfig.vidHeight / 30;

		x = i % 40 * w;
		y = i / 30 * h;

		// show in proportional size in mode 2
		if(r_showImages->integer == 2)
		{
			w *= image->uploadWidth / 512.0f;
			h *= image->uploadHeight / 512.0f;
		}

		GL_Bind(image);
		qglBegin(GL_QUADS);
		qglTexCoord2f(0, 0);
		qglVertex2f(x, y);
		qglTexCoord2f(1, 0);
		qglVertex2f(x + w, y);
		qglTexCoord2f(1, 1);
		qglVertex2f(x + w, y + h);
		qglTexCoord2f(0, 1);
		qglVertex2f(x, y + h);
		qglEnd();
	}

	qglFinish();

	end = ri.Milliseconds();
	ri.Printf(PRINT_ALL, "%i msec to draw all images\n", end - start);

}
开发者ID:Diskutant,项目名称:RTCW-SP,代码行数:65,代码来源:tr_backend.c


示例9: Draw_StretchPic

/*
 * ============= Draw_StretchPic -- only used for drawing console...
 * =============
 */
void
Draw_StretchPic(int x, int y, int w, int h, char *pic, float alpha)
{
	image_t        *gl;

	gl = Draw_FindPic(pic);
	if (!gl) {
		ri.Con_Printf(PRINT_ALL, "Can't find pic: %s\n", pic);
		return;
	}
	if (scrap_dirty)
		Scrap_Upload();

	if (((gl_config.renderer == GL_RENDERER_MCD) || (gl_config.renderer & GL_RENDERER_RENDITION))
	    && !gl->has_alpha)
		qglDisable(GL_ALPHA_TEST);

	/* add alpha support */
	if (gl->has_alpha || alpha < 1) {
		qglDisable(GL_ALPHA_TEST);

		GL_Bind(gl->texnum);

		GL_TexEnv(GL_MODULATE);
		qglColor4f(1, 1, 1, alpha);
		qglEnable(GL_BLEND);
		qglDepthMask(false);
	} else
		GL_Bind(gl->texnum);

	qglBegin(GL_QUADS);
	qglTexCoord2f(gl->sl, gl->tl);
	qglVertex2f(x, y);
	qglTexCoord2f(gl->sh, gl->tl);
	qglVertex2f(x + w, y);
	qglTexCoord2f(gl->sh, gl->th);
	qglVertex2f(x + w, y + h);
	qglTexCoord2f(gl->sl, gl->th);
	qglVertex2f(x, y + h);
	qglEnd();

	/* add alpha support */
	if (gl->has_alpha || alpha < 1) {
		qglDepthMask(true);
		GL_TexEnv(GL_REPLACE);
		qglDisable(GL_BLEND);
		qglColor4f(1, 1, 1, 1);

		qglEnable(GL_ALPHA_TEST);
	}
	if (((gl_config.renderer == GL_RENDERER_MCD) || (gl_config.renderer & GL_RENDERER_RENDITION))
	    && !gl->has_alpha)
		qglEnable(GL_ALPHA_TEST);
}
开发者ID:ZwS,项目名称:qudos,代码行数:58,代码来源:gl_draw.c


示例10: Draw_Pic

/*
 * ============= Draw_Pic =============
 */
void
Draw_Pic(int x, int y, char *pic, float alpha)
{
	image_t        *gl;

	gl = Draw_FindPic(pic);
	if (!gl) {
		ri.Con_Printf(PRINT_ALL, "Can't find pic: %s\n", pic);
		return;
	}
	if (scrap_dirty)
		Scrap_Upload();

	if (((gl_config.renderer == GL_RENDERER_MCD) || (gl_config.renderer & GL_RENDERER_RENDITION)) && !gl->has_alpha)
		qglDisable(GL_ALPHA_TEST);

	/* add alpha support */
	{
		qglDisable(GL_ALPHA_TEST);

		qglBindTexture(GL_TEXTURE_2D, gl->texnum);

		GL_TexEnv(GL_MODULATE);
		qglColor4f(1, 1, 1, 0.999);	/* need <1 for trans to work */
		qglEnable(GL_BLEND);
		qglDepthMask(false);
	}

	GL_Bind(gl->texnum);
	qglBegin(GL_QUADS);
	qglTexCoord2f(gl->sl, gl->tl);
	qglVertex2f(x, y);
	qglTexCoord2f(gl->sh, gl->tl);
	qglVertex2f(x + gl->width, y);
	qglTexCoord2f(gl->sh, gl->th);
	qglVertex2f(x + gl->width, y + gl->height);
	qglTexCoord2f(gl->sl, gl->th);
	qglVertex2f(x, y + gl->height);
	qglEnd();

	/* add alpha support */
	{
		qglDepthMask(true);
		GL_TexEnv(GL_REPLACE);
		qglDisable(GL_BLEND);
		qglColor4f(1, 1, 1, 1);

		qglEnable(GL_ALPHA_TEST);
	}

	if (((gl_config.renderer == GL_RENDERER_MCD) || (gl_config.renderer & GL_RENDERER_RENDITION)) && !gl->has_alpha)
		qglEnable(GL_ALPHA_TEST);
}
开发者ID:ZwS,项目名称:qudos,代码行数:56,代码来源:gl_draw.c


示例11: RB_ShowImages

/*
===============
RB_ShowImages

Draw all the images to the screen, on top of whatever
was there.  This is used to test for texture thrashing.

Also called by RE_EndRegistration
===============
*/
void RB_ShowImages( void ) {	
	image_t	*image;
	float	x, y, w, h;
	int		start, end;

	if ( !backEnd.projection2D ) {
		RB_SetGL2D();
	}

	qglFinish();

	start = Sys_Milliseconds();

	int i=0;
//	int iNumImages = 
	   				 R_Images_StartIteration();
	while ( (image = R_Images_GetNextIteration()) != NULL)
	{
		w = glConfig.vidWidth / 20;
		h = glConfig.vidHeight / 15;
		x = i % 20 * w;
		y = i / 20 * h;

		// show in proportional size in mode 2
		if ( r_showImages->integer == 2 ) {
			w *= image->width / 512.0;
			h *= image->height / 512.0;
		}

		GL_Bind( image );
#ifdef _XBOX
		qglBeginEXT (GL_QUADS, 4, 0, 0, 4, 0);
#else
		qglBegin (GL_QUADS);
#endif
		qglTexCoord2f( 0, 0 );
		qglVertex2f( x, y );
		qglTexCoord2f( 1, 0 );
		qglVertex2f( x + w, y );
		qglTexCoord2f( 1, 1 );
		qglVertex2f( x + w, y + h );
		qglTexCoord2f( 0, 1 );
		qglVertex2f( x, y + h );
		qglEnd();
		i++;
	}

	qglFinish();

	end = Sys_Milliseconds();
	//VID_Printf( PRINT_ALL, "%i msec to draw all images\n", end - start );
}
开发者ID:L0rdWaffles,项目名称:OpenJK,代码行数:62,代码来源:tr_backend.cpp


示例12: R_Bloom_Quad

/*
* R_Bloom_Quad
*/
static inline void R_Bloom_Quad( int x, int y, int w, int h, float texwidth, float texheight )
{
	qglBegin( GL_QUADS );
	qglTexCoord2f( 0, texheight );
	qglVertex2f( x, glState.height-h-y );
	qglTexCoord2f( 0, 0 );
	qglVertex2f( x, glState.height-y );
	qglTexCoord2f( texwidth, 0 );
	qglVertex2f( x+w, glState.height-y );
	qglTexCoord2f( texwidth, texheight );
	qglVertex2f( x+w, glState.height-h );
	qglEnd();
}
开发者ID:Kaperstone,项目名称:warsow,代码行数:16,代码来源:r_bloom.c


示例13: R_Bloom_SamplePass

/*
* R_Bloom_SamplePass
*/
static inline void R_Bloom_SamplePass( int xpos, int ypos )
{
	qglBegin( GL_QUADS );
	qglTexCoord2f( 0, sampleText_tch );
	qglVertex2f( xpos, ypos );
	qglTexCoord2f( 0, 0 );
	qglVertex2f( xpos, ypos+sample_height );
	qglTexCoord2f( sampleText_tcw, 0 );
	qglVertex2f( xpos+sample_width, ypos+sample_height );
	qglTexCoord2f( sampleText_tcw, sampleText_tch );
	qglVertex2f( xpos+sample_width, ypos );
	qglEnd();
}
开发者ID:Kaperstone,项目名称:warsow,代码行数:16,代码来源:r_bloom.c


示例14: RB_ShowImages

/*
===============
RB_ShowImages

Draw all the images to the screen, on top of whatever
was there.  This is used to test for texture thrashing.
===============
*/
void RB_ShowImages( void ) {
	int		i;
	idImage	*image;
	float	x, y, w, h;
	int		start, end;

	RB_SetGL2D();

	//qglClearColor( 0.2, 0.2, 0.2, 1 );
	//qglClear( GL_COLOR_BUFFER_BIT );

	qglFinish();

	start = Sys_Milliseconds();

	for ( i = 0 ; i < globalImages->images.Num() ; i++ ) {
		image = globalImages->images[i];

		if ( image->texnum == idImage::TEXTURE_NOT_LOADED && image->partialImage == NULL ) {
			continue;
		}

		w = glConfig.vidWidth / 20;
		h = glConfig.vidHeight / 15;
		x = i % 20 * w;
		y = i / 20 * h;

		// show in proportional size in mode 2
		if ( r_showImages.GetInteger() == 2 ) {
			w *= image->uploadWidth / 512.0f;
			h *= image->uploadHeight / 512.0f;
		}

		image->Bind();
		qglBegin (GL_QUADS);
		qglTexCoord2f( 0, 0 );
		qglVertex2f( x, y );
		qglTexCoord2f( 1, 0 );
		qglVertex2f( x + w, y );
		qglTexCoord2f( 1, 1 );
		qglVertex2f( x + w, y + h );
		qglTexCoord2f( 0, 1 );
		qglVertex2f( x, y + h );
		qglEnd();
	}

	qglFinish();

	end = Sys_Milliseconds();
	common->Printf( "%i msec to draw all images\n", end - start );
}
开发者ID:albertz,项目名称:iodoom3,代码行数:59,代码来源:tr_backend.cpp


示例15: RB_ShowImages

/*
===============
RB_ShowImages

Draw all the images to the screen, on top of whatever
was there.  This is used to test for texture thrashing.

Also called by RE_EndRegistration
===============
*/
void RB_ShowImages( void ) {
	image_t	*image;
	float	x, y, w, h;
	int		start, end;

	if ( !backEnd.projection2D ) {
		RB_SetGL2D();
	}

	qglClear( GL_COLOR_BUFFER_BIT );

	qglFinish();

	start = ri.Milliseconds();


	int i=0;
	   				 R_Images_StartIteration();
	while ( (image = R_Images_GetNextIteration()) != NULL)
	{
		w = glConfig.vidWidth / 20;
		h = glConfig.vidHeight / 15;
		x = i % 20 * w;
		y = i / 20 * h;

		// show in proportional size in mode 2
		if ( r_showImages->integer == 2 ) {
			w *= image->uploadWidth / 512.0;
			h *= image->uploadHeight / 512.0;
		}

		GL_Bind( image );
		qglBegin (GL_QUADS);
		qglTexCoord2f( 0, 0 );
		qglVertex2f( x, y );
		qglTexCoord2f( 1, 0 );
		qglVertex2f( x + w, y );
		qglTexCoord2f( 1, 1 );
		qglVertex2f( x + w, y + h );
		qglTexCoord2f( 0, 1 );
		qglVertex2f( x, y + h );
		qglEnd();
		i++;
	}

	qglFinish();

	end = ri.Milliseconds();
	ri.Printf( PRINT_ALL, "%i msec to draw all images\n", end - start );

}
开发者ID:Boothand,项目名称:jk2mp,代码行数:61,代码来源:tr_backend.cpp


示例16: MakeSkyVec

void MakeSkyVec (float s, float t, int axis)
{
	vec3_t		v, b;
	int			j, k;

	b[0] = s*2300;
	b[1] = t*2300;
	b[2] = 2300;

	for (j=0 ; j<3 ; j++)
	{
		k = st_to_vec[axis][j];
		if (k < 0)
			v[j] = -b[-k - 1];
		else
			v[j] = b[k - 1];
	}

	// avoid bilerp seam
	s = (s+1)*0.5;
	t = (t+1)*0.5;

	if (s < sky_min)
		s = sky_min;
	else if (s > sky_max)
		s = sky_max;
	if (t < sky_min)
		t = sky_min;
	else if (t > sky_max)
		t = sky_max;

	t = 1.0 - t;
	qglTexCoord2f (s, t);
	qglVertex3fv (v);
}
开发者ID:Izhido,项目名称:qrevpak,代码行数:35,代码来源:gl_warp.c


示例17: R_Splash

void R_Splash()
{
#ifndef _XBOX
	image_t *pImage;
/*
	const char* s = Cvar_VariableString("se_language");
	if (stricmp(s,"english"))
	{
		pImage = R_FindImageFile( "menu/splash_eur", qfalse, qfalse, qfalse, GL_CLAMP);
	}
	else
	{
		pImage = R_FindImageFile( "menu/splash", qfalse, qfalse, qfalse, GL_CLAMP);
	}
*/
	pImage = R_FindImageFile( "menu/splash", qfalse, qfalse, qfalse, GL_CLAMP);

	extern void	RB_SetGL2D (void);
	RB_SetGL2D();	
	if (pImage )
	{//invalid paths?
		GL_Bind( pImage );
	}
	GL_State(GLS_SRCBLEND_ONE | GLS_DSTBLEND_ZERO);

	const int width = 640;
	const int height = 480;
	const float x1 = 320 - width / 2;
	const float x2 = 320 + width / 2;
	const float y1 = 240 - height / 2;
	const float y2 = 240 + height / 2;


	qglBegin (GL_TRIANGLE_STRIP);
		qglTexCoord2f( 0,  0 );
		qglVertex2f(x1, y1);
		qglTexCoord2f( 1 ,  0 );
		qglVertex2f(x2, y1);
		qglTexCoord2f( 0, 1 );
		qglVertex2f(x1, y2);
		qglTexCoord2f( 1, 1 );
		qglVertex2f(x2, y2);
	qglEnd();

	GLimp_EndFrame();
#endif
}
开发者ID:Camron,项目名称:OpenJK,代码行数:47,代码来源:tr_init.cpp


示例18: R_Bloom_DrawEffect

/*
* R_Bloom_DrawEffect
*/
static void R_Bloom_DrawEffect( void )
{
	GL_Bind( 0, r_bloomeffecttexture );
	GL_TexEnv( GL_MODULATE );
	GL_SetState( GLSTATE_NO_DEPTH_TEST|GLSTATE_SRCBLEND_ONE|GLSTATE_DSTBLEND_ONE );
	qglColor4f( r_bloom_alpha->value, r_bloom_alpha->value, r_bloom_alpha->value, 1.0f );

	qglBegin( GL_QUADS );
	qglTexCoord2f( 0, sampleText_tch );
	qglVertex2f( curView_x, curView_y );
	qglTexCoord2f( 0, 0 );
	qglVertex2f( curView_x, curView_y+curView_height );
	qglTexCoord2f( sampleText_tcw, 0 );
	qglVertex2f( curView_x+curView_width, curView_y+curView_height );
	qglTexCoord2f( sampleText_tcw, sampleText_tch );
	qglVertex2f( curView_x+curView_width, curView_y );
	qglEnd();
}
开发者ID:Kaperstone,项目名称:warsow,代码行数:21,代码来源:r_bloom.c


示例19: RB_SetGL2D

/*
=============
RB_DrawRotatePic
=============
*/
const void *RB_RotatePic ( const void *data ) 
{
	const rotatePicCommand_t	*cmd;
	image_t *image;
	shader_t *shader;

	cmd = (const rotatePicCommand_t *)data;

	shader = cmd->shader;
	image = &shader->stages[0].bundle[0].image[0];

	if ( image ) {
		if ( !backEnd.projection2D ) {
			RB_SetGL2D();
		}

		qglColor4ubv( backEnd.color2D );
		qglPushMatrix();

		qglTranslatef(cmd->x+cmd->w,cmd->y,0);
		qglRotatef(cmd->a, 0.0, 0.0, 1.0);
		
		GL_Bind( image );
#ifdef _XBOX
		qglBeginEXT (GL_QUADS, 4, 0, 0, 4, 0);
#else
		qglBegin (GL_QUADS);
#endif
		qglTexCoord2f( cmd->s1, cmd->t1);
		qglVertex2f( -cmd->w, 0 );
		qglTexCoord2f( cmd->s2, cmd->t1 );
		qglVertex2f( 0, 0 );
		qglTexCoord2f( cmd->s2, cmd->t2 );
		qglVertex2f( 0, cmd->h );
		qglTexCoord2f( cmd->s1, cmd->t2 );
		qglVertex2f( -cmd->w, cmd->h );
		qglEnd();
		
		qglPopMatrix();
	}

	return (const void *)(cmd + 1);
}
开发者ID:L0rdWaffles,项目名称:OpenJK,代码行数:48,代码来源:tr_backend.cpp


示例20: R_Bloom_DrawEffect

/*
=================
R_Bloom_DrawEffect
=================
*/
void R_Bloom_DrawEffect( refdef_t *fd )
{
    GL_Bind(r_bloomeffecttexture->texnum);
    GL_Enable(GL_BLEND);
    GL_BlendFunc(GL_ONE, GL_ONE);
    qglColor4f(r_bloom_alpha->value + fd->bloomalpha /*bc mod*/, r_bloom_alpha->value + fd->bloomalpha /*bc mod*/, r_bloom_alpha->value + fd->bloomalpha /*bc mod*/, 1.0f);
    GL_TexEnv(GL_MODULATE);
    qglBegin(GL_QUADS);
    qglTexCoord2f(	0,							sampleText_tch	);
    qglVertex2f(	curView_x,					curView_y	);
    qglTexCoord2f(	0,							0	);
    qglVertex2f(	curView_x,					curView_y + curView_height	);
    qglTexCoord2f(	sampleText_tcw,				0	);
    qglVertex2f(	curView_x + curView_width,	curView_y + curView_height	);
    qglTexCoord2f(	sampleText_tcw,				sampleText_tch	);
    qglVertex2f(	curView_x + curView_width,	curView_y	);
    qglEnd();

    GL_Disable(GL_BLEND);
}
开发者ID:AimHere,项目名称:thirty-flights-of-linux,代码行数:25,代码来源:r_bloom.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ qglTexCoordPointer函数代码示例发布时间:2022-05-30
下一篇:
C++ qglStencilOp函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap