I have a small SDL 2.0 program (detailed below) that refuses to give me a window, complaining about not being able to initialize its OpenGL ES library.
Program:
#include "bcm_host.h"
#include <SDL.h>
#include <GLES2/gl2.h>
#include <stdlib.h>
int main() {
bcm_host_init();
SDL_Init(SDL_INIT_VIDEO);
SDL_Window *window = SDL_CreateWindow("Test", 0, 0, 400, 300, 0);
if (window == NULL) {
fprintf(stderr, "%s\n", SDL_GetError());
return 1;
}
return 0;
}
Output:
Could not initialize OpenGL / GLES library
What's going on? Shouldn't bcm_host_init()
be all that I need to get a normal SDL 2.0 program to run on the Pi? What else do I need to do?
gpu_mem=128
in/boot/config.txt
to allow for 3D acceleration?