Wyrmsun icon indicating copy to clipboard operation
Wyrmsun copied to clipboard

OpenGL in Wyrmsun

Open DinkyDyeAussie opened this issue 8 years ago • 7 comments

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

DinkyDyeAussie avatar Sep 26 '16 08:09 DinkyDyeAussie

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?

Andrettin avatar Sep 26 '16 08:09 Andrettin

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.

DinkyDyeAussie avatar Sep 26 '16 08:09 DinkyDyeAussie

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.

Andrettin avatar Sep 26 '16 08:09 Andrettin

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

KroArtem avatar Sep 26 '16 09:09 KroArtem

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

akien-mga avatar Sep 26 '16 09:09 akien-mga

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

Andrettin avatar Sep 26 '16 09:09 Andrettin

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.

DinkyDyeAussie avatar Sep 26 '16 09:09 DinkyDyeAussie