Andrettin / Wyrmsun

Strategy game based on history, mythology and fiction
http://andrettin.github.io/
GNU General Public License v2.0
301 stars 47 forks source link

OpenGL in Wyrmsun #130

Open DinkyDyeAussie opened 7 years ago

DinkyDyeAussie commented 7 years ago

I noticed that everything is faster, including loading, when using OpenGL instead of SDL. How did you get OpenGL to work so smoothly?

Andrettin commented 7 years ago

OpenGL is itself faster than SDL1 rendering, I don't recall doing any performance improvements regarding to it compared to Stratagus. Maybe OpenGL is slower in Stratagus because of the calculations for the OpenGL color-cycling, which were implemented there but I didn't port to Wyrmgus?

DinkyDyeAussie commented 7 years ago

Not sure. But loading in wargus with opengl is slower, whereas in wyrmsun its faster. I'm gonna check out your code and see if I can't make changes to stratagus.

Andrettin commented 7 years ago

Hmm, that's strange, Wyrmsun has more units, more player colors, and it also does skin color and hair color conversions for some units, so if anything it should be slower.

Maybe it's the color-cycling, Stratagus might be caching a version of every unit's sprite for each color-cycling state.

KroArtem commented 7 years ago

That' strange to hear as per this ticket loading with OpenGL is longer. Haven't checked it by myself, though.

akien-mga commented 7 years ago

I'll check again, but indeed last I tried loading with OpenGL was very slow.

Andrettin commented 7 years ago

@KroArtem I think DinkyDyeAussie is using Windows, that issue seems to be limited to Linux.

DinkyDyeAussie commented 7 years ago

OpenGL load time on my saved game was 29.04 seconds. SDL load time on the same save was 40.39 seconds. Plus using SDL things started choking up a bit and the mouse and animations weren't smooth at all.