### Instrumenting Main Game Loop with Optick (C++) Source: https://github.com/bombomby/optick/blob/master/README.md This snippet demonstrates how to instrument the main game loop using the OPTICK_FRAME macro. It marks the beginning and end of a frame, allowing Optick to capture frame-level performance data. It requires including the 'optick.h' header. ```C++ #include "optick.h" ... while( true ) { OPTICK_FRAME("MainThread"); engine.Update(); } ``` -------------------------------- ### Migrating BROFILER_CATEGORY to OPTICK_CATEGORY in C++ Source: https://github.com/bombomby/optick/blob/master/README.md This snippet illustrates the migration of the `BROFILER_CATEGORY` macro to `OPTICK_CATEGORY`. It highlights the change in namespace for color/category definitions from `Brofiler::Color` to `Optick::Category` when defining custom profiling categories. ```C++ BROFILER_CATEGORY("Physics", Brofiler::Color::Green); ``` ```C++ OPTICK_CATEGORY("Physics", Optick::Category::Physics); ``` -------------------------------- ### Migrating BROFILER_FRAME to OPTICK_FRAME in C++ Source: https://github.com/bombomby/optick/blob/master/README.md This snippet demonstrates how to migrate the `BROFILER_FRAME` macro used for marking frames in Brofiler to its equivalent `OPTICK_FRAME` in Optick. This is essential for updating profiling instrumentation when upgrading from Brofiler to Optick. ```C++ BROFILER_FRAME("MainThread"); ``` ```C++ OPTICK_FRAME("MainThread"); ``` -------------------------------- ### Instrumenting a Function with Optick (C++) Source: https://github.com/bombomby/optick/blob/master/README.md This snippet shows how to instrument a specific function using the OPTICK_EVENT macro. Placing this macro at the beginning of a function automatically profiles its execution time, providing detailed performance insights for that function. ```C++ void SlowFunction() { OPTICK_EVENT(); ... } ``` -------------------------------- ### Migrating BROFILER_THREAD to OPTICK_THREAD in C++ Source: https://github.com/bombomby/optick/blob/master/README.md This snippet shows the migration of the `BROFILER_THREAD` macro, used for naming threads in Brofiler, to the `OPTICK_THREAD` macro in Optick. This ensures proper thread identification in the Optick profiler. ```C++ BROFILER_THREAD("WorkerThread"); ``` ```C++ OPTICK_THREAD("WorkerThread"); ``` -------------------------------- ### Migrating BROFILER_EVENT to OPTICK_EVENT (Named) in C++ Source: https://github.com/bombomby/optick/blob/master/README.md This snippet demonstrates the migration of a named `BROFILER_EVENT` to `OPTICK_EVENT`. It shows how to update specific event markers in the code when transitioning from Brofiler to Optick. ```C++ BROFILER_EVENT(NAME); ``` ```C++ OPTICK_EVENT(NAME); ``` -------------------------------- ### Migrating PROFILE to OPTICK_EVENT (Unnamed) in C++ Source: https://github.com/bombomby/optick/blob/master/README.md This snippet illustrates the migration of the generic `PROFILE` macro to an unnamed `OPTICK_EVENT()`. This is used for simple, unnamed scope profiling events when upgrading from Brofiler to Optick. ```C++ PROFILE; ``` ```C++ OPTICK_EVENT(); ``` -------------------------------- ### Declaring a New Thread with Optick (C++) Source: https://github.com/bombomby/optick/blob/master/README.md This snippet illustrates how to declare a new thread to Optick using the OPTICK_THREAD macro. This allows Optick to track and profile the execution of code within that specific thread, providing multi-threaded performance analysis. ```C++ void WorkerThread(...) { OPTICK_THREAD("Worker"); while (isRunning) { ... } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.