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


C++ DrawTexture函数代码示例

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


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

示例1: DrawString

		bool DrawString( int x, int y, std::string str, unsigned int color = 0xFFFFFFFF, Font* fnt = 0, int caretpos = -1 )
		{
			if( fnt == 0 )
				fnt = mDefaultFont;

			int charpos = 0;
			int caretx = -1;
			for( int i = 0; i < (int)str.length( ); i++ )
			{
				char thischar = str[i];

				DrawTexture( x + charpos, y, fnt->GetCharSizeX( ), fnt->GetCharSizeY( ), fnt->GetCharTexX( thischar ), 
					fnt->GetCharTexY( thischar ), fnt->GetCharSizeX( ), fnt->GetCharSizeY( ), fnt->GetTexture( ), 
					color, true );

				if( i == caretx )
					caretx = charpos;

				charpos += fnt->GetCharWidth( thischar );
			}

			if( caretpos >= 0 && GetTickCount( ) % 1500 > 750 )
			{
				if( caretx < 0 )
					caretx = charpos;
				caretx -= ( fnt->GetCharWidth( '|' ) / 2 ) - 1;
				DrawTexture( x + caretx, y, fnt->GetCharSizeX( ), fnt->GetCharSizeY( ), fnt->GetCharTexX( '|' ),
					fnt->GetCharTexY( '|' ), fnt->GetCharSizeX( ), fnt->GetCharSizeY( ), fnt->GetTexture( ),
					color, true );
			}

			return true;
		};
开发者ID:brett19,项目名称:Ikarus,代码行数:33,代码来源:OverlayRenderer.hpp

示例2: BlurGI

void BlurGI(RenderTarget *rt) {
	blurRT->Bind();
	glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

	blurYShader.Bind();
	blurYShader.SetUniform("resolution", (float)blurRT->Size(), (float)blurRT->Size());
	// テクスチャ描画
	glActiveTexture(GL_TEXTURE0);
	glBindTexture(GL_TEXTURE_2D, rt->Texture());
	blurYShader.SetUniform("texture", (int)0);
	DrawTexture(0, 0, 1, 1);
	blurYShader.Unbind();	


	rt->Bind();
	glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	blurXShader.Bind();
	blurXShader.SetUniform("resolution", (float)rt->Size(), (float)rt->Size());
	// テクスチャ描画
	glActiveTexture(GL_TEXTURE0);
	glBindTexture(GL_TEXTURE_2D, blurRT->Texture());
	blurXShader.SetUniform("texture", (int)0);
	DrawTexture(0, 0, 1, 1);
	
	blurXShader.Unbind();	

}
开发者ID:RobertBeckebans,项目名称:rsm,代码行数:29,代码来源:main.cpp

示例3: GetColor

void GUIControl::Draw()
{
	if(IsVisible())
	{
		if(GetTexture())
		{	
			COLOR4 c = GetColor();
			glColor4ub(c.r, c.g, c.b, c.a);

			if(GetCurrentPattern() == 0)
			{
				DrawTexture(GetX(), GetY(),
					0, 0,
					GetWidth(), GetHeight(),
					GetTexture(),
					false, false, 100, 100);
			}
			else
			{
				DrawTexture(GetX(), GetY(),
					GetCurrentPattern() * GetWidth(),
					0,
					GetCurrentPattern() * GetWidth() + GetWidth(),
					GetHeight(),
					GetTexture(),
					false, false, 100, 100);
			}
		}

		if(GetCaption() && GetCaptionFont())
		{
			COLOR4 c = GetCurrentCaptionColor();
			glColor4ub(c.r, c.g, c.b, c.a);

			PrintText(GetCaption(),
				GetCaptionFont(),
				GetX() + GetCaptionX(),
				GetY() + GetCaptionY());
		}

		if(GetBorder())
		{
			if(GetBorderType() == btAlways)
			{
				Box(GetX(), GetY(), GetWidth(), GetHeight());
			}
			else if(GetBorderType() == btOnMouseMove)
			{
				if(_draw_border)
					Box(GetX(), GetY(), GetWidth(), GetHeight());
			}
		}
	}
}
开发者ID:lightsgoout,项目名称:interview,代码行数:54,代码来源:gui_control.cpp

