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


C++ GetScreenHeight函数代码示例

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


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

示例1: DrawTitleScreen

// Title Screen Draw logic
void 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,代码来源:screen_title.c

示例2: 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,代码来源:RenderTexture.hpp

示例3: 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,代码来源:RenderTexture.hpp

示例4: 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,代码来源:SpriteBatch.hpp

示例5: 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,代码来源:Home.cpp

示例6: GetPhyScreenWidth

void XGraphicsOpenGL::SetViewport( int left, int top, int right, int bottom )
{
    XGraphics::SetViewport( left, top, right, bottom );
    //
    float ratioX = GetPhyScreenWidth() / GetScreenWidth();
    float ratioY = GetPhyScreenHeight() / GetScreenHeight();
    int w = (int)((right - left) * ratioX);
    int h = (int)((bottom - top) * ratioY);
    int x = (int)(left * ratioX);
    int y = (int)((GetScreenHeight() - (top + (bottom - top)))) * ratioY;
    glViewport( x, y, w, h );	// EAGLView에서 프레임버퍼 바인드할때 하도록 바꿔라
//    glViewport( 100, 100, 200, 200 );	// EAGLView에서 프레임버퍼 바인드할때 하도록 바꿔라
}
开发者ID:xahgo,项目名称:tama,代码行数:13,代码来源:XGraphicsOpenGL.cpp

示例7: 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,代码来源:Framework.cpp

示例8: GetScreenCenter

 /**
  * Returns the raster coordinates at the center of the map.
  */
 gcc_pure
 RasterPoint GetScreenCenter() const {
   RasterPoint pt;
   pt.x = GetScreenWidth() / 2;
   pt.y = GetScreenHeight() / 2;
   return pt;
 }
开发者ID:damianob,项目名称:xcsoar,代码行数:10,代码来源:WindowProjection.hpp

示例9: GetScreenWidth

void MouseDevice::CheckForWrap()
   {
   #define  WRAP_MARGIN 10
   //int sy = GetSystemMetrics(SM_CYSCREEN);
   //int sx = GetSystemMetrics(SM_CXSCREEN);
   // CCJ 6.6.00 These new maxutil functions supports multiple monitors
   int sx = GetScreenWidth();
   int sy = GetScreenHeight();

   POINT pt;
   GetCursorPos(&pt);
   if (pt.y<WRAP_MARGIN) {
      ybase += sy-WRAP_MARGIN-pt.y;
      pt.y   = sy-WRAP_MARGIN;
      SetCursorPos(pt.x, pt.y);     
   } else 
   if (pt.y>sy-WRAP_MARGIN) {       
      ybase  += WRAP_MARGIN-pt.y;
      pt.y    = WRAP_MARGIN;        
      SetCursorPos(pt.x, pt.y);     
      }
   if (pt.x<WRAP_MARGIN) {
      xbase += sx-WRAP_MARGIN-pt.x;
      pt.x   = sx-WRAP_MARGIN;
      SetCursorPos(pt.x, pt.y);     
   } else 
   if (pt.x>sx-WRAP_MARGIN) {       
      xbase  += WRAP_MARGIN-pt.x;
      pt.x    = WRAP_MARGIN;        
      SetCursorPos(pt.x, pt.y);     
      }
   }
开发者ID:artemeliy,项目名称:inf4715,代码行数:32,代码来源:mcdevice.cpp

示例10: DrawEndingScreen

// Ending Screen Draw logic
void DrawEndingScreen(void)
{
    // TODO: Draw ENDING screen here!
    DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), BLUE);
    DrawTextEx(font, "ENDING SCREEN", (Vector2){ 20, 10 }, font.baseSize*3, 4, DARKBLUE);
    DrawText("PRESS ENTER or TAP to RETURN to TITLE SCREEN", 120, 220, 20, DARKBLUE);
}
开发者ID:raysan5,项目名称:raylib,代码行数:8,代码来源:screen_ending.c

示例11: GetScreenWidth

	void RenderSystem::v_Init()
	{
		auto sw = GetScreenWidth();
		auto sh = GetScreenHeight();

		m_Font.Init(sw, sh);
	}
开发者ID:jaccen,项目名称:OpenGL-Framework,代码行数:7,代码来源:RenderSystem.cpp

示例12: DrawLevel07Screen

// Level07 Screen Draw logic
void 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,代码来源:screen_level07.c

示例13: TakeScreenshot

void TakeScreenshot()
{
    CImage32 screen(GetScreenWidth(), GetScreenHeight());
    DirectGrab(0, 0, GetScreenWidth(), GetScreenHeight(), screen.GetPixels());

    // try to create the screenshot directory
    MakeDirectory(s_ScreenshotDirectory.c_str());

    char filename[MAX_PATH];
    sprintf(filename, "screenshot.png");

    std::string save_path;
    save_path  = s_ScreenshotDirectory + '/';
    save_path += filename;
    screen.Save(save_path.c_str());
}
开发者ID:FlyingJester,项目名称:sphere,代码行数:16,代码来源:mac_screenshot.cpp

示例14: DrawEndingScreen

// Ending Screen Draw logic
void DrawEndingScreen(void)
{
    // TODO: Draw ENDING screen here!
    DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), BLUE);
    DrawText("ENDING SCREEN", 20, 20, 40, DARKBLUE);
    DrawText("PRESS ENTER to RETURN to TITLE SCREEN", 120, 220, 20, DARKBLUE);
}
开发者ID:raysan5,项目名称:raylib,代码行数:8,代码来源:screen_ending.c

示例15: Draw

void UISlider::Draw(const UIGeometricData &geometricData)
{
    const Rect & aRect =  thumbButton->GetGeometricData().GetUnrotatedRect();
    float32 clipPointAbsolute = aRect.x + aRect.dx * 0.5f;

    const Vector2& drawTranslate = RenderManager::Instance()->GetDrawTranslate();
    const Vector2& drawScale = RenderManager::Instance()->GetDrawScale();

    float32 screenXMin = (Core::Instance()->GetVirtualScreenXMin() - drawTranslate.x) / drawScale.x;
    float32 screenXMax = (Core::Instance()->GetVirtualScreenXMax() - drawTranslate.x) / drawScale.x;
    float32 screenYMin = - drawTranslate.y / drawScale.y;
    float32 screenYMax = (GetScreenHeight() - drawTranslate.y) / drawScale.y;

    if (minBackground)
    {
        minBackground->SetParentColor(GetBackground()->GetDrawColor());
        RenderManager::Instance()->ClipPush();
        RenderManager::Instance()->ClipRect(Rect(screenXMin, screenYMin, clipPointAbsolute - screenXMin, screenYMax));
        minBackground->Draw(geometricData);
        RenderManager::Instance()->ClipPop();
    }
    if (maxBackground)
    {
        maxBackground->SetParentColor(GetBackground()->GetDrawColor());
        RenderManager::Instance()->ClipPush();
        RenderManager::Instance()->ClipRect(Rect(clipPointAbsolute, screenYMin, screenXMax - clipPointAbsolute, screenYMax));
        maxBackground->Draw(geometricData);
        RenderManager::Instance()->ClipPop();
    }

    if (!minBackground && !maxBackground)
    {
        UIControl::Draw(geometricData);
    }
}
开发者ID:galek,项目名称:dava.framework,代码行数:35,代码来源:UISlider.cpp


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