Skip to content

s25edit OpenGL#47

Draft
morganchristiansson wants to merge 1 commit into
Return-To-The-Roots:masterfrom
morganchristiansson:opengl-small
Draft

s25edit OpenGL#47
morganchristiansson wants to merge 1 commit into
Return-To-The-Roots:masterfrom
morganchristiansson:opengl-small

Conversation

@morganchristiansson

@morganchristiansson morganchristiansson commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Branch rebased to master and not include window resizing or features from other PRs. This branch is now without window resizing - so no 4K sized windows, and broken mouse panning on linux!

With maximized window in 4K monitor i got 1fps. With OpenGL I get 60fps and 40% idle CPU usage and can do even better.

  • Deletes SGE/ (bundled SDL Graphics Extension library for drawing triangles, replaced remaining usage with vanilla SDL).
  • Adds TerrainRenderer.cpp to align with s25client codebase.
  • Adds OpenGL surface used for terrain editor only. UI remains SDL 2D.
  • Dirty tracking (uiDirty_) on 2x SDL surfaces CMap.cpp Surf_UI and CGame.cpp Surf_Display
    • Not strictly needed in this PR but calmed down the CPU a lot. Avoids CPU usage of uploading 2x large surfaces to GPU every frame. 33.18MB per surface if 4K 32bit.
    • s2client draws all UI with GPU - these surfaces will disappear in future PR.
      This large PR needs narrower scope and updating UI is much bigger change with less benefit.
  • Load sprites with alpha so black is not always transparent.

Admittedly this branch is sloppy Ai code and it's quite easy to find issue.
So mainly looking for general direction comments.
That said, all review comments are welcome and I will address them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant