OpenGL UI components#52
Conversation
|
Also I can push this PR all the way replacing the per-component SDL_Surface with OpenGL. It's not hard at all with AI agent. I only left it out of scope for simpler review. Main benefit is already achieved. |
Can you give a bit more background? This code is old with old design decisions etc. which I don't remember especially as it wasn't written by me. IIRC SDL does use OpenGL as the backend/renderer, so the code alread is "using OpenGL" (to some extent) |
|
s25edit doesn't use OpenGL at all. And say I want to use ctrlButton from libsiedler2 instead of s25edit CButton. |
22129c8 to
fbd0a59
Compare
9319866 to
6dd57e4
Compare
Keep small surface per UI component that is drawn with OpenGL Avoids big 4K penalty while keeping change small
|
Hmm this PR is currently really small and nice. But replacing getSurface() with getTexture() is keeping with 2D blitting patterns, s25client uses Draw() which enables components to draw directly. Much bigger PR tho. And hmm maybe #47 gl2-terrain should really be parallel PR and not on top of this one. It doesn't change UI components at all. |
6dd57e4 to
3af4317
Compare
3af4317 to
76531bd
Compare
|
Ok I went ahead and implemented Draw() with removed getSurface() and getTexture() bigger change but removing 280 lines! |
Draw all UI components with OpenGL.
Keeps UI component SDL_Surface for a smaller PR but avoids 4K penalty of uploading a 4K 32bit 33MB surface each frame 2GB per second. Only small component surfaces are uploaded each frame.
Splash, main menu and options screens are entirely OpenGL.
Replacing SDL_Surface in each component with OpenGL to be addressed in future PR.
Terrain editor Surf_Map remains 2D/SDL/SGE in this branch.