Problem Using PySDL2 on Gentoo Linux |
Problem Using PySDL2 on Gentoo Linux |
Jonas Kulla
Guest
|
2014-10-02 11:03 GMT+02:00 Andreas Grapentin:
Instead of drawing everything once and quitting, have your script render the same frame in a loop over and over again until the user closes it (SDL_QUIT event). It's very likely that your single frame gets stuck inside some double buffering scheme. |
|||||||||||||
|
Problem Using PySDL2 on Gentoo Linux |
Andreas Grapentin
Guest
|
On 10/02/2014 12:51 PM, Jonas Kulla wrote:
Thanks for your reply! I changed my code as you suggested to include an sdl2 event loop: from sdl2w import * SDLW_Init(SDL_INIT_VIDEO) win = SDLW_CreateWindow("Hello World", 100, 100, 640, 480, SDL_WINDOW_SHOWN) ren = SDLW_CreateRenderer(win, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC) bmp = SDLW_LoadBMP('startup.bmp') tex = SDLW_CreateTextureFromSurface(ren, bmp) SDL_FreeSurface(bmp) running = True while running: SDL_RenderClear(ren) SDL_RenderCopy(ren, tex, None, None) SDL_RenderPresent(ren) event = SDL_Event() while SDL_PollEvent(ctypes.byref(event)) != 0: print "." if event.type == SDL_QUIT: running = False break SDL_DestroyTexture(tex); SDL_DestroyRenderer(ren); SDL_DestroyWindow(win); SDL_Quit(); but the observed behaviour does not change. |
|||||||||||||||||
|
Problem Using PySDL2 on Gentoo Linux |
Andreas Grapentin
Guest
|
On 10/02/2014 01:58 PM, Andreas Grapentin wrote:
I found my problem - my checks of the return values of the SDL_* functions were faulty, and I was missing an error of the type "Couldn't find matching render driver" That is something I can work with. Thanks for the help! |
|||||||||||||||||||||
|