示例4: glMatrixMode

	// Draw texture.
	MapilVoid GLSprite::DrawTexture(	SharedPointer < Texture > pTexture,
										ImageTransformationMethod method,
										const Vector2 < MapilFloat32 >& v )
	{
		// If texture hasn't been created, this function returns immediately.
		if( !pTexture.GetPointer() ){
			return;
		}

		// Set up the transformation matrix for the image.
		glMatrixMode( GL_MODELVIEW );
		glPushMatrix();

		// Set up the transformation matrix for the image.
		switch( method ){
			case IMAGE_TRANSFORMATION_METHOD_MOVE:
				glTranslatef( v.m_X, v.m_Y, 0.0f );
				break;
			default:
				break;
		}

		// Draw texture.
		DrawTexture( pTexture );
		glFlush();

		// Restore the transformation matrix.
		glPopMatrix();
	}
开发者ID:nutti,项目名称:MAPIL,代码行数:30,代码来源:GLSprite.cpp

示例5: DrawOptions

/*
 * Cheats Code Options Menu
 */
void DrawOptions(struct option_entry option, u8 alpha, int y_inc, int selIndex)
{
    if (!option.name || !option.value)
        return;
    
    int c = 0, yOff = 80, cIndex = 0;
    
    int maxPerPage = (512 - (yOff * 2)) / y_inc;
    int startDrawX = selIndex - (maxPerPage / 2);
    int max = maxPerPage + startDrawX;
    
    SetFontSize(y_inc-6, y_inc-4);

    for (c = startDrawX; c < max; c++)
    {
        if (c >= 0 && c < option.size)
        {
            SetFontColor(0x00000000 | ((alpha * CalculateAlphaList(c, selIndex, maxPerPage)) / 0xFF), 0);
            
            if (option.name[c])
                DrawString(MENU_SPLIT_OFF + MENU_ICON_OFF, yOff, option.name[c]);
            
            //Selector
            if (c == selIndex)
            {
                int i = 0;
				for (i = MENU_SPLIT_OFF; i < 848; i++)
					DrawTexture(menu_textures[mark_line_png_index], i, yOff, 0, menu_textures[mark_line_png_index].texture.width, menu_textures[mark_line_png_index].texture.height, 0xFFFFFF00 | alpha);
            }
            
            cIndex++;
        }
        yOff += y_inc;
    }
}
开发者ID:Dnawrkshp,项目名称:ArtemisPS3,代码行数:38,代码来源:menu_cheats.c

示例6: BltSmartBuffer

void BltSmartBuffer(IDirect3DDevice9* Device)
{
    if (SmartGlobal != nullptr)
    {
        std::uint8_t* Ptr = reinterpret_cast<std::uint8_t*>(SmartGlobal->dbg);
        for (int I = 0; I < SmartGlobal->height; ++I)
        {
            for (int J = 0; J < SmartGlobal->width; ++J)
            {
                std::uint8_t B = *(Ptr++);
                std::uint8_t G = *(Ptr++);
                std::uint8_t R = *(Ptr++);
                *(Ptr++) = (B == 0 && G == 0 && R == 0) ? 0 : 0xFF;
            }
        }

        if (!Texture) /**Set Device->Reset for more info.**/
        {
            LoadTexture(Device, static_cast<unsigned char*>(SmartGlobal->dbg), SmartGlobal->width, SmartGlobal->height, Texture);
        }
        /*else
        {
            memcpy(TexturePixels, SmartGlobal->dbg, SmartGlobal->width * SmartGlobal->height * 4);
        }*/

        DrawTexture(Device, Texture, 0, 0, SmartGlobal->width, SmartGlobal->height);
        SafeRelease(Texture);
    }
}
开发者ID:Brandon-T,项目名称:DXI,代码行数:29,代码来源:SmartJNI.cpp

示例7: Render

