UnknownException / SubTitans

Unofficial Submarine Titans patch
MIT License
48 stars 1 forks source link

OpenGL Black Screen #16

Open Rinelw opened 2 years ago

Rinelw commented 2 years ago

When I use OpenGL renderer, image freezes after intro videos and when I alt+tab it will turn black. The game is still working since I can hear menu, but nothing is showing on the screen.

UnknownException commented 2 years ago

Could you upload subtitans.log? The logfile is located in the submarine titans directory. I'd also like to know what graphics card you're using. For now I'll advise you to use the software renderer instead (see subtitans.ini).

Rinelw commented 2 years ago

subtitans.log

Radeon RX560, but I was using a laptop.

BloodRaven0 commented 1 year ago

Same, using GoG version, I'm on RX470, Windows 10 21H2, build 19044.1466 When I start in OpenGL mode, I can actually see the videos (I couldn't in DirectDraw, only hear them). However, the game is completely black, even though I can interact and hear the menus, I can't see anything.

Here is my log as well: subtitans.log

OLDodin commented 1 year ago

Could you upload subtitans.log? The logfile is located in the submarine titans directory. I'd also like to know what graphics card you're using. For now I'll advise you to use the software renderer instead (see subtitans.ini).

The solution to this problem is to use glReadPixels (after SwapBuffers) and then SetDIBitsToDevice the data received in glReadPixels.

For some systems, correct working of OpenGL is possible only when displaying an image (SwapBuffers) in the window HDC For example HDC deviceContext = GetDC(Global::GameWindow);

The problem is GetDC(nullptr) in OpenGLRenderer. If this value is NULL, GetDC retrieves the DC for the entire screen.

But if you use window HDC, then SetPixelFormat for it will lead to a game crash (I suspect because of working with PixelFormat not what DDraw was expected)