Hello World, Hello SDL



  • I've written some programs in C++ and SDL and would like to publish them to the UT app store. UT seems to lack documentation for how to do this with C++ and SDL. Clickable seems to work great with qml but I don't see any support or documentation for C++/SDL.

    Below is a basic "Hello World" C++ program that compiles and works great on Ubuntu Desktop. It just displays a red screen and quits after 5 seconds. Can someone please provide step-by-step documentation on how to make this test program run on Ubuntu Touch? Either by using clickable or Cmake? If someone can be so kind as to document how, it will make it easy for other developers to contribute SDL apps to the UT store.

    Thank you!!!

    ---------------- Contents of main.cpp:

    #include <SDL2/SDL.h>

    int main(int argc, char *argv[])
    {
    SDL_Init(SDL_INIT_VIDEO);
    SDL_Window *window = SDL_CreateWindow( "SDL2Test", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 1280, 720, 0 );
    SDL_SetWindowFullscreen( window, SDL_TRUE );
    SDL_Renderer *renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_SOFTWARE);
    SDL_SetRenderDrawColor(renderer, 255, 0, 0, SDL_ALPHA_OPAQUE);
    SDL_RenderClear(renderer);
    SDL_RenderPresent(renderer);
    SDL_Delay(5000);
    SDL_DestroyWindow(window);
    SDL_Quit();

    return 0;
    }

    ---------------- From the terminal:

    g++ -o test main.cpp -lSDL2
    ./test



  • Hi Craig, I can't answer your question specifically but feel free to join the app development telegram group:

    @UbuntuAppDevEN

    They will gladly assist you.