int Render() {
	RenderVPL();
	RenderVPLPos();
	RenderVPLNormal();
	RenderGI();
	for (int i = 0; i < 6; i ++)
		BlurGI(giRT);

	RenderShadowmap();
	RenderObject();

	
	glViewport(0, 0, windowWidth, windowHeight);
	glBindFramebuffer(GL_FRAMEBUFFER, 0);
	glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	postShader.Bind();
	// テクスチャ描画
	glActiveTexture(GL_TEXTURE0);
	glBindTexture(GL_TEXTURE_2D, cameraRT->Texture());
	postShader.SetUniform("texture", (int)0);
	postShader.SetUniform("resolution", (float)windowWidth, (float)windowHeight);
	postShader.SetUniform("time", (float)SDL_GetTicks());
	DrawTexture(0, 0, 1, 1);
	postShader.Unbind();	

	SDL_GL_SwapBuffers();
	return 0;
}
开发者ID:RobertBeckebans,项目名称:rsm,代码行数:29,代码来源:main.cpp

示例8: GetMaxGLTexCoords

DWORD SpoutSenderSDK2::ProcessOpenGL(ProcessOpenGLStruct *pGL)
{
	
	// We need a texture to process
	if (pGL->numInputTextures < 1) return FF_FAIL;
	if (pGL->inputTextures[0] == NULL) return FF_FAIL;
  
	FFGLTextureStruct &InputTexture = *(pGL->inputTextures[0]);

	// get the max s,t that correspond to the width, height
	// of the used portion of the allocated texture space
	FFGLTexCoords maxCoords = GetMaxGLTexCoords(InputTexture);

	// Draw now whether a sender has initialized or not
	DrawTexture(InputTexture.Handle, maxCoords);

	// If there is no sender name yet, the sender cannot be created
	if(!UserSenderName[0]) {
		return FF_SUCCESS; // keep waiting for a name
	}
	
	// Otherwise create a sender if not initialized yet
	else if(!bInitialized) {

		// Update the sender name
		strcpy_s(SenderName, 256, UserSenderName); 

		// Set global width and height so any change can be tested
		m_Width  = (unsigned int)InputTexture.Width;
		m_Height = (unsigned int)InputTexture.Height;
		// Create a new sender
		bInitialized = sender.CreateSender(SenderName, m_Width, m_Height);
		if(!bInitialized) {
			sender.spout.SelectSenderPanel("Could not create sender\nTry another name");
			UserSenderName[0] = 0; // wait for another name to be entered
		}
		return FF_SUCCESS; // give it one frame to initialize
	}
	// Has the texture size or user entered sender name changed
	else if(m_Width  != (unsigned int)InputTexture.Width 
	 || m_Height != (unsigned int)InputTexture.Height
	 || strcmp(SenderName, UserSenderName) != 0 ) {
			// Release existing sender
			sender.ReleaseSender();
			bInitialized = false;
			return FF_SUCCESS; // return for initialization on the next frame
	}

	// Render the Freeframe texture into the shared texture
	// Important - pass the FFGL host FBO to restore the binding because Spout uses a local fbo
	// Default aspect = 1.0, default invert flag = true
	if(bMemoryMode)
		sender.SendTexture(InputTexture.Handle, GL_TEXTURE_2D, m_Width, m_Height);
	else
		sender.DrawToSharedTexture(InputTexture.Handle, GL_TEXTURE_2D,  m_Width, m_Height, (float)maxCoords.s, (float)maxCoords.t, 1.0f, true, pGL->HostFBO);

	return FF_SUCCESS;

}
开发者ID:demondias,项目名称:Spout2,代码行数:59,代码来源:SpoutSenderSDK2.cpp

示例9: RenderObject

