Skip to content

cf_app_draw_onto_screen

Category: app
GitHub: cute_app.h


Draws the app onto the screen.

int cf_app_draw_onto_screen(bool clear);

Return Value

Returns the number of draw calls for this frame.

Code Example

Creating a basic 640x480 window for your game.

#include <cute.h>
using namespace cute;

int main(int argc, const char argv)
{
    // Create a window with a resolution of 640 x 480, along with a DirectX 11 context.
    app_make("Fancy Window Title", 0, 50, 50, 640, 480, CF_APP_OPTIONS_D3D11_CONTEXT, argv[0]);

    while (app_is_running())
    {
        app_update();
        // All your game logic and updates go here...
        app_draw_onto_screen();
    }

    app_destroy();

    return 0;
}

Remarks

Call this at the end of your main loop. You may only call this function once per game tick.

cf_make_app
cf_app_is_running
cf_app_signal_shutdown
cf_destroy_app