UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Hello World, Hello SDL

    Scheduled Pinned Locked Moved App Development
    sdlclickablec++video games
    3 Posts 3 Posters 1.1k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
      Reply
      • Reply as topic
      Log in to reply
      This topic has been deleted. Only users with topic management privileges can see it.
      • CraigC Offline
        Craig
        last edited by

        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

        1 Reply Last reply Reply Quote 0
        • ? Offline
          A Former User
          last edited by

          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.

          1 Reply Last reply Reply Quote 0
          • lduboeufL Offline
            lduboeuf
            last edited by

            for reference : https://forums.ubports.com/topic/2178/c-and-sdl-with-clickable-a-little-help-please/19

            1 Reply Last reply Reply Quote 0
            • First post
              Last post