void RenderObject() {
	cameraRT->Bind();

	glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	
	glEnable(GL_DEPTH_TEST);

	shader.Bind();
	shader.SetUniform("resolution", (float)cameraRT->Size(),  (float)cameraRT->Size());
	shader.SetUniform("uAmbient", ambient[0], ambient[1], ambient[2], ambient[3]);
	shader.SetUniform("uLightIntensity", lightIntensity[0], lightIntensity[1], lightIntensity[2], lightIntensity[3]);

	glActiveTexture(GL_TEXTURE0);
	glBindTexture(GL_TEXTURE_2D, lightRT->Texture());
	shader.SetUniform("shadowMap", (int)0);

	
	glActiveTexture(GL_TEXTURE1);
	glBindTexture(GL_TEXTURE_2D, giRT->Texture());
	shader.SetUniform("giTexture", (int)1);


	SetMatrix(shader);
	DrawObjects(shader);

	shader.Unbind();

	// テクスチャ描画
	const float aspect = (float)windowWidth / windowHeight;
	glActiveTexture(GL_TEXTURE0);
	glBindTexture(GL_TEXTURE_2D, lightRT->Texture());
	DrawTexture(0.9f, -0.8f, 0.1f, 0.1f * aspect);
	
	glBindTexture(GL_TEXTURE_2D, vplRT->Texture());
	DrawTexture(0.6f, -0.8f, 0.1f, 0.1f * aspect);
	
	glBindTexture(GL_TEXTURE_2D, vplPosRT->Texture());
	DrawTexture(0.3f, -0.8f, 0.1f, 0.1f * aspect);
	
	glBindTexture(GL_TEXTURE_2D, vplNormalRT->Texture());
	DrawTexture(0.0f, -0.8f, 0.1f, 0.1f * aspect);
	
	glBindTexture(GL_TEXTURE_2D, giRT->Texture());
	DrawTexture(-0.3f, -0.8f, 0.1f, 0.1f * aspect);
}
开发者ID:RobertBeckebans,项目名称:rsm,代码行数:46,代码来源:main.cpp

示例10: DrawGameList

/*
 * Cheats Codes Selection Menu
 */
void DrawGameList(int selIndex, struct game_entry * games, int glen, u8 alpha)
{
    SetFontSize(14, 16);
	SetCurrentFont(font_comfortaa_regular);
    
    int game_y = 80, y_inc = 20;
    int maxPerPage = (512 - (game_y * 2)) / y_inc;
    
    int x = selIndex - (maxPerPage / 2);
    int max = maxPerPage + selIndex;
    
    if (max > glen)
        max = glen;
    
    
    for (; x < max; x++)
    {
        int xo = 0; //(((selIndex - x) < 0) ? -(selIndex - x) : (selIndex - x));
        
        if (x >= 0)
        {
			u8 a = ((alpha * CalculateAlphaList(x, selIndex, maxPerPage)) / 0xFF);
			if (isGameActivated(games[x]))
			{
				DrawTextureCentered(menu_textures[mark_arrow_png_index], MENU_ICON_OFF + (MENU_TITLE_OFF / 2), game_y + (y_inc / 2), 0, MENU_TITLE_OFF / 3, y_inc / 2, 0xFFFFFF00 | a);
			}
            SetFontColor(0x00000000 | a, 0x00000000);
			if (games[x].name)
			{
				char * nBuffer = (char*)malloc(strlen(games[x].name));
				strcpy(nBuffer, games[x].name);
				int game_name_width = 0;
				while ((game_name_width = WidthFromStr(nBuffer)) > 0 && (MENU_ICON_OFF + (MENU_TITLE_OFF * 1) - xo + game_name_width) > (800 - (MENU_ICON_OFF * 3) - xo))
					nBuffer[strlen(nBuffer) - 1] = '\0';
				DrawString(MENU_ICON_OFF + (MENU_TITLE_OFF * 1) - xo, game_y, nBuffer);
				free(nBuffer);
			}
			if (games[x].title_id)
				DrawString(800 - (MENU_ICON_OFF * 3) - xo, game_y, games[x].title_id);
			if (games[x].version)
				DrawString(800 - (MENU_ICON_OFF * 1) - xo, game_y, games[x].version);
        }
        
        if (x == selIndex)
        {
            int c;
            for (c = 0; c < 848; c++)
				DrawTexture(menu_textures[mark_line_png_index], c, game_y, 0, menu_textures[mark_line_png_index].texture.width, menu_textures[mark_line_png_index].texture.height, 0xFFFFFF00 | alpha);
        
			DrawTextureCenteredX(menu_textures[mark_arrow_png_index], MENU_ICON_OFF - 20, game_y, 0, (2 * y_inc) / 3, y_inc + 2, 0xFFFFFF00 | alpha);
		}
        
        game_y += y_inc;
    }
    
    DrawScrollBar(selIndex, glen, y_inc, 800, alpha);
    
}
开发者ID:Dnawrkshp,项目名称:ArtemisPS3,代码行数:61,代码来源:menu_cheats.c

示例11: DrawTexture

