~kameliya/kyuubey

6aa06247d14b12e803dbf4dedc921ede1974ef0f — Asherah Connor 3 months ago e777e02
add some window/renderer diagnostics
1 files changed, 16 insertions(+), 0 deletions(-)

M renderer.c
M renderer.c => renderer.c +16 -0
@@ 25,6 25,8 @@ int renderer_init(void) {
        return 1;
    }

    fprintf(stderr, "window format: %s\n", SDL_GetPixelFormatName(SDL_GetWindowPixelFormat(window)));

    renderer = SDL_CreateRenderer(
        window,
        -1,


@@ 36,6 38,20 @@ int renderer_init(void) {
        return 1;
    }

    SDL_RendererInfo info;
    if (SDL_GetRendererInfo(renderer, &info)) {
        fprintf(stderr, "SDL_GetRendererInfo error: %s\n", SDL_GetError());
        SDL_Quit();
        return 1;
    }

    fprintf(stderr, "Renderer: %s / %d / %d format(s)\n",
        info.name,
        info.flags,
        info.num_texture_formats);
    for (int i = 0; i < info.num_texture_formats; ++i)
        fprintf(stderr, "%d. %s\n", i + 1, SDL_GetPixelFormatName(info.texture_formats[i]));

    sfont = read_raw_sdlfont("cp437.vga");

    SDL_ShowCursor(SDL_DISABLE);