How juniojsv/juniojsv-engine works
juniojsv-engine is a Kotlin Multiplatform 3D game and rendering engine for desktop JVM and Android. Its runtime starts in a platform window, initializes shared window contexts, and repeatedly updates and renders a scene; rendering uses multiple passes and platform-specific OpenGL bindings. The graph retains documented physics, instancing, bounds, shader, and resource capabilities. Some subsystem links rely on README documentation because their implementations were not sampled; those links are cited to the README rather than inferred from folder names.
Main entry points: RenderPipeline.kt Render pipeline · WindowContext.kt Window context · PlatformWindow.kt Window lifecycle · Scene.kt Scene and entities
Components 24
Runtime and Contexts
- Window lifecycle
engine/src/commonMain/kotlin/juniojsv/engine/features/window/PlatformWindow.kt - Window context
engine/src/commonMain/kotlin/juniojsv/engine/features/context/WindowContext.kt - Camera context
engine/src/commonMain/kotlin/juniojsv/engine/features/context/CameraContext.kt - GUI context
engine/src/commonMain/kotlin/juniojsv/engine/features/context/GuiContext.kt
World and Physics
- Scene and entities
engine/src/commonMain/kotlin/juniojsv/engine/features/scene/Scene.kt - Player controller
engine/src/commonMain/kotlin/juniojsv/engine/features/entities/Player.kt - Physics simulation
engine/src/commonMain/kotlin/juniojsv/engine/features/context/PhysicsContext.kt - Physics component
engine/src/commonMain/kotlin/juniojsv/engine/features/entities/PhysicsComponent.kt - Bounds and culling
engine/src/commonMain/kotlin/juniojsv/engine/features/utils/IBoundaryShape.kt
Rendering and Assets
- Render pipeline
engine/src/commonMain/kotlin/juniojsv/engine/features/render/RenderPipeline.kt - Instanced rendering
engine/src/commonMain/kotlin/juniojsv/engine/features/render/MultiEntityRender.kt - Mesh handling
engine/src/commonMain/kotlin/juniojsv/engine/features/mesh/Mesh.kt - Resource loading
engine/src/commonMain/kotlin/juniojsv/engine/features/utils/Resources.kt - Shader loading
engine/src/commonMain/kotlin/juniojsv/engine/features/shader/Shader.kt - Shader programs
engine/src/commonMain/kotlin/juniojsv/engine/features/shader/ShadersProgram.kt - Textures
engine/src/commonMain/kotlin/juniojsv/engine/features/textures/Texture.kt - Debug rendering
engine/src/commonMain/kotlin/juniojsv/engine/features/render/DebugShapeRender.kt
Platform Backends
- JVM window
engine/src/jvmMain/kotlin/juniojsv/engine/features/window/JvmWindow.kt - Android window
engine/src/androidMain/kotlin/juniojsv/engine/features/window/AndroidWindow.kt - OpenGL interface
engine/src/commonMain/kotlin/juniojsv/engine/platforms/GL.kt - JVM GL binding
engine/src/jvmMain/kotlin/juniojsv/engine/platforms/GL.jvm.kt - Android GL binding
engine/src/androidMain/kotlin/juniojsv/engine/platforms/GL.android.kt - Android shader conversion
engine/src/androidMain/kotlin/juniojsv/engine/features/utils/ShaderConverter.kt
Other components
- Engine host
Connections 29
- Engine host → Window lifecycle: starts
engine/src/commonMain/kotlin/juniojsv/engine/features/window/PlatformWindow.kt - Window lifecycle → Window context: creates context
engine/src/commonMain/kotlin/juniojsv/engine/features/window/PlatformWindow.kt - Window context → Camera context: owns
engine/src/commonMain/kotlin/juniojsv/engine/features/context/WindowContext.kt - Window lifecycle → JVM window: implemented by
README.md - Window lifecycle → Android window: implemented by
README.md - JVM window → OpenGL interface: uses
engine/src/jvmMain/kotlin/juniojsv/engine/features/window/JvmWindow.kt - Android window → OpenGL interface: uses
engine/src/androidMain/kotlin/juniojsv/engine/features/window/AndroidWindow.kt - OpenGL interface → JVM GL binding: JVM actual
README.md - OpenGL interface → Android GL binding: Android actual
README.md - Window context → Physics simulation: owns
engine/src/commonMain/kotlin/juniojsv/engine/features/context/WindowContext.kt - Window context → GUI context: owns
engine/src/commonMain/kotlin/juniojsv/engine/features/context/WindowContext.kt - Physics simulation → Physics component: updates
engine/src/commonMain/kotlin/juniojsv/engine/features/context/PhysicsContext.kt - Player controller → Physics component: uses
README.md - Scene and entities → Player controller: contains
- Scene and entities → Render pipeline: renders through
README.md - Render pipeline → Scene and entities: invokes render callbacks
engine/src/commonMain/kotlin/juniojsv/engine/features/render/RenderPipeline.kt - Render pipeline → Instanced rendering: supports
README.md - Render pipeline → Debug rendering: runs overlay pass
engine/src/commonMain/kotlin/juniojsv/engine/features/render/RenderPipeline.kt - Window context → Camera context: updates
engine/src/commonMain/kotlin/juniojsv/engine/features/context/WindowContext.kt - Camera context → Bounds and culling: provides frustum
engine/src/commonMain/kotlin/juniojsv/engine/features/context/CameraContext.kt - Bounds and culling → Debug rendering: supplies debug shapes
README.md - Scene and entities → Mesh handling: uses meshes
README.md - Resource loading → Mesh handling: loads mesh assets
README.md - Resource loading → Shader loading: loads shader assets
engine/src/commonMain/kotlin/juniojsv/engine/features/utils/Resources.kt - Shader loading → Shader programs: provides compiled shaders
engine/src/commonMain/kotlin/juniojsv/engine/features/shader/ShadersProgram.kt - Shader programs → Textures: binds uniforms
engine/src/commonMain/kotlin/juniojsv/engine/features/shader/ShadersProgram.kt - Render pipeline → Shader programs: creates pass programs
engine/src/commonMain/kotlin/juniojsv/engine/features/render/RenderPipeline.kt - Render pipeline → Textures: composites frame textures
engine/src/commonMain/kotlin/juniojsv/engine/features/render/RenderPipeline.kt - Android shader conversion → Android GL binding: translates shaders for
engine/src/androidMain/kotlin/juniojsv/engine/platforms/GL.android.kt