void UUTBetrayalScoreboard::DrawDaggers(AUTBetrayalPlayerState* PRI, float RenderDelta, float XOffset, float YOffset)
{
	float BarOpacity = 0.75f;
	float DaggerAspect = DaggerTexCoords.VL == 0.0 ? 0.0 : DaggerTexCoords.UL / DaggerTexCoords.VL;

	if (PRI->BetrayalCount >= 100)
	{
		// draw simple format "x NUM"
		DrawTexture(UT3GHudTexture, XOffset, YOffset, 32 * DaggerAspect, 32, DaggerTexCoords.U, DaggerTexCoords.V, DaggerTexCoords.UL, DaggerTexCoords.VL, BarOpacity, FLinearColor::White);
		XOffset += 32 * DaggerAspect + (DaggerSpacing * RenderScale);

		FText DaggerString = FText::Format(NSLOCTEXT("UTBetrayalScoreboard", "DaggersShortString", "x {0}"), FText::AsNumber(PRI->BetrayalCount));
		DrawText(DaggerString, XOffset, YOffset + ColumnY, UTHUDOwner->SmallFont, 1.0f, 1.0f, FLinearColor::Gray, ETextHorzPos::Left, ETextVertPos::Center);
	}
	else
	{
		int32 NumGoldDaggers = PRI->BetrayalCount / 5;
		int32 NumSilverDaggers = PRI->BetrayalCount % 5;

		//Start drawing the daggers
		for (int32 i = 0; i < NumGoldDaggers; i++)
		{
			DrawTexture(UT3GHudTexture, XOffset, YOffset, 32 * DaggerAspect, 32, DaggerTexCoords.U, DaggerTexCoords.V, DaggerTexCoords.UL, DaggerTexCoords.VL, BarOpacity, GoldLinearColor);

			//Don't bump for the last gold dagger drawn
			if (i<NumGoldDaggers - 1)
			{
				XOffset += (DaggerSpacing * RenderScale);
			}
		}

		//Add spacing between gold/silver daggers
		if (NumGoldDaggers > 0)
		{
			XOffset += (SilverDaggerOffset * RenderScale);
		}

		for (int32 i = 0; i < NumSilverDaggers; i++)
		{
			DrawTexture(UT3GHudTexture, XOffset, YOffset, 32 * DaggerAspect, 32, DaggerTexCoords.U, DaggerTexCoords.V, DaggerTexCoords.UL, DaggerTexCoords.VL, BarOpacity, SilverLinearColor);

			XOffset += (DaggerSpacing * RenderScale);
		}
	}
}
开发者ID:RattleSN4K3,项目名称:UT4-Gametype-Betrayal,代码行数:45,代码来源:UTBetrayalScoreboard.cpp

示例12: main

int main()
{
    // Initialization
    //--------------------------------------------------------------------------------------
    int screenWidth = 800;
    int screenHeight = 450;

    InitWindow(screenWidth, screenHeight, "raylib [texture] example - texture rectangle");

    const char textLine1[] = "Lena image is a standard test image which has been in use since 1973.";
    const char textLine2[] = "It comprises 512x512 pixels, and it is probably the most widely used";
    const char textLine3[] = "test image for all sorts of image processing algorithms.";

    // NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required)
    Texture2D texture = LoadTexture("resources/lena.png");        // Texture loading

    Rectangle eyesRec = { 225, 240, 155, 50 };  // Part of the texture to draw
    Vector2 position = { 369, 241 };
    //--------------------------------------------------------------------------------------

    // Main game loop
    while (!WindowShouldClose())    // Detect window close button or ESC key
    {
        // Update
        //----------------------------------------------------------------------------------
        // TODO: Update your variables here
        //----------------------------------------------------------------------------------

        // Draw
        //----------------------------------------------------------------------------------
        BeginDrawing();

            ClearBackground(RAYWHITE);

            DrawText("LENA", 220, 100, 20, PINK);

            DrawTexture(texture, screenWidth/2 - 256, 0, Fade(WHITE, 0.1f)); // Draw background image

            DrawTextureRec(texture, eyesRec, position, WHITE);  // Draw eyes part of image

            DrawText(textLine1, 220, 140, 10, DARKGRAY);
            DrawText(textLine2, 220, 160, 10, DARKGRAY);
            DrawText(textLine3, 220, 180, 10, DARKGRAY);

        EndDrawing();
        //----------------------------------------------------------------------------------
    }

    // De-Initialization
    //--------------------------------------------------------------------------------------
    UnloadTexture(texture);       // Texture unloading

    CloseWindow();                // Close window and OpenGL context
    //--------------------------------------------------------------------------------------

    return 0;
}
开发者ID:Libertium,项目名称:raylib,代码行数:57,代码来源:textures_rectangle.c

