MarkelZ / pygame-render

Python package for rendering textures with shaders using pygame.
MIT License
11 stars 0 forks source link

Can't record my pygame opengl window #10

Closed Lukabartovich closed 2 months ago

Lukabartovich commented 2 months ago

Hi, it's me again :D. I was trying to record my game to show to a friend of mine, but i can't record it. The recodings show only the first frame of the game they capture. I tried recording normal windows and everything works just fine. Do you have an idea how to fix it? maybe a special flag when making a window or something?

MarkelZ commented 2 months ago

Hi! I used OBS on Linux to record the tutorial and it worked fine. Which software are you trying to record your game with?

Lukabartovich commented 2 months ago

OBS... Maybe that's because i am using the FULLSCREEN flag..

Lukabartovich commented 2 months ago

Ah, case fixed, i just removed the fullscreen flag lol

MarkelZ commented 2 months ago

I just read a bit more about this. When you enable the fullscreen flag, your game is run in exclusive fullscreen mode, where your game has exclusive access to the display. This means that if you enable the flag, your system stops allocating resources toward displaying other programs, and your game gets rendered to the screen directly (instead of passing through the window manager). Therefore, if you are recording the entire screen with OBS, it won't record your fullscreen game.

I found two fixes:

  1. Instead of recording the entire screen with OBS, go to Sources > Screen Capture, and choose your game.
  2. Instead of using the fullscreen flag, you can have a borderless windowed screen that covers the whole screen, and it will essentially look the same as a fullscreen game. OBS should be able to record this no problem. Many games actually let you choose between "exclusive fullscreen" and "borderless window" in the options menu.
Lukabartovich commented 2 months ago

Thanks!