您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetScreenWidth函数代码示例

51自学网 2021-06-01 21:14:37
  C++
这篇教程C++ GetScreenWidth函数代码示例写得很实用,希望能帮到您。

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

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

示例1: glClearBufferfv

	void RenderSystem::v_Render()	{		static const float bgColor[4] = {0.2f, 0.3f, 0.4f, 1.0f};		glClearBufferfv(GL_COLOR, 0, bgColor);		static const float one = 1.0f;		glClearBufferfv(GL_DEPTH, 0, &one);		update();		static ogl::MvpMatrix matrix;		matrix.view  = m_Camera.GetViewMatrix();		matrix.proj  = glm::perspective(glm::radians(m_Camera.GetZoom() ), getAspect(), 0.1f, 1000.0f);		matrix.model = glm::mat4(1.0f);		// 1. Draw scene as normal in multisampled buffers         		m_Framebuffer.Bind();		glClearColor(0.1f, 0.1f, 0.1f, 1.0f);		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);	    m_Cube.Render(matrix);		// 2. Now blit multisampled buffer(s) to default framebuffers		glBindFramebuffer(GL_READ_FRAMEBUFFER, m_Framebuffer.GetFbo());		glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);						glBlitFramebuffer(0, 0, GetScreenWidth(), GetScreenWidth(), 0, 0, GetScreenWidth(), GetScreenWidth(), GL_COLOR_BUFFER_BIT, GL_NEAREST);     	}
开发者ID:byhj,项目名称:byhj-Render,代码行数:28,


示例2: DrawLevel07Screen

// Level07 Screen Draw logicvoid DrawLevel07Screen(void){    // Draw Level07 screen here!    DrawCircleV(leftCirclePos, circleRadius, leftCircleColor);    DrawCircleV(middleCirclePos, circleRadius, middleCircleColor);    DrawCircleV(rightCirclePos, circleRadius, rightCircleColor);        if (leftCircleActive) DrawCircleV(leftBtnPos, btnRadius, GRAY);    else DrawCircleV(leftBtnPos, btnRadius, LIGHTGRAY);        if (middleCircleActive) DrawCircleV(middleBtnPos, btnRadius, GRAY);    else DrawCircleV(middleBtnPos, btnRadius, LIGHTGRAY);        if (rightCircleActive) DrawCircleV(rightBtnPos, btnRadius, GRAY);    else DrawCircleV(rightBtnPos, btnRadius, LIGHTGRAY);                if (levelFinished)    {        DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(LIGHTGRAY, 0.6f));        DrawText("LEVEL 07", GetScreenWidth()/2 - MeasureText("LEVEL 07", 30)/2, 20, 30, GRAY);        DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, GRAY);    }    else DrawText("LEVEL 07", GetScreenWidth()/2 - MeasureText("LEVEL 07", 30)/2, 20, 30, LIGHTGRAY);}
开发者ID:AdanBB,项目名称:raylib,代码行数:27,


示例3: DrawTitleScreen

// Title Screen Draw logicvoid DrawTitleScreen(void){    // TODO: Draw TITLE screen here!    DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), BLUE);    //DrawTextureEx(titleTexture, (Vector2){GetScreenWidth()/2-titleTexture.width/2, GetScreenHeight()/2-titleTexture.height/2}, 0, 1, Fade(WHITE, titleAlpha));    DrawRectangle(GetScreenWidth()/2-200, GetScreenHeight()/2-100, 400, 150, Fade(YELLOW, titleAlpha));    DrawText("PRESS <ENTER> to START the GAME", 208, GetScreenHeight()-75, 20, Fade(BLACK, startTextAlpha));}
开发者ID:MarcMDE,项目名称:TapToJump,代码行数:9,


示例4: HandleLostGraphicsContext

 void HandleLostGraphicsContext() {     spriteBatch.reset(new NinjaParty::SpriteBatch(GetScreenWidth(), GetScreenHeight()));          texture = assetManager->LoadTexture("Star.png", true);          renderTexture.reset(new NinjaParty::RenderTexture(GetScreenWidth() / 2, GetScreenHeight())); }        
开发者ID:ThirdPartyNinjas,项目名称:NinjaParty,代码行数:8,


示例5: LoadContent

 void LoadContent(const std::string &assetPath, const std::string &assetArchivePath) {     assetManager.reset(new NinjaParty::AssetManager(assetPath, assetArchivePath));     spriteBatch.reset(new NinjaParty::SpriteBatch(GetScreenWidth(), GetScreenHeight()));          texture = assetManager->LoadTexture("Star.png");          renderTexture.reset(new NinjaParty::RenderTexture(GetScreenWidth() / 2, GetScreenHeight())); }
开发者ID:ThirdPartyNinjas,项目名称:NinjaParty,代码行数:9,


示例6: DrawAisle01Screen

// Gameplay Screen Draw logicvoid 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,


示例7: Draw

 void Draw() {     ClearScreen(NinjaParty::Color::Black);          spriteBatch->Begin();     spriteBatch->Draw(texture, NinjaParty::Vector2::ZERO, nullptr, NinjaParty::Vector2::ZERO, rotation, NinjaParty::Color(0, 1, 0, 1));     spriteBatch->Draw(texture, NinjaParty::Vector2(GetScreenWidth() / 2, GetScreenHeight() / 2), nullptr, NinjaParty::Vector2(0.5f, 0.5f), rotation, NinjaParty::Color(1, 1, 1, 0.5f));     spriteBatch->Draw(texture, NinjaParty::Vector2(GetScreenWidth(), GetScreenHeight()), nullptr, NinjaParty::Vector2(1.0f, 1.0f), rotation, NinjaParty::Color(1, 0, 0, 1));     spriteBatch->End(); }
开发者ID:ThirdPartyNinjas,项目名称:NinjaParty,代码行数:10,


示例8: GetScreenWidth

void Home::InitTheUsernameLabel(){    usernameLabelColor = {255, 255, 255, 0}; //White color as rgba    usernameLabelText = "Welcome " + User::username + "...";    usernameLabelRect.x = GetScreenWidth() / 16;    usernameLabelRect.y = GetScreenHeight() / 15;    usernameLabelRect.w = GetScreenWidth() / usernameLabelText.length() * 3;    usernameLabelRect.h = GetScreenHeight() / usernameLabelText.length() * 2;}
开发者ID:nooro,项目名称:Kagan,代码行数:10,


示例9: sprintf

/* Draw text labels */void MyProjectMain::DrawStrings(){	// Build the string to print	char buf[128];	sprintf( buf, "Changing text %6d %6d", rand(), rand() );	// Clear the top of the screen, since we about to draw text on it.	CopyBackgroundPixels( 0, 0, GetScreenWidth(), 35 );	// Then draw the strings	DrawScreenString( 150, 10, buf, 0xffffff, NULL );	// And mark that area of the screen as having been changed, so it gets redrawn	SetNextUpdateRect( 0/*X*/, 0/*Y*/, GetScreenWidth(), 35/*Height*/ );}
开发者ID:tun57,项目名称:StephenSowoleG52CPP,代码行数:13,


示例10: Initialize

	bool Framework::Initialize()	{		Time::Reset();		if( false == InitializeWindow(_T("Prototype"), GetScreenWidth(), GetScreenHeight() ) ) return false;		if( false == InitializeGraphicSystem( GetScreenWidth(), GetScreenHeight() ) ) return false;		if( false == InitializeInputSystem() ) return false;		m_rpFrameRate = new FrameRate();		DebugFont::GetInstance().Initialize();		return true;	}
开发者ID:PPNav,项目名称:prototype,代码行数:14,


示例11: GetSize

void MaterialEditor::WillAppear(){    UIScreen *activeScreen = UIScreenManager::Instance()->GetScreen();    if(activeScreen)    {        float32 height = GetSize().y;        SetRect(Rect(GetScreenWidth()/8.f, (GetScreenHeight() - height) / 2.f, GetScreenWidth()/4.f*3.f, height));    }        UpdateInternalMaterialsVector();    UpdateNodeMaterialsVector();        OnAllPressed(NULL, NULL, NULL);}
开发者ID:abaradulkin,项目名称:dava.framework,代码行数:14,


示例12: SetCaption

void CTestGame::Init(){    CGame::Init();    SetCaption("Test Game");    mouse->SetVisible(false);    //create game space    SDL_Rect bounds;    bounds.x = 0;    bounds.y = 0;    bounds.w = GetScreenWidth();    bounds.h = GetScreenHeight();    space = new CEntitySpace(bounds);    //create entity    CSurface* surf = CSurface::Load("smile.png");    surf->SetColorKey(255,0,106);    entity = new CEntity(surf,10.0,false);    entity->position.x = entity->GetWidth()/2;    entity->position.y = entity->GetHeight()/2;    space->Add(entity);    //create segments    seg = new CSegment(SDL_MapRGB(Display_Surface->GetSDLSurface()->format,                                            0,0,0));    seg->v1.x = 0;    seg->v1.y = 500;    seg->v2.x = 500;    seg->v2.y = 500;    space->Add(seg);}
开发者ID:conwill708,项目名称:Code-Blocks-Projects,代码行数:34,


示例13: DrawTitleScreen

// Title Screen Draw logicvoid DrawTitleScreen(void){    // TODO: Draw TITLE screen here!    DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), GREEN);    DrawText("TITLE SCREEN", 20, 20, 40, DARKGREEN);    DrawText("PRESS ENTER to JUMP to GAMEPLAY SCREEN", 160, 220, 20, DARKGREEN);}
开发者ID:AdanBB,项目名称:raylib,代码行数:8,


示例14: assert

fixedMapWindowProjection::CalculateMapScale(unsigned scale) const{  assert(scale < ScaleListCount);  return fixed(ScaleList[scale]) *    GetMapResolutionFactor() / Layout::Scale(GetScreenWidth());}
开发者ID:galippi,项目名称:xcsoar,代码行数:7,


示例15: FillRect

void XGraphicsOpenGL::FillRect( float x, float y, float w, float h, XCOLOR collt, XCOLOR colrt, XCOLOR collb, XCOLOR colrb  ){	if( w == 0 || h == 0 )	return;    if( w < 0 )    {        x -= w;     // 
C++ GetScriptContext函数代码示例
C++ GetScreenRect函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。