Beispiel #1
0
// 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));
}
 void HandleLostGraphicsContext()
 {
     spriteBatch.reset(new NinjaParty::SpriteBatch(GetScreenWidth(), GetScreenHeight()));
     
     texture = assetManager->LoadTexture("Star.png", true);
     
     renderTexture.reset(new NinjaParty::RenderTexture(GetScreenWidth() / 2, GetScreenHeight()));
 }        
 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()));
 }
 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();
 }
Beispiel #5
0
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;
}
Beispiel #6
0
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에서 프레임버퍼 바인드할때 하도록 바꿔라
}
Beispiel #7
0
	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;
	}
Beispiel #8
0
 /**
  * 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;
 }
Beispiel #9
0
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);     
      }
   }
Beispiel #10
0
// 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);
}
	void RenderSystem::v_Init()
	{
		auto sw = GetScreenWidth();
		auto sh = GetScreenHeight();

		m_Font.Init(sw, sh);
	}
Beispiel #12
0
// 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);
}
Beispiel #13
0
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());
}
Beispiel #14
0
// 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);
}
Beispiel #15
0
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);
    }
}
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);
}
Beispiel #17
0
// 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);
}
Beispiel #18
0
// 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);
}
Beispiel #19
0
//
// 지정된영역의 백버퍼데이타를 읽어서 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()내부에서 뽀개주도록 바꿔야 한다. 버그날까봐 일단 이상태로 놔둠" )
}
Beispiel #20
0
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);
}
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);
}
Beispiel #22
0
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;     // 좌측 좌표를 -w만큼 이동시켜주고
        w = -w;     // w는 부호 바꿈
    }
    if( h < 0 )
    {
        y -= h;
        h = -h;
    }
	if( x > GetScreenWidth() || y > GetScreenHeight() )	// w, h가 마이너스가 올수도 있기땜에 이렇게 함
		return;
	if( x + w < 0 || y + h < 0 )
		return;
	
	//	if( x > GetScreenWidth() || y > GetScreenHeight() )
	//		return;
	//	if( w < 0 || h < 0 )
	//		return;
	
	
//	GLfloat r, g, b, a;
//	r = XCOLOR_RGB_R(color) / 255.0f;
//	g = XCOLOR_RGB_G(color) / 255.0f;
//	b = XCOLOR_RGB_B(color) / 255.0f;
//	a = XCOLOR_RGB_A(color) / 255.0f;
	//	if( a != 255 )	glEnable(GL_BLEND);		// 이거 자주불러주면 부하걸릴거 같다. 외부에서 블럭단위로 셋하게 하자.
	
	// width-1이 맞나? 안하는게 맞나?
	GLfloat pos[8] = { 0, h, w, h, 0, 0, w, 0 };
	GLfloat col[16] = {  _R(collb), _G(collb),_B(collb),_A(collb),	// 좌하
						_R(colrb), _G(colrb),_B(colrb),_A(colrb),	// 우하
						_R(collt), _G(collt),_B(collt),_A(collt),	// 좌상
						_R(colrt), _G(colrt),_B(colrt),_A(colrt)	};	// 우상
	glPushMatrix();
	glLoadIdentity();
	glTranslatef(x, y, 0);
	glScalef(1.0f, 1.0f, 1.0f);
	//    glLoadIdentity();
	
	glDisable( GL_TEXTURE_2D );
	glBindBuffer(GL_ARRAY_BUFFER, 0);
	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);	// 이건 안해줘도 되네.
	glVertexPointer(2, GL_FLOAT, 0, pos);
	glEnableClientState(GL_VERTEX_ARRAY);
	glColorPointer(4, GL_FLOAT, 0, col);
	glEnableClientState(GL_COLOR_ARRAY);
	glDisableClientState(GL_TEXTURE_COORD_ARRAY);
	
	glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
	
	glDisableClientState(GL_COLOR_ARRAY);
	glEnable( GL_TEXTURE_2D );
	glPopMatrix();
	//	if( a != 255 )	glDisable(GL_BLEND);
	
}
Beispiel #23
0
void GLApplication::Run()
{
	InitializeOpenGL();
	Initialize();
	Input::CreateSingleton();
	Gizmos::create();

	if (m_bDrawGUI)
	{
		ImGui_ImplGlfwGL3_Init(m_pWindow, true);
		ImGuiIO& io = ImGui::GetIO();
		io.DisplaySize.x = GetScreenWidth();
		io.DisplaySize.y = GetScreenHeight();
	}

	m_bRunning = true;
	while (!glfwWindowShouldClose(m_pWindow) && m_bRunning)
	{
		m_lastTime = m_currentTime;
		m_currentTime = (float)glfwGetTime();
		m_deltaTime = m_currentTime - m_lastTime;

		glClearColor(m_clearColour.r, m_clearColour.g, m_clearColour.b, 1);
		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
		glEnable(GL_CULL_FACE);
		glCullFace(GL_BACK);
		Gizmos::clear();

		if(m_bDrawGUI) ImGui_ImplGlfwGL3_NewFrame();

		Update(m_deltaTime);
		UpdateFPS(m_deltaTime);

		if (m_pCamera)
		{
			m_pCamera->Update(m_deltaTime);

			Render();

			Gizmos::draw(m_pCamera->GetProjectionView());

			if (m_bDrawGUI) ImGui::Render();

		}

		glfwSwapBuffers(m_pWindow);
		glfwPollEvents();
	}
	
	if (m_bDrawGUI)
	{
		ImGui_ImplGlfwGL3_Shutdown();
	}

	
	Gizmos::destroy();
	glfwDestroyWindow(m_pWindow);
	glfwTerminate();
}
D3DXMATRIX CObjectRotateCamera::GetProjectionMatrix(float sceneSize, float fovy) const
{
    float fAspectRatio = GetScreenWidth() / (float) GetScreenHeight();
    D3DXMATRIX matProj;
    D3DXMatrixPerspectiveFovLH(&matProj, fovy, fAspectRatio, 
        max(m_radius - sceneSize, 20.1f), m_radius + sceneSize);
    return matProj;
}
Beispiel #25
0
void Register::InitTheButton()
{
    //Dimensions
    registerButton.SetHeight(GetScreenHeight() / 12);
    registerButton.SetWidth(GetScreenWidth() / 9);

    //Coordinates
    registerButton.SetX(GetScreenWidth() / 4 - registerButton.GetWidth() / 2);
    registerButton.SetY(GetScreenHeight() / 2.5);

    //Texture
    registerButton.SetTexture(buttonTexture);
    registerButton.SetHoverTexture(buttonHoverTexture);

    //Add the button to the renderer to be ready for presenting to the screen
    registerButton.Render(renderer);
}
void UIHoleTransition::Update(float32 timeElapsed)
{
	UIScreenTransition::Update(timeElapsed);
	normalizedTime = currentTime / duration;
	
	float scaleCoef = 1.0f;
	if (normalizedTime <= 0.5f)scaleCoef = interpolationFunc(1.0f - normalizedTime * 2.0f);
	else scaleCoef = interpolationFunc((normalizedTime - 0.5f) * 2.0f);
		
	for (int k = 0; k < clipPoly.pointCount; ++k)
	{
		realPoly.points[k] = clipPoly.points[k];
		realPoly.points[k] -= Vector2(GetScreenWidth() / 2.0f, GetScreenHeight() / 2.0f);
		realPoly.points[k] *= scaleCoef;
		realPoly.points[k] += Vector2(GetScreenWidth() / 2.0f, GetScreenHeight() / 2.0f);
	}
}
Beispiel #27
0
void Home::InitTheCharacterBar()
{
    characterBarRect.x = GetScreenWidth() / 20;
    characterBarRect.y = GetScreenHeight() / 5;
    characterBarRect.w = GetScreenWidth() / 3.5;
    characterBarRect.h = GetScreenHeight() / 1.5;

    spriteSheetRect.x = GetScreenWidth() / 20;
    spriteSheetRect.y = GetScreenHeight() / 5;
    spriteSheetRect.w = GetScreenWidth() / 3.5;
    spriteSheetRect.h = GetScreenHeight() / 1.5;

    characterRect.w = 640;
    characterRect.h = 580;
    characterRect.x = 0;
    characterRect.y = 0;
}
Beispiel #28
0
XSurface* XGraphicsOpenGL::CreateScreenToSurface( BOOL bHighReso )
{
	XSurface *pSurface = new XSurfaceOpenGL( FALSE );
//	ScreenToSurface( pSurface );
	ScreenToSurface( 0, 0, GetScreenWidth(), GetScreenHeight(), pSurface );
//	ScreenToSurface( bHighReso, 0, 0, GetPhyScreenWidth(), GetPhyScreenHeight(), pSurface );
	return pSurface;
}
Beispiel #29
0
// Logo Screen Draw logic
void DrawLogoScreen(void)
{
    // Draw LOGO screen
    if (logoScreenState == 0)
    {
        if ((framesCounter/15)%2) DrawRectangle(logoPositionX, logoPositionY - 60, 16, 16, BLACK);
    }
    else if (logoScreenState == 1)
    {
        DrawRectangle(logoPositionX, logoPositionY - 60, topSideRecWidth, 16, BLACK);
        DrawRectangle(logoPositionX, logoPositionY - 60, 16, leftSideRecHeight, BLACK);
    }
    else if (logoScreenState == 2)
    {
        DrawRectangle(logoPositionX, logoPositionY - 60, topSideRecWidth, 16, BLACK);
        DrawRectangle(logoPositionX, logoPositionY - 60, 16, leftSideRecHeight, BLACK);

        DrawRectangle(logoPositionX + 240, logoPositionY - 60, 16, rightSideRecHeight, BLACK);
        DrawRectangle(logoPositionX, logoPositionY + 240 - 60, bottomSideRecWidth, 16, BLACK);
    }
    else if (logoScreenState == 3)
    {         
        DrawRectangle(logoPositionX, logoPositionY - 60, topSideRecWidth, 16, BLACK);
        DrawRectangle(logoPositionX, logoPositionY + 16 - 60, 16, leftSideRecHeight - 32, BLACK);

        DrawRectangle(logoPositionX + 240, logoPositionY + 16 - 60, 16, rightSideRecHeight - 32, BLACK);
        DrawRectangle(logoPositionX, logoPositionY + 240 - 60, bottomSideRecWidth, 16, BLACK);

        DrawRectangle(GetScreenWidth()/2 - 112, GetScreenHeight()/2 - 112 - 60, 224, 224, RAYWHITE);

        DrawText(raylib, GetScreenWidth()/2 - 44, GetScreenHeight()/2 + 48 - 60, 50, BLACK);

        if (!msgLogoADone) DrawText(msgBuffer, GetScreenWidth()/2 - MeasureText(msgLogoA, 30)/2, logoPositionY + 230, 30, GRAY);
        else
        {
            DrawText(msgLogoA, GetScreenWidth()/2 - MeasureText(msgLogoA, 30)/2, logoPositionY + 230, 30, GRAY);

            if (!msgLogoBDone) DrawText(msgBuffer, GetScreenWidth()/2 - MeasureText(msgLogoB, 30)/2, logoPositionY + 280, 30, GRAY);
            else
            {
                DrawText(msgLogoB, GetScreenWidth()/2 - MeasureText(msgLogoA, 30)/2, logoPositionY + 280, 30, GRAY);
            }
        }
    }
}
Beispiel #30
0
// Logo Screen Initialization logic
void InitLogoScreen(void)
{
    // Initialize LOGO screen variables here!
    framesCounter = 0;
    finishScreen = 0;
    
    logoPositionX = GetScreenWidth()/2 - 128;
    logoPositionY = GetScreenHeight()/2 - 128;
}