Re: Failed to open vchiq device on RPi
Andreas Falkenhahn <[email protected]>
| Newsgroups | gmane.comp.lib.sdl |
|---|---|
| Message-ID | <[email protected]> |
Hi Alex, On 12.09.2016 at 19:54 Alex Barry wrote: > Out of curiosity, why SDL_PumpEvents if you are calling SDL_PollEvent? > On Mon, Sep 12, 2016 at 1:46 PM, Andreas Falkenhahn <[email protected]> wrote: > On 12.09.2016 at 18:08 Alex Barry wrote: > >> I'm going to get by Pi2 back up and running this weekend, so I >> don't mind taking a peek at what's going on. Do you have your >> project online anywhere or are you just using a bare-bones sort of >> project (ie single fullscreen window taking input.)? > > To make this easier I've now written a minimal sample program which > shows the issue. Here it is: > > #include <SDL.h> > > int main(int argc, char *argv[]) > { > SDL_Window *window; > SDL_Renderer *renderer; > SDL_Texture *texture; > SDL_Event se; > int quit = 0; > int bufferwidth = 1920, bufferheight = 1080; > char *pixbuf = malloc(bufferwidth * bufferheight * 4); > > SDL_Init(SDL_INIT_VIDEO); > SDL_VideoInit("RPI"); > > window = SDL_CreateWindow("Foo", 0, 0, bufferwidth, > bufferheight, SDL_WINDOW_FULLSCREEN); > renderer = SDL_CreateRenderer(window, -1, 0); > texture = SDL_CreateTexture(renderer, > SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, bufferwidth, bufferheight); > > memset(pixbuf, 0, bufferwidth * bufferheight * 4); > SDL_UpdateTexture(texture, NULL, pixbuf, bufferwidth * 4); > SDL_RenderCopy(renderer, texture, NULL, NULL); > SDL_RenderPresent(renderer); > > SDL_ShowWindow(window); > SDL_RaiseWindow(window); > > while(!quit) { > > SDL_PumpEvents(); > > while(SDL_PollEvent(&se)) { > if(se.type == SDL_MOUSEBUTTONDOWN) quit = 1; > } > } > > SDL_DestroyTexture(texture); > SDL_DestroyRenderer(renderer); > SDL_DestroyWindow(window); > > SDL_Quit(); > > free(pixbuf); > > return 0; > } > > I've also prepared a package containing a ready-to-run binary as well as my > build of SDL 2.0.4 for the Pi. This can be downloaded from here: > http://www.softwarefailure.de/tmp/sdltest.tar.gz > > The archive also contains a build script. > > Any help appreciated. > > -- > Best regards, > Andreas Falkenhahn mailto:[email protected] > > -- Best regards, Andreas Falkenhahn mailto:[email protected]