#include <SDL2/SDL.h> /* macOS- and GNU/Linux-specific /
#endif
/ Sets constants */
#define WIDTH 100
#define HEIGHT 100
#define DELAY 3000
int main (int argc, char *argv)
{
/ Initialises data */
SDL_Window window = NULL;
/
- Initialises the SDL video subsystem (as well as the events subsystem).
- Returns 0 on success or a negative error code on failure using SDL_GetError().
/
if (SDL_Init(SDL_INIT_VIDEO) != 0) {
fprintf(stderr, “SDL failed to initialise: %s\n”, SDL_GetError());
return 1;
}
/ Creates a SDL window /
window = SDL_CreateWindow(“SDL Example”, / Title of the SDL window /
SDL_WINDOWPOS_CENTERED, / Position x of the window /
SDL_WINDOWPOS_CENTERED, / Position y of the window /
WIDTH, / Width of the window in pixels /
HEIGHT, / Height of the window in pixels /
0); / Additional flag(s) /
/ Checks if window has been created; if not, exits program /
if (window == NULL) {
fprintf(stderr, “SDL window failed to initialise: %s\n”, SDL_GetError());
return 1;
}
/ Pauses all SDL subsystems for a variable amount of milliseconds /
SDL_Delay(DELAY);
/ Frees memory /
SDL_DestroyWindow(window);
/ Shuts down all SDL subsystems */
SDL_Quit();
return 0;
}
This simple program runs fine on PC and it opens a window.
When I cross compile it for BeagleBoard-X15 I do not get a window instead I get two prints as shown below:-
root@am57xx-evm:/mnt# ./a.out
wlpvr: PVR Services Initialised
wlpvr: PVR Services DeInitialised
Please help me if anyone knows about it! Thanks!