void Level::Draw(Application &App) {

    if(m_exit) {
        return;
    }

    // Clear screen
    App.Clear();

    // Draw the panels into the buffer
    m_gui.Draw(App);

    App.Draw(sf::Shape::Rectangle(0, 50.0f, 860.0f, 580.0f, sf::Color(0, 0, 0, 130)));

    // If we have a menu pop up, draw it
    if(m_active_menu) {

        // Tints the background panels using a black transparent rectangle that covers the whole screen
        App.Draw(sf::Shape::Rectangle(0, 0, App.GetWidth(), App.GetHeight(), sf::Color(0, 0, 0, 230)));

        // draw active menu on top of the tinted panels
        m_active_menu->Draw(App);
    }

    // Finally, display the buffered frame on screen
    App.Display();
}
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow)
{
    UNREFERENCED_PARAMETER(hPrevInstance);
    UNREFERENCED_PARAMETER(lpCmdLine);

	Application * theApp = new Application();

	if (FAILED(theApp->Initialise(hInstance, nCmdShow)))
	{
		return -1;
	}

    // Main message loop
    MSG msg = {0};

    while (WM_QUIT != msg.message)
    {
        if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
        {
            TranslateMessage(&msg);
            DispatchMessage(&msg);
        }
        else
        {
			theApp->Update();
            theApp->Draw();
        }
    }

	delete theApp;
	theApp = nullptr;

    return (int) msg.wParam;
}
void MultiBullet::Draw(Application &App){

    if(m_last_pulse + CLOCKS_PER_SEC < clock())
    {
        App.Draw(m_circ);
    }
    else{
        return;
    }

}
Exemple #4
0
int main()
{
	Application game = Application();
	game.Create( "My Awesome Game", 1270, 720, 32, false );

	while( game.isRunning())
	{
		game.Update();
		game.Draw();
	}
	return 0;
}
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow)
{
    UNREFERENCED_PARAMETER(hPrevInstance);
    UNREFERENCED_PARAMETER(lpCmdLine);

	Application * theApp = new Application();

	if (FAILED(theApp->Initialise(hInstance, nCmdShow)))
	{
		return -1;
	}

    // Main message loop
    MSG msg = {0};

    while (WM_QUIT != msg.message)
    {
        if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
        {
			bool handled = false;

			if (msg.message >= WM_KEYFIRST && msg.message <= WM_KEYLAST)
			{
				handled = theApp->HandleKeyboard(msg);
			}
			else if (WM_QUIT == msg.message)
				break;

			if (!handled)
			{
				TranslateMessage(&msg);
				DispatchMessage(&msg);
			}
        }
		else
		{
			theApp->Update();
			theApp->Draw();
			Sleep(20);
		}
    }

	delete theApp;
	theApp = nullptr;

    return (int) msg.wParam;
}
int main()
{
	Application* app = new Application;
	app->Startup();


	//staff->LoadObject("./data/Models/soulspear/soulspear.obj", "./data/Models/soulspear/soulspear_diffuse.tga");
	//dragon->LoadObject("./data/Models/Dragon/Dragon.obj");




	

	while (glfwWindowShouldClose(app->windowView->m_window) == false &&
		glfwGetKey(app->windowView->m_window, GLFW_KEY_ESCAPE) != GLFW_PRESS) {

		app->Update();
		app->Draw();
	}
	
	app->Shutdown();
	return 0;
}
void QuitGame::Draw(Application &App) {
    App.Draw(*this);
    m_banner.Draw(App);
}
void TowerButton::Draw(Application &App) {
    App.Draw(*this);

	subDraw(App);
}
void HomeBase::Draw(Application &App) {
     App.Draw(*this);

     m_health.Draw(App);
}
void Banner::Draw(Application &App) {

	App.Draw(*this);

	SpriteObj::subDraw(App);
}