Add Sdl2 windowing & OpenGL rendering (basic)#6
Merged
FireController1847 merged 14 commits intobetafrom Nov 12, 2025
Merged
Conversation
* Added an implementation of IDisplay using Sdl2. * Created a new Catalyst.Modules.Crystal.Sdl2 project.
* Added an implementation of IWindow using Sdl2.
…dow/SdlWindow.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: FireController#1847 <usfirepilot123@gmail.com>
* Resolved exceptions from the DelegateQueue causing a recursive loop when attempting to unwind the stack. * Resolved exceptions from the worker thread in CatalystApp from being consumed.
* Created a new Catalyst.Modules.Crystal.OpenGL project. * Resolved naming inconsistencies in the builder extensions for Glfw3. * Added an implementation of OpenGLMacNativeConnector. * Added an implementation of the OpenGL INativeApi wrapper.
* Added a basic impl for IRenderer for OpenGLRenderer * Minor changes to IRenderer (adding the dispatcher, depth clarification for Clear, and nullability on SetTarget) * Added RendererOptions * Added RenderLayerException * Added CreateRenderer to IRendererLayer * Fixed naming in the native connector
d76dab6 to
9bcfe33
Compare
In theory, the basics for a renderer should now be complete.
Contributor
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 38 out of 38 changed files in this pull request and generated 63 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CatalystUI/Modules/Crystal/CatalystUI.Modules.Crystal.Sdl2/Window/SdlWindow.cs
Outdated
Show resolved
Hide resolved
CatalystUI/Modules/Crystal/CatalystUI.Modules.Crystal.Sdl2/Window/SdlWindow.cs
Outdated
Show resolved
Hide resolved
CatalystUI/Modules/Crystal/CatalystUI.Modules.Crystal.Sdl2/Window/SdlWindow.cs
Show resolved
Hide resolved
CatalystUI/Modules/Crystal/CatalystUI.Modules.Crystal.Sdl2/Window/SdlWindow.cs
Show resolved
Hide resolved
CatalystUI/Modules/Crystal/CatalystUI.Modules.Crystal.Sdl2/Window/SdlWindow.cs
Outdated
Show resolved
Hide resolved
CatalystUI/Modules/Crystal/CatalystUI.Modules.Crystal.OpenGL/Renderer/OpenGLRenderer.cs
Show resolved
Hide resolved
CatalystUI/Modules/Crystal/CatalystUI.Modules.Crystal.OpenGL/Renderer/OpenGLRenderer.cs
Show resolved
Hide resolved
ThisIsBrady
requested changes
Nov 11, 2025
CatalystUI/Modules/Crystal/CatalystUI.Modules.Crystal.OpenGL/Renderer/OpenGLRenderer.cs
Outdated
Show resolved
Hide resolved
CatalystUI/Modules/Crystal/CatalystUI.Modules.Crystal.OpenGL/Renderer/OpenGLRenderer.cs
Show resolved
Hide resolved
CatalystUI/Modules/Crystal/CatalystUI.Modules.Crystal.OpenGL/Renderer/OpenGLRenderer.cs
Show resolved
Hide resolved
CatalystUI/Modules/Crystal/CatalystUI.Modules.Crystal.Core/Renderer/RendererOptions.cs
Show resolved
Hide resolved
68f4fe4 to
620c0d4
Compare
* Added a "quickstart" BasicWindow example project * Resolved get/init/set issues with WindowOptions & RendererOptions (no need for them to be read-only).
CatalystUI/Modules/Crystal/CatalystUI.Modules.Crystal.Core/Renderer/RenderLayerException.cs
Show resolved
Hide resolved
...Modules/Crystal/CatalystUI.Modules.Crystal.OpenGL/Extensions/CatalystAppBuilderExtensions.cs
Show resolved
Hide resolved
Member
ItzNxthaniel
left a comment
There was a problem hiding this comment.
Overall LGTM, I would like to discuss my two comments before explicit approval.
* Ensured threads properly wait if there's no delegates instead of spin-looping. * Resolved excessive fetching of TargetFramerate in OpenGLRenderer (moved to use underlying value) * Resolved publish profiles not exporting the correct architectures (Arm64 vs x64)
* Resolved changes by Copilot * Resolved chnages by @ThisIsBrady * Resolved changes by @ItzNxthaniel
ThisIsBrady
approved these changes
Nov 12, 2025
* This was put inside the lock causing it to wait forever because delegates could never be enqueued :(
* Was not setting the disposal flag early enough so resources were still being used after they were disposed of. * Removed disposal exception for _queue.Execute() due to the rate at which it is fired.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
📑 Summary
Beginning work on adding the Crystal Sdl2 windowing implementation and a very basic OpenGL renderer implementation.
I am aware of the lack of an Sdl2 to OpenGL connector. This will be a future PR/commit.
⚒️ Changes
Caution
Accurately describing the changes made in this PR will greatly improve the speed at which we can review your PR. Semantic Versioning can be helpful in determining the scope of your change, and will help in determining the appropriate version number, merge location, and timing of the integration of your change.
➕ Additions
Added the following projects to the repository:
Additionally, changes from about four months ago in the original CatalystUI development project have now been migrated into the latest version, including a refactored implementation of SdlDisplay, SdlWindow, and OpenGLRenderer (to merge the previous OpenGLThread and OpenGLRenderer implementations together).
✖️ Modifications
Primary changes from previous commits in this iteration of Catalyst include:
All changes are noted in the individual commits.
➖ Removals
💬 Review
Important
Accurately listing key items for review will help us review your PR more quickly. Please include large changes, breaking changes, and any other changes that may require special attention.
Reviewers will check off items in the list as they are reviewed, in addition to the normal GitHub review process. They may request changes if any items are not adequately addressed or add additional items as necessary.
GlfwWindowwithSdlWindow.SdlWindowcontains implementations MATCHING the available implementations ofGlfwWindow.