SDL2 program only works if Renderer is created with SDL_RENDERER_SOFTWARE

前端 未结 2 1925
别跟我提以往
别跟我提以往 2020-12-07 06:19

I\'ve written a program using C++ and SDL2 which:

  1. creates a window
  2. gets the window\'s surface
  3. creates a renderer for the window
  4. rend
2条回答
  •  抹茶落季
    2020-12-07 06:33

    Try adding SDL_RENDERER_PRESENTVSYNC to your renderer's flag (Proposed by someone here).

    C++ seems to be the programming language you're using but for those looking for a fully working SDL2.0.8-based C program that does not use GetWindowSurface(), please take a look here:

    Mainly,

    • initWindowAndRenderer
    • drawText
    • drawImage
    • drawVideo
    • setBgColor
    • drawVideo
    • ...

提交回复
热议问题