How nitload-nsi/stgsharp works
Project type and purpose
• Stg# is a multi‐module, C#-based 2D/3D STG (shoot ’em up) game engine built on top of OpenGL/GLFW.
• It provides:
• A high-efficiency math library
• An MVVM windowing framework (C# GUI)
• An EXPRESS-language script compiler/interpreter
• Native C helpers (vector math acceleration)
• A resource manager and model loader (STEP files)
File structure
Top-level solution: StgSharp.sln
Key projects / directories:
• StgSharp.Common – core data structures, math, geometry, graphics abstractions (OpenGL + Vulkan stubs), threading, timing, MVVM, pipeline nodes, STG gameplay entities.
• StgSharp – the main engine project that brings together Common modules, resource management, initialization, application bootstrap.
• StgSharpGraphic – high-level OpenGL wrappers, shaders, textures, framebuffers.
• StgSharp.C – native C code for high-performance vector/matrix operations, image loading (stb_image), OpenGL extension loading, GLFW bindings.
• StgSharp.Script – EXPRESS language lexer, parser, AST, semantic analyzer, code generator and runtime integration.
• StgSharp.Model – STEP file parser, syntax/analyzer, data model for CAD-style geometry definitions.
• StgSharp.Generator (and StgSgharp.Generator) – source-generation utilities for EXP schema or blueprint nodes.
• StgSharp.TerminalDialogue – a sample/CLI program demonstrating the terminal-based UI.
• .vs folders & configuration – IDE build/cache.
README for additional insights
• StgSharp is layered:
1. Core common libraries (math, geometry, threading).
2. Graphics abstractions (OpenGL/Vulkan pipelines via StgSharpGraphic).
3. Native performance helpers (StgSharp.C).
4. High-level engine & resource manager (StgSharp).
5. Script support (StgSharp.Script + Generator).
6. Model parsing (StgSharp.Model).
• Uses GLFW for cross-platform viewport & input.
Essential architectural elements to capture
– Separation of Common lib vs. Engine vs. Graphics vs. Native C vs. Scripting vs. Model
– MVVM → Engine integration
– Engine → OpenGL/GLFW call path
– Runtime SCRIPT compile & execution path
– Source generation path (Generator → Script → Engine)
– External dependencies