strikekat/m7engine

Changing video mode causing multiple issues

Opened this issue · 5 comments

After changing video modes (mostly changing d3d<->opengl), the program will consume excessive memory and slow down.
Also, moving the mouse around in the window can cause severe lag.
Cause is currently unknown, as sprites should be regenerating properly.

Also, really doesn't work under Linux, see #13

Mouse movement issue fixed with c8b63d9.
Currently, changing the video mode will jump the CPU usage to 15-30%, and RAM usage to 30-40mb.
It will not go above or below this amount with further video mode changes.

Removing any use of fonts will eliminate the CPU usage issue. However, memory usage still triples.
At the very least, it seems fonts will need to be reloaded along with bitmaps.

With the rewrite to SDL, API changing is inapplicable because all platforms use OpenGL now. Window mode changing is glitchy under Linux (Nothing permanent or show-stopping), but works fine under Windows. Will need further investigation.

On Linux (Which is more-or-less the main platform), window mode changing is somewhat useless, with no visual differences between fullscreen and fullscreen-windowed. If starting in fullscreen mode, the window is the size of the of the whole screen and is unresizable. Changing the window mode has been reported to lock up a computer under Windows, as well. The system needs to be thoroughly examined.

I've been unable to reproduce lock-up under Windows, although a minuscule amount of memory leakage appears to happen with each video mode change (~ 0.1 MB). Need to do some more analysis.