Jump to content

World:Pause time regulation


Go to solution Solved by Josh,

Recommended Posts

  • Solution
Posted

Will be included in next build, example:

	int main(int argc, const char* argv[])
    {
        //Get the displays
        auto displays = GetDisplays();

        //Create a window
        auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR);

        //Create a framebuffer
        auto framebuffer = CreateFramebuffer(window);

        //Create a world
        auto world = CreateWorld();

        //Create a camera
        auto camera = CreateCamera(world);
        camera->Move(0, 0, -2);

        auto box = CreateBox(world);

        //Main loop
        while (window->Closed() == false and window->KeyHit(KEY_ESCAPE) == false)
        {
            box->Turn(0, 0, 1);

            if (window->KeyHit(KEY_SPACE))
            {
                if (world->GetPaused())
                {
                    world->Resume();
                }
                else
                {
                    world->Pause();
                }
            }

            world->Update();
            world->Render(framebuffer);
        }
        return 0;
    }

 

  • Like 1
  • Upvote 1

Let's build cool stuff and have fun. :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...