I recently bought a R36S retro handheld linux based game console. The system runs ArkOS which is a Ubuntu based OS. On boot, the system launches the program EmulatorStation, but it is possible to exit this program, and then connect to the system through ssh and get a command prompt. Through apt, it is then possible to install a complete development environment running on the system.
I did so and compiled a simple hello-world SDL2 program, which should show a window with graphical output for five seconds and exit.
The problem is that nothing is displayed on the system, and there is no error.
I also double checked myself with the program 351Files which is provided in binary form on ArkOS. I verified that when I execute the system provided version from the command line, it displays its graphical interface. However, I also pulled the latest version by git, and compiled it myself on the system. And when running the version that I compiled, there is no graphical output, and no error.
Below is the hello-world program which I compiled:
#include <SDL2/SDL.h>
#include <stdio.h>
int main(int argc, char* argv[]) {
// Initialize SDL
if (SDL_Init(SDL_INIT_VIDEO) != 0) {
printf("SDL_Init Error: %s\n", SDL_GetError());
return 1;
}
// Create a window
SDL_Window *win = SDL_CreateWindow("Hello, SDL2!", 100, 100, 640, 480, SDL_WINDOW_SHOWN);
if (win == NULL) {
printf("SDL_CreateWindow Error: %s\n", SDL_GetError());
SDL_Quit();
return 1;
}
// Create a renderer
SDL_Renderer *ren = SDL_CreateRenderer(win, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
if (ren == NULL) {
SDL_DestroyWindow(win);
printf("SDL_CreateRenderer Error: %s\n", SDL_GetError());
SDL_Quit();
return 1;
}
// Set the draw color to blue
SDL_SetRenderDrawColor(ren, 0, 0, 255, 255);
// Clear the window
SDL_RenderClear(ren);
// Present the window
SDL_RenderPresent(ren);
// Wait for 5 seconds
SDL_Delay(5000);
// Clean up
SDL_DestroyRenderer(ren);
SDL_DestroyWindow(win);
SDL_Quit();
return 0;
}
So my question is what am I missing to make the graphical output show up?