Setting up SDL_ttf 3.1.0 in Visual Studio 2022 using CMake
        
            - Install SDL 3.1.10 using this guide: How to install SDL 3.1.10 using CMake and Visual Studio 2022 for Desktop
 
            - Install SDL_ttf 3.1.0 using this guide: How to install SDL_ttf 3.1.0 using CMake and Visual Studio 2022 for Desktop
 
            - Run Visual Studio
 
            - Click on the "Create a new project" button:
 
            
            - Click on the "CMake Project" and click on the "Next" button:
 
            
            - Type a project name, set a project location, check the "Place solution and project in the same directory" checkbox, and click on the "Create" button:
 
            
            - Wait a few seconds for configuration
 
            - Run the project on the empty green triangle (or Ctrl+F5):
 
            
            - The program prints "Hello CMake" to the console:
 
            
            - Click on the "Project" and click on the "Edit CMake Presents for hello-sdl3-cpp":
 
            
            - Add the "SDL3_DIR" and "SDL3_ttf_DIR" variables with the following "value" and "type" for "Debug":
 
        {
            "name": "x64-debug",
            "displayName": "x64 Debug",
            "inherits": "windows-base",
            "architecture": {
                "value": "x64",
                "strategy": "external"
            },
            "cacheVariables": {
                "CMAKE_BUILD_TYPE": "Debug",
                "SDL3_DIR": {
                    "value": "E:/libs/sdl-3.1.10-msvc/win/debug/cmake",
                    "type": "PATH"
                },
                "SDL3_ttf_DIR": {
                    "value": "E:/libs/sdl3_ttf-3.1.0-msvc/win/debug/cmake",
                    "type": "PATH"
                }
            }
        },
            Make the same for "Release":
        {
            "name": "x64-release",
            "displayName": "x64 Release",
            "inherits": "x64-debug",
            "cacheVariables": {
                "CMAKE_BUILD_TYPE": "Release",
                "SDL3_DIR": {
                    "value": "E:/libs/sdl-3.1.10-msvc/win/release/cmake",
                    "type": "PATH"
                },
                "SDL3_ttf_DIR": {
                    "value": "E:/libs/sdl3_ttf-3.1.0-msvc/win/release/cmake",
                    "type": "PATH"
                }
            }
        },
            Open a root folder of the project
            Create the "assets/fonts" folder here and place some TTF file in the "assets/fonts" folder. For example, you can copy "arial.ttf" from the "C:/Windows/Fonts" folder:
            
            Return to VS and double click on the "CMakeLists.txt" file and copy and paste the following code there:
# Copy the assets folder to the dist folder
add_custom_command(TARGET hello-sdl3-cpp POST_BUILD
    COMMAND ${CMAKE_COMMAND} -E copy_directory
    ${CMAKE_SOURCE_DIR}/assets $<TARGET_FILE_DIR:hello-sdl3-cpp>/assets)
find_package(SDL3)
find_package(SDL3_ttf)
target_link_libraries(hello-sdl3-cpp PRIVATE SDL3_ttf::SDL3_ttf SDL3::SDL3)
            Replace the "hello-sdl3-cpp.cpp" file content with the following content:
#define SDL_MAIN_USE_CALLBACKS 1 // Use the callbacks instead of main()
#include <SDL3/SDL.h>
#include <SDL3/SDL_main.h>
#include <SDL3_ttf/SDL_ttf.h>
// We will use this renderer to draw into this window every frame
static SDL_Window* window = NULL;
static SDL_Renderer* renderer = NULL;
static SDL_Texture* texture = NULL;
// This function runs once at startup
SDL_AppResult SDL_AppInit(void** appstate, int argc, char* argv[])
{
    if (!SDL_Init(SDL_INIT_VIDEO)) {
        SDL_Log("Couldn't initialize SDL: %s", SDL_GetError());
        return SDL_APP_FAILURE;
    }
    // Initialize the TTF library
    if (!TTF_Init()) {
        SDL_Log("Couldn't initialize TTF: %s", SDL_GetError());
        return SDL_APP_FAILURE;
    }
    if (!SDL_CreateWindowAndRenderer("English text using SDL3 and C",
        500, 500, 0, &window, &renderer)) //
    {
        SDL_Log("Couldn't create window/renderer: %s", SDL_GetError());
        return SDL_APP_FAILURE;
    }
    TTF_Font* font = TTF_OpenFont("assets/fonts/arial.ttf", 48);
    SDL_Color textColor(255, 255, 255);
    SDL_Surface* surface = TTF_RenderText_Blended(font, "Hello, World!", 13, textColor);
    texture = SDL_CreateTextureFromSurface(renderer, surface);
    SDL_DestroySurface(surface);
    return SDL_APP_CONTINUE; // Carry on with the program
}
// This function runs when a new event (mouse input, keypresses, etc) occurs
SDL_AppResult SDL_AppEvent(void* appstate, SDL_Event* event)
{
    if (event->type == SDL_EVENT_QUIT) {
        return SDL_APP_SUCCESS; // End the program, reporting success to the OS
    }
    return SDL_APP_CONTINUE; // Carry on with the program
}
// This function runs once per frame, and is the heart of the program
SDL_AppResult SDL_AppIterate(void* appstate)
{
    // Set the position where you want to draw the text
    float x = 10.f;
    float y = 10.f;
    // Create a rectangle to hold the texture dimensions
    SDL_FRect rect;
    SDL_GetTextureSize(texture, &rect.w, &rect.h);
    rect.x = x;
    rect.y = y;
    // SDL_RenderTexture(renderer, texture, NULL, NULL);
    // Clear the screen
    SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
    SDL_RenderClear(renderer);
    // Draw the text
    SDL_RenderTexture(renderer, texture, NULL, &rect);
    // Update the screen
    SDL_RenderPresent(renderer);
    return SDL_APP_CONTINUE;  /* carry on with the program! */
}
// This function runs once at shutdown
void SDL_AppQuit(void* appstate, SDL_AppResult result)
{
    // SDL will clean up the window/renderer for us
    TTF_Quit();
    SDL_Quit();
}
            
            Press Ctrl+F5 to run the application