sdl_runtime_compiler git · main
SDL3 game for running and compiling code at runtime
C++ 72.3% C 26.2%git clone https://git.christianimmanuel.de/sdl-graphics/sdl_runtime_compiler.gitwget https://git.christianimmanuel.de/sdl-graphics/sdl_runtime_compiler/archive/sdl_runtime_compiler.tar.gzbenchmark_example/main.cpp raw
#include <benchmark/benchmark.h>
#include <SDL3/SDL.h>
static void BM_SDL_CreateDestroyWindow(benchmark::State& state)
{
if (!SDL_Init(SDL_INIT_VIDEO))
{
state.SkipWithError(SDL_GetError());
return;
}
for (auto _ : state)
{
SDL_Window* win = SDL_CreateWindow(
"bench",
640, 480,
SDL_WINDOW_RESIZABLE
);
if (!win)
{
state.SkipWithError(SDL_GetError());
break;
}
SDL_DestroyWindow(win);
}
SDL_Quit();
}
BENCHMARK(BM_SDL_CreateDestroyWindow);
BENCHMARK_MAIN();