本文整理汇总了C++中GetScreenHeight函数的典型用法代码示例。如果您正苦于以下问题:C++ GetScreenHeight函数的具体用法?C++ GetScreenHeight怎么用?C++ GetScreenHeight使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetScreenHeight函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: glBindFramebuffer
void shadowmapping_app::render_scene(double currentTime)
{
static const GLfloat ones[] = { 1.0f };
static const GLfloat zero[] = { 0.0f };
static const GLfloat gray[] = { 0.1f, 0.1f, 0.1f, 0.0f };
static const GLenum attachments[] = { GL_COLOR_ATTACHMENT0 };
static const vmath::mat4 scale_bias_matrix = vmath::mat4(vmath::vec4(0.5f, 0.0f, 0.0f, 0.0f),
vmath::vec4(0.0f, 0.5f, 0.0f, 0.0f),
vmath::vec4(0.0f, 0.0f, 0.5f, 0.0f),
vmath::vec4(0.5f, 0.5f, 0.5f, 1.0f));
glBindFramebuffer(GL_FRAMEBUFFER, depth_fbo);
glDrawBuffers(1, attachments);
glViewport(0, 0, GetScreenWidth(), GetScreenHeight());
glClearBufferfv(GL_COLOR, 0, gray);
glClearBufferfv(GL_DEPTH, 0, ones);
glUseProgram(view_program);
glUniformMatrix4fv(uniforms.view.proj_matrix, 1, GL_FALSE, camera_proj_matrix);
glClearBufferfv(GL_DEPTH, 0, ones);
int i;
for (i = 0; i < OBJECT_COUNT; i++)
{
vmath::mat4& model_matrix = objects[i].model_matrix;
glUniformMatrix4fv(uniforms.view.mv_matrix, 1, GL_FALSE, camera_view_matrix * objects[i].model_matrix);
glUniform3fv(uniforms.view.diffuse_albedo, 1, objects[i].diffuse_albedo);
objects[0].obj.render();
}
glBindFramebuffer(GL_FRAMEBUFFER, 0);
}
开发者ID:byhj,项目名称:OpenGL-Bluebook,代码行数:33,代码来源:ch10-03-Depth-of-Filed.cpp
示例17: DrawGameplayScreen
// Gameplay Screen Draw logic
void DrawGameplayScreen(void)
{
// TODO: Draw GAMEPLAY screen here!
HideCursor();
// Background
DrawTextureEx(bg, Vector2Zero(), 0, 10, WHITE);
// Ground
DrawRectangle(0, groundPositionY, GetScreenWidth(), 1, RED);
DrawPlayer(player);
// Draw triangles
for (int i=0; i<maxTriangles; i++)
{
if (triangles[i].isActive) DrawObjectOnCameraPosition(triangleTexture, triangles[i].position);
}
for (int i=0; i<maxPlatforms; i++)
{
if (platforms[i].isActive) DrawObjectOnCameraPosition(platformTexture, platforms[i].position);
//if (platforms[i].isActive) DrawRectangleRec(platforms[i].collider, RED);
}
if (!startGame) DrawText ("PRESS SPACE", 20, GetScreenHeight()-30, 15, WHITE);
}
开发者ID:MarcMDE,项目名称:TapToJump,代码行数:29,代码来源:screen_gameplay.c
示例18: DrawTitleScreen
// Title Screen Draw logic
void 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,代码来源:screen_title.c
示例19: XERROR
//
// 지정된영역의 백버퍼데이타를 읽어서 surface에 옮긴다.
// GL은 프론트만 읽을수 있는줄알았는데 반대였다. 백버퍼만 읽을수 있다
// w,y,width,height: 스크린 좌표
void XGraphicsOpenGL::ScreenToSurface( int x, int y, int width, int height, XSurface *pSurface )
{
if( GetPixelFormat() != xPIXELFORMAT_RGB565 )
XERROR( "아직은 RGB565포맷만 사용가능함." );
int px, py, pw, ph; // 물리적스크린크기와 좌표.
float fRatioX, fRatioY;
// phyScreen과 screen의 비율로 좌표들을 변환.
fRatioX = (float)GetPhyScreenWidth() / GetScreenWidth();
fRatioY = (float)GetPhyScreenHeight() / GetScreenHeight();
px = x * fRatioX; py = y * fRatioY; // screen->physcreen 좌표로 변환
pw = width * fRatioX; ph = height * fRatioY;
//GL_NO_ERROR
DWORD *pdwBuffer = new DWORD[ pw * ph ];
glReadPixels(px, py, pw, ph, GL_RGBA, GL_UNSIGNED_BYTE, pdwBuffer ); // 위아래 뒤집혀진 이미지
DWORD *pDst = new DWORD[ pw * ph ];
// 위아래를 바꿈
for( int i = 0; i < ph; i ++ )
for( int j = 0; j < pw; j ++ )
pDst[ i * pw + j ] = pdwBuffer[ (ph-1-i) * pw + j ];
SAFE_DELETE_ARRAY( pdwBuffer );
pSurface->Create( pw, ph, 0, 0, xALPHA, pDst, sizeof(DWORD), 0, 0 );
#pragma messages( "pdwBuffer를 XSurfaceOpenGL::Create()내부에서 뽀개주도록 바꿔야 한다. 버그날까봐 일단 이상태로 놔둠" )
}
开发者ID:xahgo,项目名称:tama,代码行数:29,代码来源:XGraphicsOpenGL.cpp
示例20: psglInit
void ESVideo::Initialize ()
{
//Init PSGL
PSGLinitOptions initOpts = {PSGL_INIT_MAX_SPUS | PSGL_INIT_HOST_MEMORY_SIZE, 1, false, 0, 0, 0, 0, 32 * 1024 * 1024};
psglInit(&initOpts);
Device = psglCreateDeviceAuto(GL_ARGB_SCE, GL_NONE, GL_MULTISAMPLING_NONE_SCE);
Context = psglCreateContext();
psglMakeCurrent(Context, Device);
psglResetCurrentContext();
//Get Screen Info
psglGetRenderBufferDimensions(Device, &ScreenWidth, &ScreenHeight);
WideScreen = psglGetDeviceAspectRatio(Device) > 1.5f;
glViewport(0, 0, GetScreenWidth(), GetScreenHeight());
//Some settings
OpenGLHelp::InitializeState();
glEnable(GL_VSYNC_SCE);
// Setup vertex buffer
VertexBuffer = (GLfloat*)memalign(128, VertexBufferCount * VertexSize * sizeof(GLfloat));
GLShader::ApplyVertexBuffer(VertexBuffer);
//Texture for FillRectangle
FillerTexture = new Texture(2, 2);
FillerTexture->Clear(0xFFFFFFFF);
}
开发者ID:cdenix,项目名称:psmame,代码行数:28,代码来源:CellVideo.cpp
注:本文中的GetScreenHeight函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论