You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SGE (SDL Graphics Extension), a abandoned 3rd party vendored library is used in s25edit to draw all triangles in 2D software.
Outside of drawing the triangles & terrain it's used for:
drawing background images for splash and main menu screens.
drawing right menubar with 270deg rotation.
This PR converts those to vanilla SDL.
Later when we replace SGE with OpenGL for drawing triangles&terrain, we can delete SGE and use this method to keep drawing it as 2D using SDL.
Much later the UI should probably be drawn as OpenGL entirely.
Not a lot.
A simple OpenGL replacement is not too hard.
But maybe best implementation is not just replacing sge calls with OpenGL but to add TerrainRender.cpp and align with s25client. Maybe one day they can use shared classes.
morganchristiansson
changed the title
Replace sge for backgrounds and right menubar
Replace SGE for backgrounds and right menubar
Jun 23, 2026
Could also go straight to OpenGL without the interim step at vanilla SDL tho.
But drawing backgrounds isn't best use of OpenGL.
A single PR for converting to OpenGL might be most efficient but it can end up a sprawling beast to review, with backgrounds, UI components, terrain rendering. Or can do each of these split as separate PRs.
UI components is quite large by itself.
Terrain rendering can have multiple levels of completion. Like current zoom changes triangle coordinates, but glScale() can do the zoom entirely in GL without recalculating triangle coordinates.
Mouse cursor can be drawn with OpenGL.
Brushes, sprites.
Can use camera viewport for showing only parts of map.
etc
rabbithole goes deep.
s25client is already doing all of these.
Idea here tho is to follow up with terrain rendering as OpenGL which is biggest struggle for vanilla SDL.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SGE (SDL Graphics Extension), a abandoned 3rd party vendored library is used in s25edit to draw all triangles in 2D software.
Outside of drawing the triangles & terrain it's used for:
This PR converts those to vanilla SDL.
Later when we replace SGE with OpenGL for drawing triangles&terrain, we can delete SGE and use this method to keep drawing it as 2D using SDL.
Much later the UI should probably be drawn as OpenGL entirely.