示例13: DrawTexture

void CFrameBufferObject::DrawTexture( CDrawContext * pDrawContext ) {
 
    CMatrix< float > mat;
    mat.Identity();
    mat.Translate( 0.0f, m_Height, 0.0f );
    
    DrawTexture( pDrawContext, &mat );
    
}
开发者ID:jntessier,项目名称:Sora,代码行数:9,代码来源:FrameBuffer.cpp

示例14: DrawAisle01Screen

// Gameplay Screen Draw logic
void DrawAisle01Screen(void)
{
    DrawTexture(background, -scroll, 0, WHITE);
    
    // Draw monsters
	DrawMonster(lamp, scroll);
    DrawMonster(picture, scroll);
    
    // Draw door
    Vector2 doorScrollPos = { doorCenter.position.x - scroll, doorCenter.position.y };
    if (doorCenter.selected) DrawTextureRec(doors, doorCenter.frameRec, doorScrollPos, GREEN);
    else DrawTextureRec(doors, doorCenter.frameRec, doorScrollPos, WHITE);
    
    doorScrollPos = (Vector2){ doorLeft.position.x - scroll, doorLeft.position.y };
    if (doorLeft.selected) DrawTextureRec(doors, doorLeft.frameRec, doorScrollPos, GREEN);
    else DrawTextureRec(doors, doorLeft.frameRec, doorScrollPos, WHITE);
    
    doorScrollPos = (Vector2){ doorRight.position.x - scroll, doorRight.position.y };
    if (doorRight.selected) DrawTextureRec(doors, doorRight.frameRec, doorScrollPos, GREEN);
    else DrawTextureRec(doors, doorRight.frameRec, doorScrollPos, WHITE);
    
    // Draw messsages
    if (msgState < 2) DrawRectangle(0, 40, GetScreenWidth(), 200, Fade(LIGHTGRAY, 0.5f));
    else if (msgState == 2) DrawRectangle(0, 80, GetScreenWidth(), 100, Fade(LIGHTGRAY, 0.5f));

    if (msgState == 0) 
    {
        DrawTextEx(font, msgBuffer, (Vector2){ msgPosX, 80 }, font.baseSize, 2, WHITE);
    }
    else if (msgState == 1)
    {
        DrawTextEx(font, message, (Vector2){ msgPosX, 80 }, font.baseSize, 2, WHITE);
        
        if ((msgCounter/30)%2) DrawText("PRESS ENTER or CLICK", GetScreenWidth() - 280, 200, 20, BLACK);
    }
    else if (msgState == 2)
    {
        if ((msgCounter/30)%2)
        {
            DrawTextEx(font, "CHOOSE WISELY!", (Vector2){ 300, 95 }, font.baseSize*2, 2, WHITE);
            
            DrawRectangleRec(lamp.bounds, Fade(RED, 0.6f));
            DrawRectangleRec(picture.bounds, Fade(RED, 0.6f));
        }
    }
    else
    {
        if ((monsterHover) && ((msgCounter/30)%2))
        {
            DrawRectangle(0, 0, GetScreenWidth(), 50, Fade(LIGHTGRAY, 0.5f));
            DrawText("PRESS SPACE or CLICK to INTERACT", 420, 15, 20, BLACK);
        }
    }

    DrawPlayer();       // NOTE: Also draws mouse pointer!
}
开发者ID:raysan5,项目名称:raylib,代码行数:57,代码来源:screen_aisle01.c

示例15: DrawTexture

void nGraphics::DrawTexture(IDirect3DTexture9* texture,const nPoint& point,const nColor& color)
{
	// Don't draw if fully transparent
	if(color.a <= 0.0f)
		return;

	D3DSURFACE_DESC desc;
	texture->GetLevelDesc(0,&desc);
	DrawTexture(texture,nRect(point.x,point.y,point.x+desc.Width,point.y+desc.Height),color);
}
开发者ID:m1h4,项目名称:MissleCommand,代码行数:10,代码来源:nGraphics.cpp


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