├── .editorconfig ├── .github ├── dependabot.yml ├── funding.yml └── workflows │ ├── build-android.yml │ ├── build.yml │ ├── changelog.yml │ ├── doc-gen.yml │ └── pages.yml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── Generate git changelog.txt ├── Images ├── cursor.png ├── logo_1024.png ├── logo_128.png ├── logo_256.png ├── logo_512.png ├── logo_512_bc6h.dds ├── logo_512_bc7.dds ├── logo_64.png ├── logo_dark_black.png ├── logo_dark_transparent.png ├── logo_dark_white.png ├── logo_light_black.png ├── logo_light_transparent.png ├── logo_light_white.png ├── logo_social.png ├── src │ └── cursor.psd ├── tex_512.png └── tex_test_512.png ├── LICENSE ├── Libraries └── Windows │ └── dxcompiler.dll ├── Molten.Audio.OpenAL ├── AudioDevice.cs ├── AudioServiceAL.cs ├── InputDevice.cs ├── Interop.cs ├── Molten.Audio.OpenAL.csproj ├── OpenALObject.cs ├── OutputDevice.cs ├── SoundInstance.cs ├── SoundSource.cs └── packages.lock.json ├── Molten.Benchmarks ├── Benchmarks.cs ├── Math │ ├── MathHelper_Benchmarks.cs │ └── Vector4_Benchmarks.cs ├── Molten.Benchmarks.csproj └── Performance_Benchmarks.cs ├── Molten.Engine.Android ├── Graphics │ └── AndroidViewSurface.cs ├── IMoltenAndroidActivity.cs ├── Input │ ├── AndroidInputNavigation.cs │ ├── AndroidInputService.cs │ └── AndroidTouchDevice.cs ├── Molten.Engine.Android.csproj ├── MoltenActivity.cs └── Resources │ ├── AboutResources.txt │ └── values │ └── strings.xml ├── Molten.Engine.Windows ├── Input │ ├── WinGamepadDevice.cs │ ├── WinInputService.cs │ ├── WinKeyboardDevice.cs │ ├── WinMouseButtonFlags.cs │ ├── WinMouseDevice.cs │ └── WinWParamXButton.cs ├── LoggerExtensions.cs ├── Molten.Engine.Windows.csproj ├── Win32 │ ├── NativeMessage.cs │ ├── TextMetric.cs │ ├── Win32.CPU.cs │ ├── Win32.Events.cs │ ├── Win32.IO.cs │ ├── Win32.OS.cs │ ├── Win32.Structures.cs │ ├── Win32.Window.cs │ ├── Win32.cs │ ├── WinHResult.cs │ ├── WndMenuCharType.cs │ ├── WndMessageType.cs │ ├── WndPowerEventType.cs │ ├── WndSizeType.cs │ └── WndSysCommandType.cs └── WindowsClipboard.cs ├── Molten.Engine.sln ├── Molten.Engine ├── Assets │ ├── gbuffer.hlsl │ ├── gbuffer.json │ ├── gbuffer_common.hlsl │ ├── gbuffer_compose.hlsl │ ├── light_common.hlsl │ ├── light_point.hlsl │ ├── light_point.json │ ├── skybox.hlsl │ ├── skybox.json │ ├── sprite.hlsl │ ├── sprite.json │ └── sprite_sdf.hlsl ├── Audio │ ├── AudioBuffer.cs │ ├── AudioDeviceException.cs │ ├── AudioDeviceType.cs │ ├── AudioFormat.cs │ ├── AudioPlaybackState.cs │ ├── AudioService.cs │ ├── IAudioDevice.cs │ ├── IAudioInput.cs │ ├── IAudioOutput.cs │ ├── ISoundEmitter.cs │ ├── ISoundInstance.cs │ └── ISoundSource.cs ├── Components │ ├── Audio │ │ ├── SoundEmitterComponent.cs │ │ └── SoundListenerComponent.cs │ ├── CameraComponent.cs │ ├── Lights │ │ ├── CapsuleLightComponent.cs │ │ └── PointLightComponent.cs │ ├── RenderableComponent.cs │ ├── SceneComponent.cs │ ├── SpriteRenderComponent.cs │ └── UIManagerComponent.cs ├── Content │ ├── ContentException.cs │ ├── ContentFile.cs │ ├── ContentHandleType.cs │ ├── ContentLoadBatch.cs │ ├── ContentLoadBatchStatus.cs │ ├── ContentManager.cs │ ├── ContentNotLoadedException.cs │ ├── ContentReloadAttribute.cs │ ├── ContentWatcher.cs │ ├── Handles │ │ ├── ContentHandle.cs │ │ ├── ContentHandleStatus.cs │ │ ├── ContentLoadHandle.cs │ │ ├── ContentLoadJsonHandle.cs │ │ ├── ContentSaveHandle.cs │ │ └── ContentSaveJsonHandle.cs │ ├── JsonExtensions.cs │ ├── Parameters │ │ ├── ContentParameters.cs │ │ ├── ShaderParameters.cs │ │ ├── SpriteFontParameters.cs │ │ ├── StringParameters.cs │ │ └── TextureParameters.cs │ ├── Processors │ │ ├── ContentProcessor.cs │ │ ├── IContentProcessor.cs │ │ ├── ShaderProcessor.cs │ │ ├── SpriteFontProcessor.cs │ │ ├── StringProcessor.cs │ │ └── TextureProcessor.cs │ └── Serialization │ │ ├── SettingValueConverter.cs │ │ ├── UIThemeConverter.cs │ │ └── ValueTypeConverter.cs ├── Data │ ├── DataGrid.cs │ ├── DataGridColumnCollection.cs │ ├── DataGridRow.cs │ ├── DataSet.cs │ ├── GraphDataSet.cs │ └── IDataSet.cs ├── Engine.cs ├── Font │ ├── CaretValue.cs │ ├── FontDirectionHint.cs │ ├── FontEmbeddingFlags.cs │ ├── FontFile.cs │ ├── FontFlags.cs │ ├── FontHeadFlags.cs │ ├── FontInfo.cs │ ├── FontLocaFormat.cs │ ├── FontLookup.cs │ ├── FontNameType.cs │ ├── FontPlatform.cs │ ├── FontReader.cs │ ├── FontSelectionFlags.cs │ ├── FontSubTable.cs │ ├── FontTable.cs │ ├── FontTableList.cs │ ├── FontTableTagAttribute.cs │ ├── FontUtil.cs │ ├── FontValidator.cs │ ├── FontWidthClass.cs │ ├── Glyph.cs │ ├── GlyphClass.cs │ ├── GlyphMarkClass.cs │ ├── GlyphMetrics.cs │ ├── GlyphPoint.cs │ ├── MacStyleFlags.cs │ ├── OffsetTable.cs │ ├── SubTables │ │ ├── AlternateSetTable.cs │ │ ├── AnchorTable.cs │ │ ├── AttachListTable.cs │ │ ├── AttachPointTable.cs │ │ ├── BaseArrayTable.cs │ │ ├── CFF │ │ │ └── CFFIndexTable.cs │ │ ├── ChainRuleSetTable.cs │ │ ├── ClassDefinitionTable.cs │ │ ├── ClassSetTable.cs │ │ ├── Cmap │ │ │ ├── Cmap.format0.cs │ │ │ ├── Cmap.format12.cs │ │ │ ├── Cmap.format14.cs │ │ │ ├── Cmap.format4.cs │ │ │ ├── Cmap.format6.cs │ │ │ ├── Cmap.null.cs │ │ │ └── CmapSubTable.cs │ │ ├── ConditionSetTable.cs │ │ ├── CoverageTable.cs │ │ ├── DeviceVariationIndexTable.cs │ │ ├── FeatureListTable.cs │ │ ├── FeatureSubstitutionTable.cs │ │ ├── FeatureVariationsTable.cs │ │ ├── ItemVariationStore.cs │ │ ├── Kern │ │ │ ├── KerningPair.cs │ │ │ ├── KerningTable.cs │ │ │ └── KerningTableFlags.cs │ │ ├── LigatureArrayTable.cs │ │ ├── LigatureCaretListTable.cs │ │ ├── LigatureGlyphTable.cs │ │ ├── LigatureSetTable.cs │ │ ├── LookupListTable.cs │ │ ├── MarkArrayTable.cs │ │ ├── MarkGlyphSetsTable.cs │ │ ├── RuleSetTable.cs │ │ ├── ScriptListTable.cs │ │ ├── SequenceTable.cs │ │ └── VariationRegionListTable.cs │ ├── TableHeader.cs │ └── Tables │ │ ├── CFF.cs │ │ ├── Cvt.cs │ │ ├── DSIG.cs │ │ ├── FFTM.cs │ │ ├── FontGTable.cs │ │ ├── Fpgm.cs │ │ ├── GDEF.cs │ │ ├── GPOS.ClassRecord.cs │ │ ├── GPOS.EntryExitRecord.cs │ │ ├── GPOS.PairSet.cs │ │ ├── GPOS.ValueRecord.cs │ │ ├── GPOS.cs │ │ ├── GSUB.cs │ │ ├── Gasp.cs │ │ ├── Glyf.cs │ │ ├── Hdmx.cs │ │ ├── Head.cs │ │ ├── Hhea.cs │ │ ├── Hmtx.cs │ │ ├── JSTF.cs │ │ ├── LTSH.cs │ │ ├── Loca.cs │ │ ├── Meta.cs │ │ ├── Name.cs │ │ ├── Os2.cs │ │ ├── PCLT.cs │ │ ├── Post.cs │ │ ├── Prep.cs │ │ ├── VDMX.cs │ │ ├── cmap.cs │ │ ├── kern.cs │ │ └── maxp.cs ├── Foundation.cs ├── GameRunState.cs ├── Graphics │ ├── AntiAliasLevel.cs │ ├── Exceptions │ │ ├── DisplayOutputException.cs │ │ ├── GpuCommandListException.cs │ │ ├── GpuDeviceException.cs │ │ ├── GpuFormatException.cs │ │ ├── GpuObjectException.cs │ │ ├── GpuResourceException.cs │ │ ├── GpuStrideException.cs │ │ └── ResourceCopyException.cs │ ├── FrameBufferMode.cs │ ├── GeometryHullTopology.cs │ ├── GpuDepthWritePermission.cs │ ├── GpuDevice.cs │ ├── GpuFormatSupportFlags.cs │ ├── GpuFrameBuffer.cs │ ├── GpuObject.cs │ ├── GpuResourceFormat.cs │ ├── GpuResourceManager.cs │ ├── GpuTaskBank.cs │ ├── Hardware │ │ ├── Capabilities │ │ │ ├── BufferCapabilities.cs │ │ │ ├── CommandListSupport.cs │ │ │ ├── ComputeCapabilities.cs │ │ │ ├── ConservativeRasterizationFlags.cs │ │ │ ├── GpuCapFlags.cs │ │ │ ├── GpuCapabilities.cs │ │ │ ├── GraphicsApi.cs │ │ │ ├── MeshShaderCapabilities.cs │ │ │ ├── ShaderCapFlags.cs │ │ │ ├── ShaderStageCapabilities.cs │ │ │ ├── SupportedCommandSet.cs │ │ │ └── VertexBufferCapabilities.cs │ │ ├── DisplayDelagates.cs │ │ ├── DisplayOrientation.cs │ │ ├── DisplayScalingMode.cs │ │ ├── GpuDeviceType.cs │ │ ├── GpuManager.cs │ │ ├── IDisplayMode.cs │ │ └── IDisplayOutput.cs │ ├── MSAAQuality.cs │ ├── MSAASupport.cs │ ├── Mesh │ │ ├── InstancedMesh.cs │ │ ├── Mesh.cs │ │ └── StandardMesh.cs │ ├── MeshHelper.cs │ ├── ObjectUpdateFlags.cs │ ├── Pipeline │ │ ├── GpuBindResult.cs │ │ ├── GpuCommandList.cs │ │ ├── GpuCommandListFlags.cs │ │ ├── GpuFence.cs │ │ ├── GpuPriority.cs │ │ ├── GpuState.cs │ │ ├── GpuStateArray.cs │ │ ├── GpuStateBasicValue.cs │ │ ├── GpuStateBasicValueGroup.cs │ │ ├── GpuStateValue.cs │ │ ├── GpuStateValueGroup.cs │ │ └── QueueValidationMode.cs │ ├── PrimitiveTopology.cs │ ├── Profiling │ │ ├── GraphicsDeviceProfiler.cs │ │ ├── GraphicsProfiler.cs │ │ └── GraphicsQueueProfiler.cs │ ├── RenderService.cs │ ├── Renderer │ │ ├── DepthSurfaceTracker.cs │ │ ├── MainSurfaceType.cs │ │ ├── Overlays │ │ │ ├── IRenderOverlay.cs │ │ │ ├── OverlayProvider.cs │ │ │ └── RenderProfilerOverlay.cs │ │ ├── RenderChain.cs │ │ ├── RenderChainContext.cs │ │ ├── RenderChainLink.cs │ │ ├── Renderable.cs │ │ ├── SpriteRenderer.cs │ │ ├── Steps │ │ │ ├── CompositionStep.cs │ │ │ ├── FinalizeStep.cs │ │ │ ├── ForwardStep.cs │ │ │ ├── GBufferStep.cs │ │ │ ├── LightingStep.cs │ │ │ ├── RenderStep.cs │ │ │ ├── SkyboxStep.cs │ │ │ └── StartStep.cs │ │ ├── SurfaceManager.cs │ │ ├── SurfaceSizeMode.cs │ │ └── SurfaceTracker.cs │ ├── ResourceRegion.cs │ ├── Resources │ │ ├── Buffers │ │ │ ├── GpuBuffer.cs │ │ │ ├── GpuBufferType.cs │ │ │ ├── GpuConstantData.cs │ │ │ ├── GpuDiscardBuffer.cs │ │ │ ├── TypedBufferFormat.cs │ │ │ └── Variables │ │ │ │ ├── GraphicsConstantVariable.cs │ │ │ │ ├── Scalar3x2.cs │ │ │ │ ├── Scalar3x3.cs │ │ │ │ ├── Scalar3x3Array.cs │ │ │ │ ├── Scalar4x4.cs │ │ │ │ ├── Scalar4x4Array.cs │ │ │ │ ├── ScalarArray.cs │ │ │ │ ├── ScalarMatrixArray.cs │ │ │ │ └── ScalarVariable.cs │ │ ├── GpuMapType.cs │ │ ├── GpuResource.cs │ │ ├── GpuResourceFlags.cs │ │ ├── GpuResourceHandle.cs │ │ ├── GpuResourceMap.cs │ │ ├── GpuStream.cs │ │ ├── IGpuResource.cs │ │ ├── Surfaces │ │ │ ├── DepthClearFlags.cs │ │ │ ├── DepthFormat.cs │ │ │ ├── IDepthStencilSurface.cs │ │ │ ├── INativeSurface.cs │ │ │ ├── IRenderSurface.cs │ │ │ ├── IRenderSurface1D.cs │ │ │ ├── IRenderSurface2D.cs │ │ │ └── ISwapChainSurface.cs │ │ └── Textures │ │ │ ├── BC │ │ │ ├── BC.cs │ │ │ ├── BC4.cs │ │ │ ├── BC4BC5.cs │ │ │ ├── BC5.cs │ │ │ ├── BC67.cs │ │ │ ├── BC6HBC7.CBits.cs │ │ │ ├── BC6HBC7.FixUp.cs │ │ │ ├── BC6HBC7.PartitionTable.cs │ │ │ ├── BCContext.cs │ │ │ ├── BCFlags.cs │ │ │ ├── BCHelper.cs │ │ │ ├── D3DX_BC1.cs │ │ │ ├── D3DX_BC2.cs │ │ │ ├── D3DX_BC3.cs │ │ │ ├── D3DX_BC6H.cs │ │ │ ├── D3DX_BC7.cs │ │ │ ├── INTCOLOR.cs │ │ │ └── Parsers │ │ │ │ ├── BC1Parser.cs │ │ │ │ ├── BC2Parser.cs │ │ │ │ ├── BC3Parser.cs │ │ │ │ ├── BC4Parser.cs │ │ │ │ ├── BC5Parser.cs │ │ │ │ ├── BC6Parser.cs │ │ │ │ ├── BC7Parser.cs │ │ │ │ └── BCBlockParser.cs │ │ │ ├── DDS │ │ │ ├── DDSCapabilities.cs │ │ │ ├── DDSFlags.cs │ │ │ ├── DDSFormat.cs │ │ │ ├── DDSHeader.cs │ │ │ ├── DDSHeaderDXT10.cs │ │ │ ├── DDSPixelFormat.cs │ │ │ ├── DDSPixelFormatFlags.cs │ │ │ ├── DDSReader.cs │ │ │ ├── DDSSizeException.cs │ │ │ └── DDSWriter.cs │ │ │ ├── DefaultTextureReader.cs │ │ │ ├── GpuTexture.cs │ │ │ ├── ITexture.cs │ │ │ ├── ITexture1D.cs │ │ │ ├── ITexture2D.cs │ │ │ ├── ITexture3D.cs │ │ │ ├── ITextureCube.cs │ │ │ ├── MagickTextureWriter.cs │ │ │ ├── TextureData.cs │ │ │ ├── TextureDimensions.cs │ │ │ ├── TextureReader.cs │ │ │ ├── TextureSlice.cs │ │ │ ├── TextureSliceRef.cs │ │ │ └── TextureWriter.cs │ ├── SDF │ │ ├── ContourCombiner.cs │ │ ├── EdgeColouring.cs │ │ ├── ErrorCorrection │ │ │ ├── ArtifactClassifier.cs │ │ │ ├── BaseArtifactClassifier.cs │ │ │ ├── ErrorCorrection.cs │ │ │ ├── SdfConfig.cs │ │ │ ├── SdfErrorCorrection.cs │ │ │ └── ShapeDistanceChecker.cs │ │ ├── FillRule.cs │ │ ├── MultiDistancePixelConversion.cs │ │ ├── Scanline.cs │ │ ├── SdfGenerator.cs │ │ ├── SdfProjection.cs │ │ ├── Selectors │ │ │ ├── EdgeCache.cs │ │ │ ├── MultiDistanceSelector.cs │ │ │ └── PseudoDistanceSelector.cs │ │ └── ShapeDistanceFinder.cs │ ├── Scene │ │ ├── Changes │ │ │ ├── AddCamera.cs │ │ │ ├── RemoveCamera.cs │ │ │ ├── RenderLayerAdd.cs │ │ │ ├── RenderLayerRemove.cs │ │ │ ├── RenderLayerReorder.cs │ │ │ ├── RenderableAdd.cs │ │ │ └── RenderableRemove.cs │ │ ├── LayerRenderData.cs │ │ ├── Lights │ │ │ ├── LightData.cs │ │ │ └── LightList.cs │ │ ├── ObjectRenderData.cs │ │ ├── RenderCamera.cs │ │ ├── RenderCameraFlags.cs │ │ ├── RenderCameraMode.cs │ │ ├── RenderDataBatch.cs │ │ └── SceneRenderData.cs │ ├── ShaderLayoutCache.cs │ ├── Shaders │ │ ├── ComparisonMode.cs │ │ ├── Compiler │ │ │ ├── PassCompileResult.cs │ │ │ ├── Reflection │ │ │ │ ├── ConstantBufferFlags.cs │ │ │ │ ├── ConstantBufferInfo.cs │ │ │ │ ├── ConstantBufferType.cs │ │ │ │ ├── ConstantBufferVariableInfo.cs │ │ │ │ ├── ShaderInputFlags.cs │ │ │ │ ├── ShaderInputType.cs │ │ │ │ ├── ShaderMinPrecision.cs │ │ │ │ ├── ShaderParameterInfo.cs │ │ │ │ ├── ShaderReflection.cs │ │ │ │ ├── ShaderRegisterType.cs │ │ │ │ ├── ShaderResourceDimension.cs │ │ │ │ ├── ShaderResourceInfo.cs │ │ │ │ ├── ShaderReturnType.cs │ │ │ │ ├── ShaderSVType.cs │ │ │ │ ├── ShaderTypeInfo.cs │ │ │ │ ├── ShaderVariableClass.cs │ │ │ │ ├── ShaderVariableFlags.cs │ │ │ │ └── ShaderVariableType.cs │ │ │ ├── ShaderCodeResult.cs │ │ │ ├── ShaderCompileFlags.cs │ │ │ ├── ShaderCompileResult.cs │ │ │ ├── ShaderCompiler.cs │ │ │ ├── ShaderCompilerContext.cs │ │ │ ├── ShaderCompilerMessage.cs │ │ │ ├── ShaderDefinition.cs │ │ │ ├── ShaderEntryPointDefinition.cs │ │ │ ├── ShaderPassDefinition.cs │ │ │ ├── ShaderSource.cs │ │ │ └── ShaderStructureBuilder.cs │ │ ├── Enums │ │ │ ├── BlendOperation.cs │ │ │ ├── BlendPreset.cs │ │ │ ├── BlendType.cs │ │ │ ├── ColorWriteFlags.cs │ │ │ ├── ComparisonFunction.cs │ │ │ ├── ConservativeRasterizerMode.cs │ │ │ ├── DepthStencilOperation.cs │ │ │ ├── DepthStencilPreset.cs │ │ │ ├── LogicOperation.cs │ │ │ ├── RasterizerCullingMode.cs │ │ │ ├── RasterizerFillingMode.cs │ │ │ └── RasterizerPreset.cs │ │ ├── Properties │ │ │ ├── CommonShaderProperties.cs │ │ │ ├── GBufferTextureProperties.cs │ │ │ ├── LightMaterialProperties.cs │ │ │ ├── ObjectMaterialProperties.cs │ │ │ ├── SceneMaterialProperties.cs │ │ │ └── SpriteBatchMaterialProperties.cs │ │ ├── SamplerAddressMode.cs │ │ ├── SamplerFilter.cs │ │ ├── Shader.cs │ │ ├── ShaderBind.cs │ │ ├── ShaderBindManager.cs │ │ ├── ShaderBindType.cs │ │ ├── ShaderComponentMaskFlags.cs │ │ ├── ShaderFormatLayout.cs │ │ ├── ShaderIOLayout.cs │ │ ├── ShaderLayoutValidator.cs │ │ ├── ShaderModel.Extensions.cs │ │ ├── ShaderModel.cs │ │ ├── ShaderPass.cs │ │ ├── ShaderPassParameters.Presets.cs │ │ ├── ShaderPassParameters.cs │ │ ├── ShaderPassStage.cs │ │ ├── ShaderSampler.cs │ │ ├── ShaderSamplerParameters.cs │ │ ├── ShaderStageType.cs │ │ └── Variables │ │ │ ├── DummyShaderValue.cs │ │ │ ├── RWVariable.cs │ │ │ ├── ShaderResourceVariable.cs │ │ │ ├── ShaderSamplerVariable.cs │ │ │ └── ShaderVariable.cs │ ├── Sprite │ │ ├── AnimatedSprite.cs │ │ ├── Sprite.cs │ │ ├── SpriteAnimation.cs │ │ ├── SpriteBatchException.cs │ │ ├── SpriteBatcher.Edge.cs │ │ ├── SpriteBatcher.Ellipse.cs │ │ ├── SpriteBatcher.GpuData.cs │ │ ├── SpriteBatcher.Line.cs │ │ ├── SpriteBatcher.Rect.cs │ │ ├── SpriteBatcher.RectRounded.cs │ │ ├── SpriteBatcher.Shape.cs │ │ ├── SpriteBatcher.String.cs │ │ ├── SpriteBatcher.cs │ │ ├── SpriteData.cs │ │ └── SpriteSheet.cs │ ├── Style │ │ ├── CornerInfo.cs │ │ ├── EllipseStyle.cs │ │ ├── GridStyle.cs │ │ ├── LineStyle.cs │ │ ├── RectStyle.cs │ │ ├── RoundedRectStyle.cs │ │ └── TextStyle.cs │ ├── Tasks │ │ ├── ComputeTask.cs │ │ ├── GpuTask.cs │ │ ├── Resources │ │ │ ├── BufferGetStreamTask.cs │ │ │ ├── BufferGetTask.cs │ │ │ ├── BufferSetTask.cs │ │ │ ├── GenerateMipMapsTask.cs │ │ │ ├── ResizeTextureTask.cs │ │ │ ├── ResourceCopyTask.cs │ │ │ ├── SubResourceCopyTask.cs │ │ │ ├── TextureGetDataTask.cs │ │ │ ├── TextureGetSliceTask.cs │ │ │ ├── TextureSetDataTask.cs │ │ │ └── TextureSetSubResourceTask.cs │ │ └── Scene │ │ │ ├── RenderAddScene.cs │ │ │ └── RenderRemoveScene.cs │ ├── Text │ │ ├── SpriteFont.cs │ │ ├── SpriteFontBinding.cs │ │ ├── SpriteFontCharData.cs │ │ ├── SpriteFontGlyphBinding.cs │ │ ├── SpriteFontManager.cs │ │ └── SpriteFontPage.cs │ ├── Thickness.cs │ ├── Vertices │ │ ├── EngineBonedVertex.cs │ │ ├── GBufferVertex.cs │ │ ├── IVertexInstanceType.cs │ │ ├── IVertexType.cs │ │ ├── InstanceData.cs │ │ ├── TriplanarVertex.cs │ │ ├── Vertex.cs │ │ ├── VertexColor.cs │ │ ├── VertexColorNormalTexture.cs │ │ ├── VertexColorTexture.cs │ │ ├── VertexElementAttribute.cs │ │ ├── VertexElementType.cs │ │ ├── VertexElementUsage.cs │ │ ├── VertexInputType.cs │ │ ├── VertexTexture.cs │ │ └── VertexWithID.cs │ └── WindowMode.cs ├── IO │ ├── EmbeddedResource.cs │ ├── EnhancedBinaryReader.cs │ ├── FlippedBinaryReader.cs │ ├── Logging │ │ ├── ILogOutput.cs │ │ ├── LogCategory.cs │ │ ├── LogFileWriter.cs │ │ └── Logger.cs │ ├── RawStream.cs │ └── RawStreamException.cs ├── IWindow.cs ├── Input │ ├── Features │ │ ├── InputAnalogStick.cs │ │ ├── InputAnalogTrigger.cs │ │ ├── InputDeviceFeature.cs │ │ ├── InputScrollWheel.cs │ │ └── InputVibration.cs │ ├── Gamepad │ │ ├── GamepadButtonState.cs │ │ ├── GamepadButtons.cs │ │ ├── GamepadDevice.cs │ │ └── GamepadSubType.cs │ ├── IClipboard.cs │ ├── IInputNavigation.cs │ ├── IInputState.cs │ ├── InputAction.cs │ ├── InputActionType.cs │ ├── InputDevice.cs │ ├── InputService.cs │ ├── Keyboard │ │ ├── KeyCode.cs │ │ ├── KeyboardDevice.cs │ │ ├── KeyboardEvents.cs │ │ ├── KeyboardKeyState.cs │ │ └── KeyboardKeyType.cs │ └── Pointers │ │ ├── Mouse │ │ └── MouseDevice.cs │ │ ├── PointerButton.cs │ │ ├── PointerState.cs │ │ ├── PointingDevice.cs │ │ ├── PointingDeviceType.cs │ │ └── Touch │ │ └── TouchDevice.cs ├── Molten.Engine.csproj ├── ObjectHandler.cs ├── Scene │ ├── CameraInputTracker.cs │ ├── Changes │ │ ├── SceneAddObject.cs │ │ ├── SceneChange.cs │ │ ├── SceneLayerAdd.cs │ │ ├── SceneLayerRemove.cs │ │ ├── SceneLayerReorder.cs │ │ └── SceneRemoveObject.cs │ ├── ComponentTypeTracker.cs │ ├── IInputReceiver.cs │ ├── IPickable.cs │ ├── Scene.cs │ ├── SceneCollection.cs │ ├── SceneComponentCollection.cs │ ├── SceneException.cs │ ├── SceneInputData.cs │ ├── SceneLayer.cs │ ├── SceneLayerMask.cs │ ├── SceneManager.cs │ ├── SceneObject.cs │ └── SceneObjectTransform.cs ├── Services │ ├── EngineService.cs │ ├── EngineServiceException.cs │ ├── EngineServiceState.cs │ └── ServiceStartupProperties.cs ├── Settings │ ├── AudioSettings.cs │ ├── EngineSettings.cs │ ├── GraphicsSettings.cs │ ├── InputSettings.cs │ ├── NetworkSettings.cs │ ├── SettingBank.cs │ ├── SettingValue.cs │ ├── SettingValueList.cs │ └── UISettings.cs ├── Tasks │ ├── EngineAddScene.cs │ ├── EngineRemoveScene.cs │ └── EngineTask.cs ├── Threading │ ├── EngineThread.cs │ ├── EngineThreadException.cs │ ├── ThreadManager.cs │ ├── ThreadingMode.cs │ ├── WorkerGroup.cs │ ├── WorkerGroupException.cs │ ├── WorkerTasks │ │ ├── WorkerCallbackTask.cs │ │ └── WorkerTask.cs │ └── WorkerThread.cs ├── UI │ ├── Elements │ │ ├── Text │ │ │ ├── Parsers │ │ │ │ └── UITextParser.cs │ │ │ ├── UITextBox.cs │ │ │ ├── UITextCaret.cs │ │ │ ├── UITextChunk.cs │ │ │ ├── UITextLine.cs │ │ │ ├── UITextLinkable.cs │ │ │ └── UITextSegment.cs │ │ ├── UIButton.cs │ │ ├── UICheckbox.cs │ │ ├── UIConsole.cs │ │ ├── UIContainer.cs │ │ ├── UIGraphBase.cs │ │ ├── UILabel.cs │ │ ├── UILineGraph.cs │ │ ├── UIListView.cs │ │ ├── UIListViewItem.cs │ │ ├── UIPanel.cs │ │ ├── UIScrollBar.cs │ │ ├── UISprite.cs │ │ ├── UIStackPanel.cs │ │ ├── UITexture.cs │ │ └── UIWindow.cs │ ├── Theme │ │ ├── UIStyle.cs │ │ ├── UIStyleValue.cs │ │ ├── UITheme.cs │ │ └── UIThemeMemberAttribute.cs │ ├── UICancelEventArgs.cs │ ├── UIConstants.cs │ ├── UIElement.cs │ ├── UIElementFilter.cs │ ├── UIElementFlowDirection.cs │ ├── UIElementLayer.cs │ ├── UIElementState.cs │ ├── UIFillType.cs │ ├── UIHorizonalAlignment.cs │ ├── UIInputRuleFlags.cs │ ├── UIMargin.cs │ ├── UIPadding.cs │ ├── UIVerticalAlignment.cs │ └── UIWindowState.cs └── packages.lock.json ├── Molten.Examples.Common ├── Assets │ ├── 128_1.dds │ ├── 128_2.dds │ ├── 128_3.dds │ ├── 1d_1.png │ ├── 1d_2.png │ ├── 1d_3.png │ ├── Ananda Namaste Regular.ttf │ ├── BasicColor.hlsl │ ├── BasicColor.json │ ├── BasicColorInstanced.hlsl │ ├── BasicColorInstanced.json │ ├── BasicTexture.hlsl │ ├── BasicTexture.json │ ├── BasicTexture1D.hlsl │ ├── BasicTexture1D.json │ ├── BasicTextureArray1D.hlsl │ ├── BasicTextureArray1D.json │ ├── BasicTextureArray2D.hlsl │ ├── BasicTextureArray2D.json │ ├── BroshK.ttf │ ├── ComputeAdd.hlsl │ ├── ComputeAdd.json │ ├── Digitalt.ttf │ ├── FiraSans-Bold.ttf │ ├── FiraSans-Regular.ttf │ ├── cubemap.dds │ ├── dds_bc4.dds │ ├── dds_bc4_srgb.dds │ ├── dds_bc5.dds │ ├── dds_bc6h_fast.dds │ ├── dds_bc6h_fine.dds │ ├── dds_bc7_fast.dds │ ├── dds_bc7_fine.dds │ ├── dds_bc7_srgb_fast.dds │ ├── dds_bc7_srgb_fine.dds │ ├── dds_color_test.dds │ ├── dds_dxt1.dds │ ├── dds_dxt3.dds │ ├── dds_dxt5.dds │ ├── dds_dxt5_srgb.dds │ ├── dds_rgba.dds │ ├── dds_test.dds │ ├── dds_test_e.dds │ ├── dds_test_n.dds │ ├── dds_test_red.dds │ ├── euphorigenic.ttf │ ├── logo_512_bc6h.dds │ ├── logo_512_bc7.dds │ ├── logo_64.png │ ├── metal.dds │ ├── metal_e.dds │ ├── metal_n.dds │ ├── metal_s.dds │ ├── png_test.png │ └── test_theme.json ├── CubeArrayVertex.cs ├── ExampleAttribute.cs ├── ExampleBrowser.cs ├── Examples │ ├── AudioCapture.cs │ ├── ComputeAdd.cs │ ├── DeferredRendering.cs │ ├── FontFileTest.cs │ ├── FractalTree.cs │ ├── MoltenExample.cs │ ├── SaveTexture.cs │ ├── Skybox.cs │ ├── SpriteBatchArray.cs │ ├── SpriteBatching.cs │ ├── StressTest.cs │ ├── StressTestIndexed.cs │ ├── StressTestIndexedInstanced.cs │ ├── StressTestInstanced.cs │ ├── Texture1D.cs │ ├── Texture1DArray.cs │ ├── Texture2D.cs │ ├── Texture2DArray.cs │ └── UIDemo.cs ├── Molten.Examples.Common.csproj ├── SampleCameraController.cs ├── SampleSpriteRenderComponent.cs ├── SampleVertexData.cs └── UIExampleListItem.cs ├── Molten.Examples.Desktop.Windows ├── Molten.Examples.Desktop.Windows.csproj ├── Program.cs ├── dxcompiler.dll └── dxil.dll ├── Molten.Graphics.DX12 ├── CapabilitiesDX12.cs ├── D3D12Core.dll ├── DX12Extensions.cs ├── DX12Interop.cs ├── DeviceDX12.cs ├── Interop │ ├── BlendInterop.cs │ ├── DescriptionInterop.cs │ ├── RasterizerInterop.cs │ ├── ResourceInterop.cs │ ├── SamplerInterop.cs │ └── ShaderInterop.cs ├── Molten.Graphics.DX12.csproj ├── Pipeline │ ├── BarrierStateTrackerDX12.cs │ ├── CommandAllocatorDX12.cs │ ├── CommandListDX12.cs │ ├── CommandQueueDX12.cs │ ├── DeviceBuilderDX12.cs │ ├── FenceDX12.cs │ ├── Heap │ │ ├── DescriptorHeapAllocatorDX12.cs │ │ ├── DescriptorHeapDX12.cs │ │ ├── DescriptorHeapManagerDX12.cs │ │ ├── HeapDX12.cs │ │ └── HeapHandleDX12.cs │ ├── PipelineInputLayoutDX12.cs │ ├── ProtectedSessionDX12.cs │ └── State │ │ ├── BarrierStateDX12.cs │ │ ├── BlendStateDX12.cs │ │ ├── DepthStateDX12.cs │ │ ├── PipelineStateBuilderDX12.cs │ │ ├── PipelineStateDX12.cs │ │ ├── RasterizerStateDX12.cs │ │ ├── RootSigMetaDX12.cs │ │ ├── RootSigPopulator1_0.cs │ │ ├── RootSigPopulator1_1.cs │ │ ├── RootSignatureBuilderDX12.cs │ │ ├── RootSignatureDX12.cs │ │ └── RootSignaturePopulatorDX12.cs ├── RendererDX12.cs ├── ResourceManagerDX12.cs ├── Resources │ ├── BufferDX12.cs │ ├── CBHandleDX12.cs │ ├── DSHandleDX12.cs │ ├── IBHandleDX12.cs │ ├── RTHandleDX12.cs │ ├── ResourceHandleDX12.cs │ ├── Surfaces │ │ ├── DepthSurfaceDX12.cs │ │ ├── FormSurfaceDX12.cs │ │ ├── RenderSurface1DDX12.cs │ │ ├── RenderSurface2DDX12.cs │ │ └── SwapChainSurfaceDX12.cs │ ├── Tasks │ │ ├── DepthClearTaskDX12.cs │ │ └── SurfaceClearTaskDX12.cs │ ├── Textures │ │ ├── Texture1DDX12.cs │ │ ├── Texture2DDX12.cs │ │ ├── Texture3DDX12.cs │ │ ├── TextureCubeDX12.cs │ │ └── TextureDX12.cs │ ├── VBHandleDX12.cs │ └── Views │ │ ├── CBViewDX12.cs │ │ ├── DSViewDX12.cs │ │ ├── RTViewDX12.cs │ │ ├── SRViewDX12.cs │ │ ├── SamplerViewDX12.cs │ │ ├── UAViewDX12.cs │ │ └── ViewDX12.cs ├── Shaders │ ├── HlslDxcCompiler.cs │ ├── ShaderIOLayoutDX12.cs │ ├── ShaderPassDX12.cs │ └── StaticSamplerDX12.cs ├── d3d12SDKLayers.dll └── packages.lock.json ├── Molten.Graphics.DXC ├── DxcArgumentBuilder.cs ├── DxcCompiler.cs ├── DxcCompilerArg.cs ├── Molten.Graphics.DXC.csproj └── packages.lock.json ├── Molten.Graphics.DXGI ├── DXGIHelper.cs ├── DeviceDXGI.cs ├── DisplayModeDXGI.cs ├── DisplayOutputDXGI.cs ├── DxgiError.cs ├── DxgiSwapChainFlags.cs ├── DxgiUsage.cs ├── GraphicsManagerDXGI.cs ├── Interop │ └── SilkDxgiExtensions.cs ├── Molten.Graphics.DXGI.csproj ├── WindowAssociationFlags.cs └── packages.lock.json ├── Molten.Graphics.Vulkan ├── DeviceLoaderVK.cs ├── DeviceVK.cs ├── ExtensionLoaderVK.cs ├── FrameBufferedArray.cs ├── Hardware │ ├── CapabilityBuilderVK.cs │ ├── DisplayManagerVK.cs │ ├── DisplayModeVK.cs │ ├── DisplayOutputVK.cs │ ├── ExtensionBinding.cs │ └── VulkanExtension.cs ├── InstanceLoaderVK.cs ├── Interop │ ├── BlendInterop.cs │ ├── DepthStencilInterop.cs │ ├── RasterizerInterop.cs │ ├── StateInterop.cs │ └── VkInterop.cs ├── Molten.Graphics.Vulkan.csproj ├── Pipeline │ ├── CommandListVK.cs │ ├── CommandPoolAllocation.cs │ ├── CommandPoolVK.cs │ ├── CommandQueueVK.cs │ ├── DescriptorPoolVK.cs │ ├── FenceVK.cs │ ├── MemoryAllocationVK.cs │ ├── MemoryHeapVK.cs │ ├── MemoryManagerVK.cs │ ├── SamplerVK.cs │ └── SemaphoreVK.cs ├── RendererVK.cs ├── ResourceManagerVK.cs ├── Resources │ ├── BufferHandleVK.cs │ ├── BufferVK.cs │ ├── ImageHandleVK.cs │ ├── ResourceHandleVK.cs │ ├── ResourceSubHandleVK.cs │ ├── Surfaces │ │ ├── DepthSurfaceVK.cs │ │ ├── IRenderSurfaceVK.cs │ │ ├── RenderSurface1DVK.cs │ │ ├── RenderSurface2DVK.cs │ │ ├── SwapChainSurfaceVK.cs │ │ └── WindowSurfaceVK.cs │ ├── Tasks │ │ ├── DepthClearTaskVK.cs │ │ └── SurfaceClearTaskVK.cs │ └── Textures │ │ ├── Texture1DVK.cs │ │ ├── Texture2DVK.cs │ │ ├── Texture3DVK.cs │ │ ├── TextureCubeVK.cs │ │ └── TextureVK.cs ├── ResultExtensions.cs ├── Shaders │ ├── ReflectionLogAdapter.cs │ ├── ShaderPassVK.cs │ ├── SpirvCompileTarget.cs │ └── SpirvCompiler.cs ├── States │ ├── BlendStateVK.cs │ ├── DepthStateVK.cs │ ├── DescriptorSetLayoutVK.cs │ ├── DescriptorSetVK.cs │ ├── DynamicStateVK.cs │ ├── FrameBufferVK.cs │ ├── InputAssemblyStateVK.cs │ ├── PipelineLayoutVK.cs │ ├── PipelineStateVK.cs │ ├── RasterizerStateVK.cs │ └── RenderPassVK.cs ├── VersionVK.cs └── packages.lock.json ├── Molten.Math ├── AngleType.cs ├── BinPacker.cs ├── ByteMath.cs ├── ContainmentType.cs ├── DoublePrecision │ ├── AngleD.cs │ ├── BezierCurve2D.cs │ ├── Colors │ │ ├── Color3D.cs │ │ └── Color4D.cs │ ├── Matrices │ │ ├── Matrix2D.cs │ │ ├── Matrix2D.m2.cs │ │ ├── Matrix2x3D.cs │ │ ├── Matrix2x3D.m2x3.cs │ │ ├── Matrix3D.cs │ │ ├── Matrix3D.m3.cs │ │ ├── Matrix3x2D.cs │ │ ├── Matrix3x2D.m3x2.cs │ │ ├── Matrix4D.cs │ │ └── Matrix4D.m4.cs │ ├── QuaternionD.cs │ ├── Rectangles │ │ ├── RectangleD.cs │ │ ├── RectangleL.cs │ │ └── RectangleUL.cs │ └── Vectors │ │ ├── Vector2D.cs │ │ ├── Vector2D.fp.cs │ │ ├── Vector2D.fp2.cs │ │ ├── Vector2D.v2.cs │ │ ├── Vector2L.cs │ │ ├── Vector2L.v2.cs │ │ ├── Vector2UL.cs │ │ ├── Vector2UL.v2.cs │ │ ├── Vector3D.cs │ │ ├── Vector3D.fp.cs │ │ ├── Vector3D.fp3.cs │ │ ├── Vector3D.v3.cs │ │ ├── Vector3L.cs │ │ ├── Vector3L.v3.cs │ │ ├── Vector3UL.cs │ │ ├── Vector3UL.v3.cs │ │ ├── Vector4D.cs │ │ ├── Vector4D.fp.cs │ │ ├── Vector4D.fp4.cs │ │ ├── Vector4L.cs │ │ └── Vector4UL.cs ├── HalfPrecision │ └── Vectors │ │ ├── Half2.cs │ │ ├── Half3.cs │ │ ├── Half4.cs │ │ ├── Vector2S.cs │ │ ├── Vector2S.v2.cs │ │ ├── Vector2US.cs │ │ ├── Vector2US.v2.cs │ │ ├── Vector3S.cs │ │ ├── Vector3S.v3.cs │ │ ├── Vector3US.cs │ │ ├── Vector3US.v3.cs │ │ ├── Vector4S.cs │ │ └── Vector4US.cs ├── HalfUtils.cs ├── IMatrix.cs ├── ITransposableMatrix.cs ├── IUniformMatrix.cs ├── IVector.cs ├── MathHelper.cs ├── Molten.Math.csproj ├── Noise │ ├── PerlinNoise.cs │ └── PerlinNoise2D.cs ├── P2T │ ├── AdvancingFront.cs │ ├── EdgeEvent.cs │ ├── Node.cs │ ├── Sweep.cs │ ├── SweepBasin.cs │ ├── SweepContext.cs │ ├── TriEdge.cs │ ├── TriPoint.cs │ ├── TriUtil.cs │ └── Triangle.cs ├── PlainIntersectionType.cs ├── RandomNumber.cs ├── Shapes │ ├── Contour.cs │ ├── EdgeColor.cs │ ├── Edges │ │ ├── CubicEdge.cs │ │ ├── Edge.cs │ │ ├── LinearEdge.cs │ │ └── QuadraticEdge.cs │ └── Shape.cs ├── SinglePrecision │ ├── AffineTransform.cs │ ├── AngleF.cs │ ├── BezierCurve3D.cs │ ├── Bool4.cs │ ├── BoundingBox.cs │ ├── BoundingFrustum.cs │ ├── BoundingSphere.cs │ ├── CollisionHelper.cs │ ├── Colors │ │ ├── Color.Palette.cs │ │ ├── Color.cs │ │ ├── Color3.cs │ │ ├── Color4.cs │ │ └── ColorBGRA.cs │ ├── Ellipse.cs │ ├── FrustumCameraParams.cs │ ├── Matrices │ │ ├── Matrix2F.cs │ │ ├── Matrix2F.m2.cs │ │ ├── Matrix2x3F.cs │ │ ├── Matrix2x3F.m2x3.cs │ │ ├── Matrix3F.cs │ │ ├── Matrix3F.m3.cs │ │ ├── Matrix3x2F.cs │ │ ├── Matrix3x2F.m3x2.cs │ │ ├── Matrix4F.cs │ │ ├── Matrix4F.m4.cs │ │ └── Matrix5x4.cs │ ├── OrientedBoundingBox.cs │ ├── Plane.cs │ ├── QuaternionF.cs │ ├── Ray.cs │ ├── RayHit.cs │ ├── Rectangles │ │ ├── Rectangle.cs │ │ ├── RectangleF.cs │ │ └── RectangleUI.cs │ ├── RigidTransform.cs │ ├── SignedDistance.cs │ ├── SignedDistanceSolver.cs │ ├── Vectors │ │ ├── Byte2.cs │ │ ├── Byte2.v2.cs │ │ ├── Byte3.cs │ │ ├── Byte3.v3.cs │ │ ├── Byte4.cs │ │ ├── SByte2.cs │ │ ├── SByte2.v2.cs │ │ ├── SByte3.cs │ │ ├── SByte3.v3.cs │ │ ├── SByte4.cs │ │ ├── Vector2F.cs │ │ ├── Vector2F.fp.cs │ │ ├── Vector2F.fp2.cs │ │ ├── Vector2F.v2.cs │ │ ├── Vector2I.cs │ │ ├── Vector2I.v2.cs │ │ ├── Vector2UI.cs │ │ ├── Vector2UI.v2.cs │ │ ├── Vector3F.cs │ │ ├── Vector3F.fp.cs │ │ ├── Vector3F.fp3.cs │ │ ├── Vector3F.v3.cs │ │ ├── Vector3I.cs │ │ ├── Vector3I.v3.cs │ │ ├── Vector3UI.cs │ │ ├── Vector3UI.v3.cs │ │ ├── Vector4F.cs │ │ ├── Vector4F.fp.cs │ │ ├── Vector4F.fp4.cs │ │ ├── Vector4I.cs │ │ └── Vector4UI.cs │ ├── Viewport.cs │ ├── ViewportF.cs │ └── ViewportUI.cs ├── TriangleSidedness.cs ├── Winding.cs ├── def_angles.json ├── def_colors.json ├── def_datatypes.json ├── def_matrices.json ├── def_quaternions.json ├── def_rectangles.json ├── def_vectors.json ├── packages.lock.json ├── t4_angles.cs ├── t4_angles.tt ├── t4_colors.cs ├── t4_colors.tt ├── t4_header.cs ├── t4_header.tt ├── t4_matrix.cs ├── t4_matrix.tt ├── t4_matrix2.cs ├── t4_matrix2.tt ├── t4_matrix2x3.cs ├── t4_matrix2x3.tt ├── t4_matrix3.cs ├── t4_matrix3.tt ├── t4_matrix3x2.cs ├── t4_matrix3x2.tt ├── t4_matrix4.cs ├── t4_matrix4.tt ├── t4_quaternions.cs ├── t4_quaternions.tt ├── t4_rectangles.cs ├── t4_rectangles.tt ├── t4_vector.cs ├── t4_vector.fp.cs ├── t4_vector.fp.tt ├── t4_vector.tt ├── t4_vector2.cs ├── t4_vector2.fp.cs ├── t4_vector2.fp.tt ├── t4_vector2.tt ├── t4_vector3.cs ├── t4_vector3.fp.cs ├── t4_vector3.fp.tt ├── t4_vector3.tt ├── t4_vector4.fp.cs └── t4_vector4.fp.tt ├── Molten.Utility ├── ArrayExtensions.cs ├── ArrayHelper.cs ├── BindableValue.cs ├── BitwiseHelper.cs ├── Cache │ ├── KeyedObjectCache.cs │ ├── ObjectCache.cs │ └── TypedObjectCache.cs ├── Collections │ ├── IReadOnlyThreadedList.cs │ ├── ObjectPool.cs │ ├── ThreadedHashSet.Structures.cs │ ├── ThreadedHashSet.cs │ ├── ThreadedList.Enumerator.cs │ ├── ThreadedList.cs │ ├── ThreadedQueue.Enumerator.cs │ ├── ThreadedQueue.cs │ └── ValueFreeRefList.cs ├── Comparers │ └── IntPtrComparer.cs ├── Delegates │ └── MoltenEventHandler.cs ├── EngineObject.cs ├── EngineUtil.cs ├── Hardware │ ├── DeviceID.cs │ └── DeviceVendor.cs ├── HashHelper.cs ├── Interlocker.cs ├── Molten.Utility.csproj ├── NativeUtil.cs ├── ReferencedObject.cs ├── ReflectionHelper.cs ├── ReorderMode.cs ├── StringHelper.cs ├── Timing.cs └── packages.lock.json ├── README.md ├── SRC └── test_texture.psd ├── _config.yml ├── docs ├── .gitignore ├── api │ ├── .gitignore │ ├── index.md │ └── toc.yml ├── articles │ ├── changelog.md │ ├── changelogs │ │ ├── CHANGELOG_0_2.md │ │ ├── CHANGELOG_0_3.md │ │ ├── CHANGELOG_0_4.md │ │ ├── CHANGELOG_0_5.md │ │ ├── CHANGELOG_0_6.md │ │ ├── CHANGELOG_0_7.md │ │ ├── CHANGELOG_0_7_1.md │ │ ├── CHANGELOG_0_7_2.md │ │ ├── CHANGELOG_0_7_3.md │ │ └── CHANGELOG_0_7_4.md │ └── toc.yml ├── docfx.json ├── images │ └── logo.svg ├── index.md ├── molten-template │ ├── ManagedReference.common.js │ ├── ManagedReference.extension.js │ ├── ManagedReference.html.primary.js │ ├── ManagedReference.html.primary.tmpl │ ├── RestApi.common.js │ ├── RestApi.extension.js │ ├── RestApi.html.primary.js │ ├── RestApi.html.primary.tmpl │ ├── UniversalReference.common.js │ ├── UniversalReference.extension.js │ ├── UniversalReference.html.primary.js │ ├── UniversalReference.html.primary.tmpl │ ├── common.js │ ├── conceptual.extension.js │ ├── conceptual.html.primary.js │ ├── conceptual.html.primary.tmpl │ ├── favicon.ico │ ├── layout │ │ └── _master.tmpl │ ├── logo.svg │ ├── partials │ │ ├── affix.tmpl.partial │ │ ├── breadcrumb.tmpl.partial │ │ ├── class.header.tmpl.partial │ │ ├── class.memberpage.tmpl.partial │ │ ├── class.tmpl.partial │ │ ├── classSubtitle.tmpl.partial │ │ ├── collection.tmpl.partial │ │ ├── customMREFContent.tmpl.partial │ │ ├── dd-li.tmpl.partial │ │ ├── enum.tmpl.partial │ │ ├── footer.tmpl.partial │ │ ├── head.tmpl.partial │ │ ├── item.tmpl.partial │ │ ├── li.tmpl.partial │ │ ├── logo.tmpl.partial │ │ ├── namespace.tmpl.partial │ │ ├── namespaceSubtitle.tmpl.partial │ │ ├── navbar.tmpl.partial │ │ ├── rest.child.tmpl.partial │ │ ├── rest.tmpl.partial │ │ ├── scripts.tmpl.partial │ │ ├── searchResults.tmpl.partial │ │ ├── title.tmpl.partial │ │ ├── toc.tmpl.partial │ │ └── uref │ │ │ ├── class.header.tmpl.partial │ │ │ ├── class.tmpl.partial │ │ │ ├── enum.tmpl.partial │ │ │ ├── inheritance.tmpl.partial │ │ │ ├── namespace.tmpl.partial │ │ │ └── parameters.tmpl.partial │ ├── search-stopwords.json │ ├── styles │ │ ├── docfx.css │ │ ├── docfx.js │ │ ├── docfx.vendor.min.css │ │ ├── docfx.vendor.min.css.map │ │ ├── docfx.vendor.min.js │ │ ├── docfx.vendor.min.js.map │ │ ├── glyphicons-halflings-regular-ACNUA6UY.ttf │ │ ├── glyphicons-halflings-regular-JOUF32XT.woff │ │ ├── glyphicons-halflings-regular-PIHUWCJO.eot │ │ ├── glyphicons-halflings-regular-QXYEM3FU.svg │ │ ├── glyphicons-halflings-regular-W4DYDFZM.woff2 │ │ ├── main.css │ │ ├── main.js │ │ ├── search-worker.min.js │ │ └── search-worker.min.js.map │ ├── toc.extension.js │ ├── toc.html.js │ ├── toc.html.tmpl │ └── token.json └── toc.yml └── index.html /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "nuget" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "daily" 12 | -------------------------------------------------------------------------------- /.github/funding.yml: -------------------------------------------------------------------------------- 1 | github: [syncaidius] -------------------------------------------------------------------------------- /Generate git changelog.txt: -------------------------------------------------------------------------------- 1 | git log --pretty="[%h] 2 | %s 3 | %b" --after="01/11/2022" > CHANGELOG_0_2.md -------------------------------------------------------------------------------- /Images/cursor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Images/cursor.png -------------------------------------------------------------------------------- /Images/logo_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Images/logo_1024.png -------------------------------------------------------------------------------- /Images/logo_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Images/logo_128.png -------------------------------------------------------------------------------- /Images/logo_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Images/logo_256.png -------------------------------------------------------------------------------- /Images/logo_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Images/logo_512.png -------------------------------------------------------------------------------- /Images/logo_512_bc6h.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Images/logo_512_bc6h.dds -------------------------------------------------------------------------------- /Images/logo_512_bc7.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Images/logo_512_bc7.dds -------------------------------------------------------------------------------- /Images/logo_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Images/logo_64.png -------------------------------------------------------------------------------- /Images/logo_dark_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Images/logo_dark_black.png -------------------------------------------------------------------------------- /Images/logo_dark_transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Images/logo_dark_transparent.png -------------------------------------------------------------------------------- /Images/logo_dark_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Images/logo_dark_white.png -------------------------------------------------------------------------------- /Images/logo_light_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Images/logo_light_black.png -------------------------------------------------------------------------------- /Images/logo_light_transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Images/logo_light_transparent.png -------------------------------------------------------------------------------- /Images/logo_light_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Images/logo_light_white.png -------------------------------------------------------------------------------- /Images/logo_social.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Images/logo_social.png -------------------------------------------------------------------------------- /Images/src/cursor.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Images/src/cursor.psd -------------------------------------------------------------------------------- /Images/tex_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Images/tex_512.png -------------------------------------------------------------------------------- /Images/tex_test_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Images/tex_test_512.png -------------------------------------------------------------------------------- /Libraries/Windows/dxcompiler.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Libraries/Windows/dxcompiler.dll -------------------------------------------------------------------------------- /Molten.Audio.OpenAL/Interop.cs: -------------------------------------------------------------------------------- 1 | using Silk.NET.OpenAL; 2 | 3 | namespace Molten.Audio.OpenAL; 4 | 5 | internal static class InteropExtensions 6 | { 7 | public static BufferFormat ToApi(this AudioFormat format) 8 | { 9 | return (BufferFormat)format; 10 | } 11 | 12 | public static AudioFormat FromApi(this BufferFormat format) 13 | { 14 | return (AudioFormat)format; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Molten.Benchmarks/Benchmarks.cs: -------------------------------------------------------------------------------- 1 | using BenchmarkDotNet.Reports; 2 | using BenchmarkDotNet.Running; 3 | 4 | namespace Molten.Benchmarks; 5 | 6 | public class Benchmarks 7 | { 8 | static void Main(string[] args) 9 | { 10 | Summary[] summary = BenchmarkRunner.Run(typeof(Benchmarks).Assembly); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Molten.Benchmarks/Molten.Benchmarks.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | True 9 | Molten.Benchmarks.Benchmarks 10 | False 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Molten.Engine.Android/Resources/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Hello World, Click Me! 3 | Molten.Platform.Android 4 | 5 | -------------------------------------------------------------------------------- /Molten.Engine.Windows/Input/WinWParamXButton.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Input; 2 | 3 | /// 4 | /// See high-order wParam information here: https://docs.microsoft.com/en-us/windows/win32/inputdev/WM-XBUTTONUP 5 | /// 6 | [Flags] 7 | public enum WinWParamXButton 8 | { 9 | None = 0, 10 | 11 | XButton1 = 0x0001, 12 | 13 | XButton2 = 0x0002, 14 | } 15 | -------------------------------------------------------------------------------- /Molten.Engine.Windows/LoggerExtensions.cs: -------------------------------------------------------------------------------- 1 | using Silk.NET.Core.Native; 2 | 3 | namespace Molten; 4 | 5 | public static class LoggerExtensions 6 | { 7 | public static bool CheckResult(this Logger log, HResult r, Func msg = null) 8 | { 9 | if (r.IsFailure) 10 | { 11 | string message = msg?.Invoke() ?? "N/A"; 12 | log.Error($" - [HRESULT {r.Value}] Code: {r.Code} -- Severity: {r.Severity} -- Facility: {r.Value} -- Message: {message}"); 13 | return false; 14 | } 15 | 16 | return true; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Molten.Engine.Windows/Win32/NativeMessage.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace Molten.Windows32; 4 | 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct NativeMessage 7 | { 8 | public IntPtr handle; 9 | public uint msg; 10 | public IntPtr wParam; 11 | public IntPtr lParam; 12 | public uint time; 13 | public Vector2I p; 14 | } 15 | -------------------------------------------------------------------------------- /Molten.Engine.Windows/Win32/TextMetric.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace Molten.Windows32; 4 | 5 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] 6 | public struct TextMetric 7 | { 8 | public int tmHeight; 9 | public int tmAscent; 10 | public int tmDescent; 11 | public int tmInternalLeading; 12 | public int tmExternalLeading; 13 | public int tmAveCharWidth; 14 | public int tmMaxCharWidth; 15 | public int tmWeight; 16 | public int tmOverhang; 17 | public int tmDigitizedAspectX; 18 | public int tmDigitizedAspectY; 19 | public char tmFirstChar; 20 | public char tmLastChar; 21 | public char tmDefaultChar; 22 | public char tmBreakChar; 23 | public byte tmItalic; 24 | public byte tmUnderlined; 25 | public byte tmStruckOut; 26 | public byte tmPitchAndFamily; 27 | public byte tmCharSet; 28 | } 29 | -------------------------------------------------------------------------------- /Molten.Engine.Windows/Win32/Win32.IO.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | using System.Text; 3 | 4 | namespace Molten.Windows32; 5 | 6 | public class Win32IO 7 | { 8 | internal Win32IO() { } 9 | 10 | public string GetShortPathName(string longPath) 11 | { 12 | StringBuilder shortPath = new StringBuilder(longPath.Length + 1); 13 | 14 | if (0 == GetShortPathName(longPath, shortPath, shortPath.Capacity)) 15 | { 16 | return longPath; 17 | } 18 | 19 | return shortPath.ToString(); 20 | } 21 | 22 | [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] 23 | private static extern int GetShortPathName(string path, StringBuilder shortPath, int shortPathLength); 24 | } 25 | -------------------------------------------------------------------------------- /Molten.Engine.Windows/Win32/Win32.OS.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Windows32; 2 | 3 | public class Win32OS 4 | { 5 | internal Win32OS() { } 6 | 7 | /// Gets the friendly name of the OS the application is currently running on. 8 | /// 9 | public string GetName() 10 | { 11 | return Win32.GetValue("Win32_OperatingSystem", "Caption"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Molten.Engine.Windows/Win32/Win32.Structures.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace Molten.Windows32; 4 | 5 | public static partial class Win32 6 | { 7 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] 8 | public class MemoryStatusEx 9 | { 10 | public uint dwLength; 11 | public uint dwMemoryLoad; 12 | public ulong TotalPhysical; 13 | public ulong AvailablePhysical; 14 | public ulong TotalPageFile; 15 | public ulong AvailablePageFile; 16 | public ulong TotalVirtual; 17 | public ulong AvailableVirtual; 18 | public ulong AvailableExtendedVirtual; 19 | 20 | public MemoryStatusEx() 21 | { 22 | this.dwLength = (uint)Marshal.SizeOf(typeof(MemoryStatusEx)); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Molten.Engine.Windows/Win32/WndMenuCharType.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Windows32; 2 | 3 | public enum WndMenuCharType 4 | { 5 | /// 6 | /// Informs the system that it should discard the character the user pressed and create a short beep on the system speaker. 7 | /// 8 | MNC_IGNORE = 0, 9 | 10 | /// 11 | /// Informs the system that it should close the active menu. 12 | /// 13 | MNC_CLOSE = 1, 14 | 15 | /// 16 | /// Informs the system that it should choose the item specified in the low-order word of the return value. The owner window receives a WM_COMMAND message. 17 | /// 18 | MNC_EXECUTE = 2, 19 | 20 | /// 21 | /// Informs the system that it should select the item specified in the low-order word of the return value. 22 | /// 23 | MNC_SELECT = 3, 24 | } 25 | -------------------------------------------------------------------------------- /Molten.Engine.Windows/Win32/WndPowerEventType.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Windows32; 2 | 3 | // Generate enum which encapsulates win32 power management events. 4 | public enum WndPowerEventType 5 | { 6 | PBT_APMQUERYSUSPEND = 0x0000, 7 | 8 | PBT_APMPOWERSTATUSCHANGE = 0x000A, 9 | 10 | PBT_APMRESUMEAUTOMATIC = 0x0012, 11 | 12 | PBT_APMRESUMECRITICAL = 0x0006, 13 | 14 | PBT_APMRESUMESUSPEND = 0x0007, 15 | 16 | PBT_APMSUSPEND = 0x0004, 17 | 18 | PBT_POWERSETTINGCHANGE = 0x8013, 19 | } 20 | -------------------------------------------------------------------------------- /Molten.Engine.Windows/Win32/WndSizeType.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Windows32; 2 | 3 | public enum WndSizeType 4 | { 5 | /// 6 | /// The window has been resized, but neither the SIZE_MINIMIZED nor SIZE_MAXIMIZED value applies. 7 | /// 8 | SIZE_RESTORED = 0, 9 | 10 | /// 11 | /// The window has been minimized. 12 | /// 13 | SIZE_MINIMIZED = 1, 14 | 15 | /// 16 | /// The window has been maximized. 17 | /// 18 | SIZE_MAXIMIZED = 2, 19 | 20 | /// 21 | /// Message is sent to all pop-up windows when some other window has been restored to its former size. 22 | /// 23 | SIZE_MAXSHOW = 3, 24 | 25 | /// 26 | /// Message is sent to all pop-up windows when some other window is maximized. 27 | /// 28 | SIZE_MAXHIDE = 4, 29 | } 30 | -------------------------------------------------------------------------------- /Molten.Engine/Assets/gbuffer_compose.hlsl: -------------------------------------------------------------------------------- 1 | #include "sprite.hlsl" 2 | 3 | Texture2D mapLighting; 4 | Texture2D mapEmissive; 5 | 6 | float4 PS_Compose( PS_IN input ) : SV_Target 7 | { 8 | float4 col = mapDiffuse.Sample(diffuseSampler, input.uv); 9 | float4 light = mapLighting.Sample(diffuseSampler, input.uv.xy); 10 | float4 emissive = mapEmissive.Sample(diffuseSampler, input.uv.xy); 11 | 12 | return (col * light) + emissive; 13 | } 14 | -------------------------------------------------------------------------------- /Molten.Engine/Assets/skybox.hlsl: -------------------------------------------------------------------------------- 1 | float4x4 wvp; 2 | 3 | TextureCube mapSky; 4 | SamplerState skySampler; 5 | 6 | struct PS_IN 7 | { 8 | float4 Pos : SV_POSITION; 9 | float3 uv : TEXCOORD; 10 | }; 11 | 12 | PS_IN VS(float3 pos : POSITION) 13 | { 14 | PS_IN output = (PS_IN)0; 15 | 16 | //Output xyww instead of xyzw to ensure Z is always 1, the most distant from the camera. 17 | output.Pos = mul(float4(pos, 1.0f), wvp); 18 | output.uv = pos; 19 | 20 | return output; 21 | } 22 | 23 | 24 | float4 PS(PS_IN input) : SV_Target 25 | { 26 | return mapSky.Sample(skySampler, input.uv); 27 | } -------------------------------------------------------------------------------- /Molten.Engine/Assets/skybox.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "skybox-default", 4 | "author": "James Yarwood", 5 | "description": "The default material for rendering static skyboxes.", 6 | "file": "skybox.hlsl", 7 | "passes": [ 8 | { 9 | "name": "main", 10 | "iterations": 1, 11 | "entry": { 12 | "vertex": "VS", 13 | "fragment": "PS" 14 | }, 15 | "parameters": { 16 | "rasterizer": "NoCulling", 17 | "IsDepthEnabled": true, 18 | "DepthWriteEnabled": true, 19 | "WritePermission": "ReadOnly", 20 | "DepthComparison": "LessEqual", 21 | "formats": { 22 | "os0": "R8G8B8A8_UNorm", 23 | "depth": "R24G8" 24 | } 25 | } 26 | } 27 | ] 28 | } 29 | ] -------------------------------------------------------------------------------- /Molten.Engine/Audio/AudioDeviceException.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Audio; 2 | 3 | public class AudioDeviceException : Exception 4 | { 5 | public AudioDeviceException(IAudioDevice device, string message) : base(message) 6 | { 7 | DeviceName = device.Name; 8 | DeviceType = device.DeviceType; 9 | } 10 | 11 | /// 12 | /// Gets the name of the device that caused the exception. 13 | /// 14 | public string DeviceName { get; } 15 | 16 | /// 17 | /// Gets the type of the device that caused the exception. 18 | /// 19 | public AudioDeviceType DeviceType { get; } 20 | } 21 | -------------------------------------------------------------------------------- /Molten.Engine/Audio/AudioDeviceType.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Audio; 2 | 3 | /// 4 | /// Represents the type of a . 5 | /// 6 | public enum AudioDeviceType 7 | { 8 | /// 9 | /// The device handles audio input, such as a microphone or line-in source. 10 | /// 11 | Input = 0, 12 | 13 | /// 14 | /// The device handles audio output, such as speakers or headphones. 15 | /// 16 | Output = 1, 17 | } 18 | -------------------------------------------------------------------------------- /Molten.Engine/Audio/AudioFormat.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Audio; 2 | 3 | public enum AudioFormat 4 | { 5 | // 6 | // Summary: 7 | // 1 Channel, 8 bits per sample. 8 | Mono8 = 4352, 9 | // 10 | // Summary: 11 | // 1 Channel, 16 bits per sample. 12 | Mono16, 13 | // 14 | // Summary: 15 | // 2 Channels, 8 bits per sample each. 16 | Stereo8, 17 | // 18 | // Summary: 19 | // 2 Channels, 16 bits per sample each. 20 | Stereo16 21 | } 22 | -------------------------------------------------------------------------------- /Molten.Engine/Audio/AudioPlaybackState.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Audio; 2 | 3 | public enum AudioPlaybackState 4 | { 5 | /// 6 | /// The instance is stopped. 7 | /// 8 | Stopped = 0, 9 | 10 | /// 11 | /// The instance is playing. 12 | /// 13 | Playing = 1, 14 | 15 | /// 16 | /// The instance was paused. 17 | /// 18 | Paused = 2, 19 | 20 | /// 21 | /// The instance was disposed. 22 | /// 23 | Disposed = 3, 24 | } 25 | -------------------------------------------------------------------------------- /Molten.Engine/Audio/IAudioOutput.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Audio; 2 | 3 | public interface IAudioOutput : IAudioDevice 4 | { 5 | /// 6 | /// Creates a new which can be pre-buffered with a . 7 | /// 8 | /// The containing the data to be pre-buffered. Null to create an empty source. 9 | /// 10 | ISoundSource CreateSoundSource(AudioBuffer dataBuffer = null); 11 | } 12 | -------------------------------------------------------------------------------- /Molten.Engine/Audio/ISoundEmitter.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Audio; 2 | 3 | /// 4 | /// Represents an implementation of an audio emitter. 5 | /// 6 | public interface ISoundEmitter : IDisposable 7 | { 8 | } 9 | -------------------------------------------------------------------------------- /Molten.Engine/Components/Audio/SoundListenerComponent.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Audio; 2 | 3 | public class SoundListenerComponent : SceneComponent 4 | { 5 | protected override void OnDispose(bool immediate) 6 | { 7 | throw new NotImplementedException(); 8 | } 9 | 10 | public override void OnUpdate(Timing time) 11 | { 12 | base.OnUpdate(time); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Molten.Engine/Content/ContentException.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | public class ContentException : Exception 4 | { 5 | internal ContentException(string message) : base(message) { } 6 | } 7 | -------------------------------------------------------------------------------- /Molten.Engine/Content/ContentFile.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Concurrent; 2 | 3 | namespace Molten; 4 | 5 | /// 6 | /// Represents a file from which one or more instances are attached. One file may contain multiple assets or varying types. 7 | /// 8 | internal class ContentFile 9 | { 10 | internal ConcurrentDictionary Handles { get; } = new ConcurrentDictionary(); 11 | 12 | internal ContentHandle GetHandle(Type contentType) 13 | { 14 | Handles.TryGetValue(contentType, out ContentHandle handle); 15 | return handle; 16 | } 17 | 18 | internal bool AddHandle(ContentHandle handle) 19 | { 20 | return Handles.TryAdd(handle.ContentType, handle); 21 | } 22 | 23 | internal bool Unload(ContentHandle handle) 24 | { 25 | return Handles.TryRemove(handle.ContentType, out handle); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Molten.Engine/Content/ContentHandleType.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | /// 4 | /// Represents the type of operation performed by a . 5 | /// 6 | public enum ContentHandleType 7 | { 8 | /// 9 | /// The handle is for an asset that is to be, or already has been loaded. 10 | /// 11 | Load = 0, 12 | 13 | /// 14 | /// The handle is for an asset to be saved to a location. 15 | /// 16 | Save = 1, 17 | 18 | /// 19 | /// Deletes an asset. 20 | /// 21 | Delete = 2, 22 | } 23 | -------------------------------------------------------------------------------- /Molten.Engine/Content/ContentLoadBatchStatus.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | public enum ContentLoadBatchStatus 4 | { 5 | NotDispatched = 0, 6 | 7 | Dispatched = 1, 8 | 9 | Completed = 2, 10 | } 11 | -------------------------------------------------------------------------------- /Molten.Engine/Content/ContentNotLoadedException.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | public class ContentNotLoadedException : Exception 4 | { 5 | public ContentNotLoadedException(string message) : base(message) { } 6 | } 7 | -------------------------------------------------------------------------------- /Molten.Engine/Content/ContentReloadAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | /// 4 | /// Used to determine how a content asset behaves when reloaded after changes. 5 | /// 6 | public class ContentReloadAttribute : Attribute 7 | { 8 | /// 9 | /// Creates a new instance of . 10 | /// 11 | /// If true, the content should be re-instantiated if reloaded. 12 | public ContentReloadAttribute(bool recreate) 13 | { 14 | Recreate = recreate; 15 | } 16 | 17 | /// 18 | /// Gets whether the content should be re-instantiated if it is reloaded. 19 | /// 20 | public bool Recreate { get; } 21 | } 22 | -------------------------------------------------------------------------------- /Molten.Engine/Content/Parameters/ContentParameters.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | public abstract class ContentParameters : ICloneable 4 | { 5 | public int PartCount = 1; 6 | 7 | public abstract object Clone(); 8 | } 9 | -------------------------------------------------------------------------------- /Molten.Engine/Content/Parameters/ShaderParameters.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | public class ShaderParameters : ContentParameters 4 | { 5 | public string MaterialName = ""; 6 | 7 | public override object Clone() 8 | { 9 | return new ShaderParameters() 10 | { 11 | MaterialName = MaterialName, 12 | PartCount = PartCount 13 | }; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Molten.Engine/Content/Parameters/SpriteFontParameters.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | public class SpriteFontParameters : ContentParameters 4 | { 5 | public float FontSize { get; set; } = 16; 6 | 7 | public override object Clone() 8 | { 9 | return new SpriteFontParameters() 10 | { 11 | FontSize = FontSize, 12 | PartCount = PartCount 13 | }; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Molten.Engine/Content/Parameters/StringParameters.cs: -------------------------------------------------------------------------------- 1 | using System.Text; 2 | 3 | namespace Molten; 4 | 5 | public class StringParameters : ContentParameters 6 | { 7 | public bool IsBinary { get; set; } = false; 8 | 9 | public Encoding Encoding { get; set; } = Encoding.UTF8; 10 | 11 | public string MultipartDelimiter { get; set; } = " "; 12 | 13 | public override object Clone() 14 | { 15 | return new StringParameters() 16 | { 17 | MultipartDelimiter = MultipartDelimiter, 18 | Encoding = Encoding, 19 | PartCount = PartCount 20 | }; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Molten.Engine/Content/Parameters/TextureParameters.cs: -------------------------------------------------------------------------------- 1 | using Molten.Graphics; 2 | 3 | namespace Molten; 4 | 5 | public class TextureParameters : ContentParameters 6 | { 7 | public bool GenerateMipmaps = false; 8 | 9 | public DDSFormat? BlockCompressionFormat = null; 10 | 11 | public override object Clone() 12 | { 13 | return new TextureParameters() 14 | { 15 | GenerateMipmaps = GenerateMipmaps, 16 | BlockCompressionFormat = BlockCompressionFormat, 17 | PartCount = PartCount 18 | }; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Molten.Engine/Font/FontLocaFormat.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Font; 2 | 3 | /// The expected format of the index-to-location (loca) table, if present. 4 | public enum FontLocaFormat 5 | { 6 | UnsignedInt16 = 0, 7 | 8 | UnsignedInt32 = 1, 9 | } 10 | -------------------------------------------------------------------------------- /Molten.Engine/Font/FontPlatform.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Font; 2 | 3 | public enum FontPlatform : ushort 4 | { 5 | Unicode = 0, 6 | 7 | Macintosh = 1, 8 | 9 | ISO = 2, 10 | 11 | Windows = 3, 12 | 13 | Custom = 4, 14 | } 15 | -------------------------------------------------------------------------------- /Molten.Engine/Font/FontTableTagAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Font; 2 | 3 | public class FontTableTagAttribute : Attribute 4 | { 5 | public FontTableTagAttribute(string tag, params string[] dependencies) 6 | { 7 | Tag = tag; 8 | Dependencies = dependencies ?? new string[0]; 9 | } 10 | 11 | public string Tag { get; private set; } 12 | 13 | public string[] Dependencies { get; private set; } 14 | } 15 | -------------------------------------------------------------------------------- /Molten.Engine/Font/FontWidthClass.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Font; 2 | 3 | /// 4 | /// Indicates a relative change from the normal aspect ratio (width to height ratio) as specified by a font designer for the glyphs in a font. 5 | /// 6 | public enum FontWidthClass : ushort 7 | { 8 | None = 0, 9 | 10 | UltraCondensed = 1, 11 | 12 | ExtraCondensed = 2, 13 | 14 | Condensed = 3, 15 | 16 | SemiCondensed = 4, 17 | 18 | Medium = 5, 19 | 20 | SemiExpanded = 6, 21 | 22 | Expanded = 7, 23 | 24 | ExtraExpanded = 8, 25 | 26 | UltraExpanded = 9, 27 | } 28 | -------------------------------------------------------------------------------- /Molten.Engine/Font/GlyphClass.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Font; 2 | 3 | /// See: https://www.microsoft.com/typography/otspec/gdef.htm - "Glyph Class Definition Table" 4 | public enum GlyphClass : ushort 5 | { 6 | Zero = 0, 7 | 8 | /// Base glyph (single character, spacing glyph) 9 | Base = 1, 10 | 11 | /// Ligature glyph (multiple character, spacing glyph) 12 | Ligature = 2, 13 | 14 | /// Mark glyph (non-spacing combining glyph) 15 | Mark = 3, 16 | 17 | /// Component glyph (part of single character, spacing glyph) 18 | Component = 4, 19 | } 20 | -------------------------------------------------------------------------------- /Molten.Engine/Font/GlyphMarkClass.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Font; 2 | 3 | public enum GlyphMarkClass : ushort 4 | { 5 | Zero = 0, 6 | 7 | Top = 1, 8 | 9 | Bottom = 2, 10 | } 11 | -------------------------------------------------------------------------------- /Molten.Engine/Font/GlyphMetrics.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Font; 2 | 3 | public class GlyphMetrics 4 | { 5 | public int AdvanceWidth { get; internal set; } 6 | 7 | public int LeftSideBearing { get; internal set; } 8 | 9 | public int RightSideBearing { get; internal set; } 10 | 11 | public int TopSideBearing { get; internal set; } 12 | 13 | public int BottomSideBearing { get; internal set; } 14 | } 15 | -------------------------------------------------------------------------------- /Molten.Engine/Font/MacStyleFlags.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Font; 2 | 3 | [Flags] 4 | /// A font's mac-style. 5 | public enum MacStyleFlags : ushort 6 | { 7 | None = 0, 8 | 9 | Bold = 1, 10 | 11 | Italic = 2, 12 | 13 | Underline = 4, 14 | 15 | Outline = 8, 16 | 17 | Shadow = 16, 18 | 19 | Condensed = 32, 20 | 21 | Extended = 64, 22 | 23 | Reserved7 = 128, 24 | 25 | Reserved8 = 256, 26 | 27 | Reserved9 = 512, 28 | 29 | Reserved10 = 1024, 30 | 31 | Reserved11 = 2048, 32 | 33 | Reserved12 = 4096, 34 | 35 | Reserved13 = 8192, 36 | 37 | Reserved14 = 16384, 38 | 39 | Reserved15 = 32768, 40 | } 41 | -------------------------------------------------------------------------------- /Molten.Engine/Font/OffsetTable.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Font; 2 | 3 | public class OffsetTable 4 | { 5 | public ushort MajorVersion { get; internal set; } 6 | 7 | public ushort MinorVersion { get; internal set; } 8 | 9 | public ushort NumTables { get; internal set; } 10 | 11 | public ushort SearchRange { get; internal set; } 12 | 13 | public ushort EntrySelector { get; internal set; } 14 | 15 | public ushort RangeShift { get; internal set; } 16 | } 17 | -------------------------------------------------------------------------------- /Molten.Engine/Font/SubTables/AlternateSetTable.cs: -------------------------------------------------------------------------------- 1 | using Molten.IO; 2 | 3 | namespace Molten.Font; 4 | 5 | public class AlternateSetTable : FontSubTable 6 | { 7 | /// 8 | /// Gets an array of glyph IDs. 9 | /// 10 | public ushort[] GlyphIDs { get; internal set; } 11 | 12 | internal AlternateSetTable(EnhancedBinaryReader reader, Logger log, IFontTable parent, long offset) : 13 | base(reader, log, parent, offset) 14 | { 15 | ushort glyphCount = reader.ReadUInt16(); 16 | GlyphIDs = reader.ReadArray(glyphCount); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Molten.Engine/Font/SubTables/AttachPointTable.cs: -------------------------------------------------------------------------------- 1 | using Molten.IO; 2 | 3 | namespace Molten.Font; 4 | 5 | /// 6 | /// 7 | /// 8 | public class AttachPointTable : FontSubTable 9 | { 10 | /// Gets an array of contour point indices for a glyph. 11 | public ushort[] ContourPointIndices { get; internal set; } 12 | 13 | internal AttachPointTable(EnhancedBinaryReader reader, Logger log, IFontTable parent, ushort offset) : 14 | base(reader, log, parent, offset) 15 | { 16 | ushort pointCount = reader.ReadUInt16(); 17 | ContourPointIndices = reader.ReadArray(pointCount); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Molten.Engine/Font/SubTables/Kern/KerningPair.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Font; 2 | public class KerningPair 3 | { 4 | /// 5 | /// Gets the glyph index (ID) for the left-hand glyph in the kerning pair. 6 | /// 7 | public ushort Left { get; internal set; } 8 | 9 | /// 10 | /// Gets the glyph index (ID) for the right-hand glyph in the kerning pair. 11 | /// 12 | public ushort Right { get; internal set; } 13 | 14 | /// 15 | /// Gets the kerning value for the above pair, in FUnits. 16 | /// If this value is greater than zero, the characters will be moved apart. If this value is less than zero, the character will be moved closer together. 17 | /// 18 | public short Value { get; internal set; } 19 | } 20 | -------------------------------------------------------------------------------- /Molten.Engine/Font/SubTables/SequenceTable.cs: -------------------------------------------------------------------------------- 1 | using Molten.IO; 2 | 3 | namespace Molten.Font; 4 | 5 | public class SequenceTable : FontSubTable 6 | { 7 | /// 8 | /// Gets an array of glyph IDs. 9 | /// 10 | public ushort[] GlyphIDs { get; internal set; } 11 | 12 | internal SequenceTable(EnhancedBinaryReader reader, Logger log, IFontTable parent, long offset) : 13 | base(reader, log, parent, offset) 14 | { 15 | ushort glyphCount = reader.ReadUInt16(); 16 | GlyphIDs = reader.ReadArray(glyphCount); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Molten.Engine/Font/Tables/Cvt.cs: -------------------------------------------------------------------------------- 1 | using Molten.IO; 2 | 3 | namespace Molten.Font; 4 | 5 | /// Control value table (CVT). 6 | /// See: https://docs.microsoft.com/en-us/typography/opentype/spec/cvt 7 | [FontTableTag("cvt")] 8 | public class Cvt : FontTable 9 | { 10 | /// Gets an array of values referenceable by instructions (such as those in a 'prep' table). 11 | public int[] Values { get; private set; } 12 | 13 | internal override void Read(EnhancedBinaryReader reader, TableHeader header, Logger log, FontTableList dependencies) 14 | { 15 | uint valueCount = header.Length / 2; 16 | short[] shortValues = reader.ReadArray((int)valueCount); 17 | Values = Array.ConvertAll(shortValues, item => (int)item); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Molten.Engine/Font/Tables/Fpgm.cs: -------------------------------------------------------------------------------- 1 | using Molten.IO; 2 | 3 | namespace Molten.Font; 4 | 5 | /// The font program table (fpgm). 6 | /// See: https://docs.microsoft.com/en-us/typography/opentype/spec/fpgm 7 | [FontTableTag("fpgm")] 8 | public class Fpgm : FontTable 9 | { 10 | /// Gets the table's font program bytecode. 11 | public byte[] ByteCode { get; private set; } 12 | 13 | internal override void Read(EnhancedBinaryReader reader, TableHeader header, Logger log, FontTableList dependencies) 14 | { 15 | ByteCode = reader.ReadBytes((int)header.Length); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Molten.Engine/Font/Tables/GPOS.EntryExitRecord.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Font; 2 | 3 | public partial class GPOS 4 | { 5 | public class EntryExitRecord 6 | { 7 | public AnchorTable EntryAnchor { get; internal set; } 8 | 9 | public AnchorTable ExitAnchor { get; internal set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Molten.Engine/GameRunState.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | public enum GameRunState 4 | { 5 | Started = 0, 6 | 7 | Paused = 1, 8 | 9 | Running = 2, 10 | 11 | Exiting = 4, 12 | 13 | Exited = 5, 14 | } 15 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/AntiAliasLevel.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public enum AntiAliasLevel : byte 4 | { 5 | Invalid = 0, 6 | 7 | None = 1, 8 | 9 | X2 = 2, 10 | 11 | X4 = 4, 12 | 13 | X8 = 8, 14 | 15 | X16 = 16, 16 | } 17 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Exceptions/DisplayOutputException.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public class DisplayOutputException : GpuDeviceException 4 | { 5 | public DisplayOutputException(IDisplayOutput output, string message) : base(output.Device, message) 6 | { 7 | Output = output; 8 | } 9 | 10 | public IDisplayOutput Output { get; private set; } 11 | } 12 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Exceptions/GpuCommandListException.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public class GpuCommandListException : Exception 4 | { 5 | public GpuCommandListException(GpuCommandList list, string message) : base(message) 6 | { 7 | List = list; 8 | } 9 | 10 | public GpuCommandList List { get; } 11 | } 12 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Exceptions/GpuDeviceException.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public class GpuDeviceException : Exception 4 | { 5 | public GpuDeviceException(GpuDevice device, string message) : base(message) 6 | { 7 | Device = device; 8 | } 9 | 10 | public GpuDevice Device { get; private set; } 11 | } 12 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Exceptions/GpuFormatException.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public class GpuFormatException : Exception 4 | { 5 | public GpuFormatException(GpuResourceFormat format, string msg) : base(msg) { } 6 | 7 | public GpuFormatException(GpuResourceFormat format) : base($"The provided format ({format}) is incompatible.") { } 8 | 9 | public GpuFormatException(IList formats) : base($"The provided formats ({string.Join(", ", formats)}) is incompatible.") { } 10 | } 11 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Exceptions/GpuObjectException.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public class GpuObjectException : Exception 4 | { 5 | public GpuObjectException(GpuObject obj, string message) : base(message) 6 | { 7 | Object = obj; 8 | } 9 | 10 | public GpuObject Object { get; private set; } 11 | } 12 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Exceptions/GpuResourceException.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public class GpuResourceException : Exception 4 | { 5 | public GpuResourceException(GpuResource resource, string message) : base(message) 6 | { 7 | Resource = resource; 8 | } 9 | 10 | public GpuResource Resource { get; } 11 | 12 | public GpuResourceFlags Flags => Resource?.Flags ?? GpuResourceFlags.None; 13 | } 14 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Exceptions/GpuStrideException.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | public class GpuStrideException : Exception 3 | { 4 | public GpuStrideException(uint stride, string message) : base(message) 5 | { 6 | Stride = stride; 7 | } 8 | 9 | public uint Stride { get; } 10 | } 11 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Exceptions/ResourceCopyException.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public class ResourceCopyException : Exception 4 | { 5 | public ResourceCopyException(GpuResource source, GpuResource destination) 6 | : this(source, destination, "Invalid copy operation.") 7 | { } 8 | 9 | public ResourceCopyException(GpuResource source, GpuResource destination, string message) 10 | : base(message) 11 | { 12 | Source = source; 13 | Destination = destination; 14 | } 15 | 16 | /// 17 | /// The source texture. 18 | /// 19 | public GpuResource Source { get; private set; } 20 | 21 | /// 22 | /// The destination texture. 23 | /// 24 | public GpuResource Destination { get; private set; } 25 | } 26 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/FrameBufferMode.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public enum FrameBufferMode 4 | { 5 | Default = 0, 6 | 7 | Double = 1, 8 | 9 | Triple = 2, 10 | 11 | Quad = 3, 12 | } 13 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/GpuDepthWritePermission.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// Represents the mode to apply when setting a depth surface. 4 | public enum GpuDepthWritePermission 5 | { 6 | /// The depth buffer can be read and written. 7 | Enabled = 0, 8 | 9 | /// The depth buffer is disabled (cannot be read from or written to). 10 | Disabled = 1, 11 | 12 | /// The depth buffer cannot be written to, only read from. 13 | ReadOnly = 2, 14 | } 15 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/GpuTaskBank.cs: -------------------------------------------------------------------------------- 1 | using Molten.Collections; 2 | 3 | namespace Molten.Graphics; 4 | internal abstract class GpuTaskBank 5 | { 6 | internal abstract void Process(GpuCommandList cmd, uint taskIndex); 7 | 8 | internal int BankIndex { get; init; } 9 | } 10 | 11 | internal class GpuTaskBank : GpuTaskBank 12 | where T : struct, IGpuTask 13 | { 14 | ValueFreeRefList _tasks = new(); 15 | 16 | internal GpuTaskBank(int bankIndex) 17 | { 18 | BankIndex = bankIndex; 19 | } 20 | 21 | internal override void Process(GpuCommandList cmd, uint taskIndex) 22 | { 23 | ref T task = ref _tasks[taskIndex]; 24 | bool success = T.Process(cmd, ref task); 25 | task.Complete(success); 26 | _tasks.RemoveAt(taskIndex); 27 | } 28 | 29 | internal uint Enqueue(ref T task) 30 | { 31 | return _tasks.Add(ref task); 32 | } 33 | } -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Hardware/Capabilities/CommandListSupport.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public enum CommandListSupport 4 | { 5 | /// 6 | /// No support available for command lists/deferred contexts. 7 | /// 8 | None = 0, 9 | 10 | /// 11 | /// The hardware doesn't support command lists/deferred contexts and the feature will be emulated. 12 | /// 13 | Emulated = 1, 14 | 15 | /// 16 | /// The hardware fully supports DirectX 11 command lists/deferred contexts. 17 | /// 18 | Supported = 2, 19 | } 20 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Hardware/Capabilities/MeshShaderCapabilities.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | public class MeshShaderCapabilities : ShaderStageCapabilities 3 | { 4 | public bool PipelineStatsSupported { get; set; } 5 | 6 | public bool PerPrimitiveShadingRate { get; set; } 7 | } 8 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Hardware/Capabilities/VertexBufferCapabilities.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// 4 | /// Represents the capabilities and limits of a type of buffer resource. 5 | /// 6 | public class VertexBufferCapabilities : BufferCapabilities 7 | { 8 | internal VertexBufferCapabilities() { } 9 | 10 | /// 11 | /// Gets or sets the maximum number of elements per vertex in the buffer. 12 | /// 13 | public uint MaxElementsPerVertex { get; set; } 14 | 15 | /// 16 | /// Gets or sets the maximum byte size of a single vertex in the buffer. 17 | /// 18 | public uint MaxElementStride { get; set; } 19 | } 20 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Hardware/DisplayDelagates.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// A delegate representing a display output change. 4 | /// The output. 5 | public delegate void DisplayOutputChanged(IDisplayOutput output); 6 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Hardware/DisplayOrientation.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public enum DisplayOrientation 4 | { 5 | /// Unspecified rotation 6 | Unspecified = 0, 7 | 8 | /// Specifies no rotation 9 | Identity = 1, 10 | 11 | /// Specifies 90 degrees of rotation 12 | Rotate90 = 2, 13 | 14 | /// Specifies 180 degrees of rotation 15 | Rotate180 = 3, 16 | 17 | /// Specifies 270 degrees of rotation 18 | Rotate270 = 4 19 | } 20 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Hardware/DisplayScalingMode.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// 4 | /// Flags indicating how an image is stretched to fit a given monitor's resolution. 5 | /// 6 | [Flags] 7 | public enum DisplayScalingMode 8 | { 9 | /// 10 | /// Unspecified scaling. 11 | /// 12 | Unspecified = 0, 13 | 14 | /// 15 | /// Specifies no scaling. The image is centered on the display. This flag is typically used for a fixed-dot-pitch display (such as an LED display). 16 | /// 17 | Centered = 1, 18 | 19 | /// 20 | /// Specifies stretched scaling. 21 | /// 22 | Stretched = 2 23 | } 24 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/MSAAQuality.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// 4 | /// See for info: https://docs.microsoft.com/en-us/windows/win32/api/d3d11/ne-d3d11-d3d11_standard_multisample_quality_levels 5 | /// 6 | public enum MSAAQuality : uint 7 | { 8 | Default = 0, 9 | 10 | /// 11 | /// See: D3D11_STANDARD_MULTISAMPLE_PATTERN 12 | /// 13 | StandardPattern = 0xffffffff, 14 | 15 | /// 16 | /// See: D3D11_CENTER_MULTISAMPLE_PATTERN 17 | /// 18 | CenterPattern = 0xfffffffe 19 | } 20 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/MSAASupport.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// 4 | /// See for info: https://docs.microsoft.com/en-us/windows/win32/api/d3d11/ne-d3d11-d3d11_standard_multisample_quality_levels 5 | /// 6 | public enum MSAASupport : uint 7 | { 8 | /// 9 | /// Multi-sampling not supported by hardware. 10 | /// 11 | NotSupported = 0, 12 | 13 | /// 14 | /// The hardware only supports standard-pattern or center-pattern multi-sampling. No extra vendor-specific ones are supported. 15 | /// 16 | FixedOnly = 1, 17 | } 18 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/ObjectUpdateFlags.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | [Flags] 4 | public enum ObjectUpdateFlags 5 | { 6 | /// The object will not update anything. 7 | None = 0, 8 | 9 | /// The object will update itself. 10 | Self = 1, 11 | 12 | /// The object will update it's children. 13 | Children = 2, 14 | 15 | /// All of the available flags combined. 16 | All = 3, 17 | } 18 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Pipeline/GpuFence.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public abstract class GpuFence : GpuObject 4 | { 5 | protected GpuFence(GpuDevice device) : base(device) { } 6 | 7 | public abstract void Reset(); 8 | } 9 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Pipeline/GpuPriority.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// 4 | /// Represents the priority of a graphics task or command. 5 | /// 6 | public enum GpuPriority 7 | { 8 | /// 9 | /// The task or command will be executed at the start of the next device frame. 10 | /// 11 | StartOfFrame = 0, 12 | 13 | /// 14 | /// The task or command will be executed at the end of the current device frame. 15 | /// 16 | EndOfFrame = 1, 17 | 18 | /// 19 | /// The task or command will be executed immediately on the GPU. 20 | /// 21 | Immediate = 2, 22 | } 23 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Pipeline/QueueValidationMode.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public enum QueueValidationMode 4 | { 5 | Unindexed = 0, 6 | 7 | Indexed = 1, 8 | 9 | Instanced = 2, 10 | 11 | InstancedIndexed = 3, 12 | 13 | Compute = 4, 14 | } 15 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Renderer/DepthSurfaceTracker.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | internal class DepthSurfaceTracker : SurfaceTracker 4 | { 5 | DepthFormat _format; 6 | 7 | internal DepthSurfaceTracker( 8 | GpuDevice device, 9 | uint width, 10 | uint height, 11 | DepthFormat format, 12 | SurfaceSizeMode mode = SurfaceSizeMode.Full) : base(device, width, height, "depth", mode) 13 | { 14 | _format = format; 15 | } 16 | 17 | protected override IDepthStencilSurface Create(AntiAliasLevel aaLevel, uint width, uint height) 18 | { 19 | IDepthStencilSurface ds = Device.Resources.CreateDepthSurface(width, height, _format, aaLevel:aaLevel, name:$"{Name}_{aaLevel}aa"); 20 | return ds; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Renderer/MainSurfaceType.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public enum MainSurfaceType 4 | { 5 | Scene = 0, 6 | 7 | Normals = 1, 8 | 9 | Emissive = 2, 10 | 11 | Lighting = 3, 12 | 13 | Composition1 = 4, 14 | 15 | Composition2 = 5, 16 | } 17 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Renderer/Overlays/IRenderOverlay.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics.Overlays; 2 | 3 | public interface IRenderOverlay 4 | { 5 | void OnRender(Timing time, SpriteBatcher sb, SpriteFont font, GraphicsProfiler rendererProfiler, RenderCamera camera); 6 | 7 | /// 8 | /// Gets the title of the debug overlay. This must be unique when added to a . 9 | /// 10 | string Title { get; } 11 | } 12 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Renderer/SpriteRenderer.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public class SpriteRenderer : Renderable 4 | { 5 | internal SpriteRenderer(RenderService renderer, Action callback) : base(renderer) 6 | { 7 | Callback = callback; 8 | } 9 | 10 | public Action Callback { get; set; } 11 | 12 | protected override void OnRender(GpuCommandList cmd, RenderService renderer, RenderCamera camera, ObjectRenderData data) 13 | { 14 | Callback?.Invoke(renderer.SpriteBatch); 15 | renderer.SpriteBatch.Flush(cmd, camera, data); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Renderer/Steps/RenderStep.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// 4 | /// A base class for render steps. 5 | /// 6 | internal abstract class RenderStep : IDisposable 7 | { 8 | internal void Initialize(RenderService renderer) 9 | { 10 | Renderer = renderer; 11 | OnInitialize(renderer); 12 | } 13 | 14 | protected abstract void OnInitialize(RenderService service); 15 | 16 | internal abstract void Draw(GpuCommandList cmd, RenderCamera camera, RenderChainContext context, Timing time); 17 | 18 | public abstract void Dispose(); 19 | 20 | internal RenderService Renderer { get; private set; } 21 | } 22 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Renderer/SurfaceSizeMode.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public enum SurfaceSizeMode : byte 4 | { 5 | /// 6 | /// The surface will be at least the width and height of the largest-rendered surface. 7 | /// 8 | Full = 0, 9 | 10 | /// 11 | /// The surface will be at least half the width and height of the largest-rendered surface. 12 | /// 13 | Half = 1, 14 | 15 | /// 16 | /// The surface will remain at a fixed size regardless of resolution changes. 17 | /// 18 | Fixed = 2, 19 | } 20 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Resources/Buffers/TypedBufferFormat.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public enum TypedBufferFormat 4 | { 5 | UInt32 = 0, 6 | 7 | Int32 = 1, 8 | 9 | Float = 2, 10 | } 11 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Resources/GpuMapType.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public enum GpuMapType 4 | { 5 | Read = 0, 6 | 7 | Write = 1 8 | } 9 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Resources/GpuResourceHandle.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public unsafe abstract class GpuResourceHandle : GpuObject 4 | { 5 | protected GpuResourceHandle(GpuResource resource) : 6 | base(resource.Device) 7 | { 8 | Resource = resource; 9 | } 10 | 11 | /// 12 | /// Gets the that this handle is associated with. 13 | /// 14 | public GpuResource Resource { get; } 15 | } 16 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Resources/GpuResourceMap.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public struct GpuResourceMap 4 | { 5 | public unsafe void* Ptr; 6 | 7 | public ulong RowPitch; 8 | 9 | public ulong DepthPitch; 10 | 11 | public unsafe GpuResourceMap(void* ptr, ulong rowPitch, ulong depthPitch) 12 | { 13 | Ptr = ptr; 14 | RowPitch = rowPitch; 15 | DepthPitch = depthPitch; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Resources/Surfaces/DepthClearFlags.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | [Flags] 4 | public enum DepthClearFlags 5 | { 6 | /// 7 | /// Don't clear any part of the depth-stencil buffer. 8 | /// 9 | None = 0, 10 | 11 | /// 12 | /// Clear the depth buffer, using fast clear if possible, then place the resource in a compressed state. 13 | /// 14 | Depth = 1, 15 | 16 | /// Clear the stencil buffer, using fast clear if possible, then place the resource in a compressed state. 17 | Stencil = 2 18 | } 19 | 20 | public static class DepthClearFlagsExtensions 21 | { 22 | public static bool Has(this DepthClearFlags flags, DepthClearFlags value) 23 | { 24 | return (flags & value) == value; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Resources/Surfaces/IRenderSurface.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// 4 | /// Represents the implementation of a render surface. 5 | /// 6 | public interface IRenderSurface : ITexture 7 | { 8 | /// Clears the provided with the specified color. 9 | /// The priority of the operation. 10 | /// The command list that will perform the clear operation. 11 | /// The color to use for clearing the surface. 12 | void Clear(GpuPriority priority, GpuCommandList cmd, Color color); 13 | } 14 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Resources/Surfaces/IRenderSurface1D.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// 4 | /// Represents the implementation of a 1D render surface. 5 | /// 6 | public interface IRenderSurface1D : ITexture1D, IRenderSurface 7 | { 8 | /// Gets the viewport that defines the renderable area of the render target. 9 | ViewportF Viewport { get; } 10 | } 11 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Resources/Surfaces/IRenderSurface2D.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// 4 | /// Represents the implementation of a 2D render surface. 5 | /// 6 | public interface IRenderSurface2D : ITexture2D, IRenderSurface 7 | { 8 | /// Gets the viewport that defines the renderable area of the render target. 9 | ViewportF Viewport { get; } 10 | } 11 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Resources/Surfaces/ISwapChainSurface.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public interface ISwapChainSurface : IRenderSurface2D 4 | { 5 | /// 6 | /// Dispatches a callback to be invoked next time the is presented on its parent render thread. 7 | /// 8 | /// 9 | void Dispatch(Action callback); 10 | 11 | /// 12 | /// Gets or sets whether or not the current is enabled. 13 | /// If false, the current will not be presented to its output. 14 | /// 15 | bool IsEnabled { get; set; } 16 | } 17 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Resources/Textures/BC/BCContext.cs: -------------------------------------------------------------------------------- 1 | using Molten.Collections; 2 | 3 | namespace Molten.Graphics.Textures; 4 | 5 | internal class BCContext : IPoolable 6 | { 7 | internal float[] FDir = new float[4]; 8 | 9 | // Calculate new steps 10 | internal Color4[] PSteps = new Color4[4]; 11 | 12 | public void ClearForPool() { } 13 | } 14 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Resources/Textures/BC/Parsers/BC1Parser.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics.Textures; 2 | 3 | internal class BC1Parser : BCBlockParser 4 | { 5 | public override GpuResourceFormat ExpectedFormat => GpuResourceFormat.BC1_UNorm; 6 | 7 | internal override Color4[] Decode(BinaryReader imageReader, Logger log) 8 | { 9 | D3DX_BC1 bc1 = new D3DX_BC1(); 10 | bc1.Read(imageReader); 11 | return BC.D3DXDecodeBC1(bc1); 12 | } 13 | 14 | internal override void Encode(BinaryWriter writer, Color4[] uncompressed, Logger log) 15 | { 16 | D3DX_BC1 bc1 = BC.D3DXEncodeBC1(uncompressed, 1.0f, BCFlags.DITHER_RGB); 17 | bc1.Write(writer); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Resources/Textures/BC/Parsers/BC2Parser.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics.Textures; 2 | 3 | internal class BC2Parser : BCBlockParser 4 | { 5 | public override GpuResourceFormat ExpectedFormat => GpuResourceFormat.BC2_UNorm; 6 | 7 | internal override Color4[] Decode(BinaryReader imageReader, Logger log) 8 | { 9 | D3DX_BC2 bc = new D3DX_BC2(); 10 | bc.Read(imageReader); 11 | return BC.D3DXDecodeBC2(bc); 12 | } 13 | 14 | internal override void Encode(BinaryWriter writer, Color4[] uncompressed, Logger log) 15 | { 16 | D3DX_BC2 bc = BC.D3DXEncodeBC2(uncompressed, BCFlags.DITHER_RGB); 17 | bc.Write(writer); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Resources/Textures/BC/Parsers/BC3Parser.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics.Textures; 2 | 3 | internal class BC3Parser : BCBlockParser 4 | { 5 | public override GpuResourceFormat ExpectedFormat => GpuResourceFormat.BC3_UNorm; 6 | 7 | internal override Color4[] Decode(BinaryReader imageReader, Logger log) 8 | { 9 | D3DX_BC3 bc = new D3DX_BC3(); 10 | bc.Read(imageReader); 11 | return BC.D3DXDecodeBC3(bc); 12 | } 13 | 14 | internal override void Encode(BinaryWriter writer, Color4[] uncompressed, Logger log) 15 | { 16 | D3DX_BC3 bc = BC.D3DXEncodeBC3(uncompressed, BCFlags.DITHER_RGB); 17 | bc.Write(writer); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Resources/Textures/BC/Parsers/BCBlockParser.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics.Textures; 2 | 3 | /// A base class for DDS block readers. 4 | internal abstract class BCBlockParser 5 | { 6 | public abstract GpuResourceFormat ExpectedFormat { get; } 7 | 8 | internal abstract Color4[] Decode(BinaryReader imageReader, Logger log); 9 | 10 | internal abstract void Encode(BinaryWriter writer, Color4[] uncompressed, Logger log); 11 | } 12 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Resources/Textures/DDS/DDSFlags.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics.Textures.DDS; 2 | 3 | [FlagsAttribute] 4 | /// DDS_HEADER : dwFlags. http://msdn.microsoft.com/en-us/library/windows/desktop/bb943982%28v=vs.85%29.aspx. 5 | /// Determines what details or data the dds header contains 6 | internal enum DDSFlags : uint 7 | { 8 | Capabilities = 0x1, 9 | 10 | Height = 0x2, 11 | 12 | Width = 0x4, 13 | 14 | Pitch = 0x8, 15 | 16 | PixelFormat = 0x1000, 17 | 18 | MipMapCount = 0x20000, 19 | 20 | LinearSize = 0x80000, 21 | 22 | Depth = 0x800000, 23 | } 24 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Resources/Textures/DDS/DDSSizeException.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics.Textures; 2 | 3 | public class DDSSizeException : Exception 4 | { 5 | public DDSSizeException(DDSFormat format, uint width, uint height) : 6 | base($"Block-compression requires the width and height of the texture to be a multiple of {BCHelper.BLOCK_DIMENSIONS}. Texture was {width}x{height}.") 7 | { 8 | Format = format; 9 | SourceWidth = width; 10 | SourceHeight = height; 11 | } 12 | 13 | public DDSFormat Format { get; } 14 | 15 | public uint SourceWidth { get; } 16 | 17 | public uint SourceHeight { get; } 18 | } 19 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Resources/Textures/ITextureCube.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public interface ITextureCube : ITexture2D 4 | { 5 | /// Gets the number of cube maps stored in the texture. This is greater than 1 if the texture is a cube-map array. 6 | uint CubeCount { get; } 7 | } 8 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Resources/Textures/TextureReader.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public abstract class TextureReader : IDisposable 4 | { 5 | public abstract TextureData Read(BinaryReader reader, Logger log, string filename = null); 6 | 7 | public virtual void Dispose() { } 8 | } 9 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Resources/Textures/TextureWriter.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public abstract class TextureWriter : EngineObject 4 | { 5 | public abstract void WriteData(Stream stream, TextureData data, Logger log, string filename = null); 6 | } 7 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/SDF/FillRule.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics.SDF; 2 | 3 | public enum FillRule 4 | { 5 | NonZero, 6 | Odd, // "even-odd" 7 | Positive, 8 | Negative 9 | }; 10 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/SDF/MultiDistancePixelConversion.cs: -------------------------------------------------------------------------------- 1 | using Molten.DoublePrecision; 2 | 3 | namespace Molten.Graphics.SDF; 4 | 5 | public class MultiDistancePixelConversion 6 | { 7 | public MultiDistancePixelConversion(double range) 8 | { 9 | InvRange = 1.0 / range; 10 | } 11 | 12 | public unsafe void Convert(Color3* pixels, Color3D distance) 13 | { 14 | pixels->R = (float)(InvRange * distance.R + .5); 15 | pixels->G = (float)(InvRange * distance.G + .5); 16 | pixels->B = (float)(InvRange * distance.B + .5); 17 | } 18 | 19 | public double InvRange { get; } 20 | } 21 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Scene/Changes/AddCamera.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// A task for adding a to a scene. 4 | internal struct AddCamera : IGpuTask 5 | { 6 | public RenderCamera Camera; 7 | public SceneRenderData Data; 8 | 9 | public GpuTaskCallback OnCompleted; 10 | 11 | public static bool Validate(ref AddCamera t) => true; 12 | 13 | public static bool Process(GpuCommandList cmd, ref AddCamera t) 14 | { 15 | t.Data.Cameras.Add(t.Camera); 16 | return true; 17 | } 18 | 19 | public void Complete(bool success) 20 | { 21 | OnCompleted?.Invoke(success); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Scene/Changes/RemoveCamera.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// A task for removing a from a scene. 4 | internal struct RemoveCamera : IGpuTask 5 | { 6 | public RenderCamera Camera; 7 | public SceneRenderData Data; 8 | 9 | public GpuTaskCallback OnCompleted; 10 | 11 | public static bool Validate(ref RemoveCamera t) => true; 12 | 13 | public static bool Process(GpuCommandList cmd, ref RemoveCamera t) 14 | { 15 | t.Data.Cameras.Remove(t.Camera); 16 | return true; 17 | } 18 | 19 | public void Complete(bool success) 20 | { 21 | OnCompleted?.Invoke(success); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Scene/Changes/RenderLayerAdd.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// A for adding to the a instance. 4 | internal struct RenderLayerAdd : IGpuTask 5 | { 6 | public SceneRenderData SceneData; 7 | 8 | public LayerRenderData LayerData; 9 | 10 | public GpuTaskCallback OnCompleted; 11 | 12 | public static bool Validate(ref RenderLayerAdd t) => true; 13 | 14 | public static bool Process(GpuCommandList cmd, ref RenderLayerAdd t) 15 | { 16 | t.SceneData.Layers.Add(t.LayerData); 17 | return true; 18 | } 19 | 20 | public void Complete(bool success) 21 | { 22 | OnCompleted?.Invoke(success); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Scene/Changes/RenderLayerRemove.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// A for removing fron a instance. 4 | internal struct RenderLayerRemove : IGpuTask 5 | { 6 | public SceneRenderData SceneData; 7 | 8 | public LayerRenderData LayerData; 9 | 10 | public GpuTaskCallback OnCompleted; 11 | 12 | public static bool Validate(ref RenderLayerRemove t) => true; 13 | 14 | public static bool Process(GpuCommandList cmd, ref RenderLayerRemove t) 15 | { 16 | t.SceneData.Layers.Remove(t.LayerData); 17 | return true; 18 | } 19 | 20 | public void Complete(bool success) 21 | { 22 | OnCompleted?.Invoke(success); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Scene/LayerRenderData.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public class LayerRenderData 4 | { 5 | public readonly Dictionary Renderables = new Dictionary(); 6 | 7 | internal LayerRenderData(string name) 8 | { 9 | Name = name; 10 | } 11 | 12 | public override string ToString() 13 | { 14 | return $"Layer '{Name}' - {Renderables.Count} objects"; 15 | } 16 | 17 | public string Name { get; set; } 18 | } 19 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Scene/ObjectRenderData.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// A snapshot of an object's last rendered state. 4 | public class ObjectRenderData 5 | { 6 | /// The transform used during the last render frame. 7 | public Matrix4F LastTransform = Matrix4F.Identity; 8 | 9 | /// The transform we're supposed to be at. 10 | public Matrix4F TargetTransform = Matrix4F.Identity; 11 | 12 | /// The current transform after interpolation is applied. This is the one the object will be rendered with for the current frame. 13 | public Matrix4F RenderTransform = Matrix4F.Identity; 14 | 15 | /// The distance from the camera, calculated by the renderer using . 16 | public double DistanceFromCamera = 0; 17 | } 18 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Scene/RenderCameraMode.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public enum RenderCameraMode 4 | { 5 | /// 6 | /// Configures a camera for left-handed perspective mode. 7 | /// 8 | Perspective = 0, 9 | 10 | /// 11 | /// Configures a camera for left-handed orthographic mode. 12 | /// 13 | Orthographic = 1, 14 | } 15 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Shaders/Compiler/PassCompileResult.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public unsafe class PassCompileResult 4 | { 5 | public PassCompileResult(ShaderPass pass) 6 | { 7 | Pass = pass; 8 | Results = new Dictionary(); 9 | } 10 | 11 | public ShaderCodeResult this[ShaderStageType type] 12 | { 13 | get 14 | { 15 | if (Results.TryGetValue(type, out ShaderCodeResult result)) 16 | return result; 17 | else 18 | return null; 19 | } 20 | 21 | set => Results[type] = value; 22 | } 23 | 24 | public Dictionary Results { get; } 25 | 26 | public ShaderPass Pass { get; } 27 | } 28 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Shaders/Compiler/Reflection/ConstantBufferFlags.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// 4 | /// Shares value parity with the DirectX D3D_SHADER_CBUFFER_FLAGS enum. 5 | /// See: https://learn.microsoft.com/en-us/windows/win32/api/d3dcommon/ne-d3dcommon-d3d_shader_cbuffer_flags 6 | /// 7 | public enum ConstantBufferFlags 8 | { 9 | None = 0, 10 | 11 | UserPacked = 1, 12 | 13 | ForceDWord = 0x7fffffff 14 | } 15 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Shaders/Compiler/Reflection/ConstantBufferType.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// 4 | /// Shares value parity with the DirectX D3D_CBUFFER_TYPE enum. 5 | /// See: https://learn.microsoft.com/en-us/windows/win32/api/d3dcommon/ne-d3dcommon-d3d_cbuffer_type 6 | /// 7 | public enum ConstantBufferType 8 | { 9 | None = 0x0, 10 | 11 | CBuffer = 0x0, 12 | 13 | TBuffer = 0x1, 14 | 15 | InterfacePointers = 0x2, 16 | 17 | ResourceBindInfo = 0x3, 18 | } 19 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Shaders/Compiler/Reflection/ShaderInputFlags.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// 4 | /// Based on the D3D shader input flags enum: D3D_SHADER_INPUT_FLAGS. 5 | /// See: https://learn.microsoft.com/en-us/windows/win32/api/d3dcommon/ne-d3dcommon-d3d_shader_input_flags 6 | /// 7 | public enum ShaderInputFlags 8 | { 9 | None = 0x0, 10 | 11 | Userpacked = 0x1, 12 | 13 | ComparisonSampler = 0x2, 14 | 15 | TextureComponent0 = 0x4, 16 | 17 | TextureComponent1 = 0x8, 18 | 19 | TextureComponents = 0xC, 20 | 21 | Unused = 0x10, 22 | 23 | ForceDword = int.MaxValue 24 | } 25 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Shaders/Compiler/Reflection/ShaderMinPrecision.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// 4 | /// Based on the D3D shader register component type enum: D3D_MIN_PRECISION. 5 | /// See: https://learn.microsoft.com/en-us/windows/win32/api/d3dcommon/ne-d3dcommon-d3d_min_precision 6 | /// 7 | public enum ShaderMinPrecision 8 | { 9 | Default = 0, 10 | 11 | Float16 = 1, 12 | 13 | Float28 = 2, 14 | 15 | Reserved = 3, 16 | 17 | Sint16 = 4, 18 | 19 | Uint16 = 5, 20 | 21 | Any16 = 240, 22 | 23 | Any10 = 241 24 | } 25 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Shaders/Compiler/Reflection/ShaderRegisterType.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// 4 | /// Based on the D3D shader register component type enum: D3D_REGISTER_COMPONENT_TYPE. 5 | /// See: https://learn.microsoft.com/en-us/windows/win32/api/d3dcommon/ne-d3dcommon-d3d_register_component_type 6 | /// 7 | public enum ShaderRegisterType 8 | { 9 | None = 0x0, 10 | 11 | Unknown = 0x0, 12 | 13 | UInt32 = 0x1, 14 | 15 | SInt32 = 0x2, 16 | 17 | Float32 = 0x3, 18 | 19 | UInt16 = 0x4, 20 | 21 | SInt16 = 0x5, 22 | 23 | Float16 = 0x6, 24 | 25 | UInt8 = 0x7, 26 | 27 | SInt8 = 0x8, 28 | 29 | UInt64 = 0x9, 30 | 31 | SInt64 = 0xA, 32 | 33 | Float64 = 0xB, 34 | } 35 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Shaders/Compiler/Reflection/ShaderResourceDimension.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// 4 | /// Based on the D3D shader input type enum: D3D_SRV_DIMENSION. 5 | /// See: https://learn.microsoft.com/en-us/windows/win32/api/d3dcommon/ne-d3dcommon-d3d_srv_dimension 6 | /// 7 | public enum ShaderResourceDimension 8 | { 9 | Unknown = 0, 10 | 11 | Buffer = 1, 12 | 13 | Texture1D = 2, 14 | 15 | Texture1DArray = 3, 16 | 17 | Texture2D = 4, 18 | 19 | Texture2DArray = 5, 20 | 21 | Texture2DMS = 6, 22 | 23 | Texture2DMSArray = 7, 24 | 25 | Texture3D = 8, 26 | 27 | TextureCube = 9, 28 | 29 | TextureCubeArray = 10, 30 | 31 | BufferEx = 11, 32 | } 33 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Shaders/Compiler/Reflection/ShaderResourceInfo.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// 4 | /// Reflection information about a shader resource binding. 5 | /// 6 | public class ShaderResourceInfo 7 | { 8 | public string Name; 9 | 10 | public uint BindPoint; 11 | 12 | public uint BindCount; 13 | 14 | public ShaderInputType Type; 15 | 16 | public ShaderReturnType ResourceReturnType; 17 | 18 | public ShaderResourceDimension Dimension; 19 | 20 | public uint NumSamples; 21 | 22 | public ShaderInputFlags Flags; 23 | 24 | public bool HasInputFlags(ShaderInputFlags flags) 25 | { 26 | return (Flags & flags) == flags; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Shaders/Compiler/Reflection/ShaderReturnType.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// 4 | /// Based on the D3D shader input type enum: D3D_RESOURCE_RETURN_TYPE. 5 | /// See: https://learn.microsoft.com/en-us/windows/win32/api/d3dcommon/ne-d3dcommon-d3d_resource_return_type 6 | /// 7 | public enum ShaderReturnType 8 | { 9 | None = 0x0, 10 | 11 | UNorm = 0x1, 12 | 13 | SNorm = 0x2, 14 | 15 | SInt = 0x3, 16 | 17 | UInt = 0x4, 18 | 19 | Float = 0x5, 20 | 21 | Mixed = 0x6, 22 | 23 | Double = 0x7, 24 | 25 | Continued = 0x8, 26 | } 27 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Shaders/Compiler/Reflection/ShaderTypeInfo.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public class ShaderTypeInfo 4 | { 5 | public uint RowCount; 6 | 7 | public uint ColumnCount; 8 | 9 | public ShaderVariableType Type; 10 | 11 | public ShaderVariableClass Class; 12 | 13 | public uint Offset; 14 | 15 | public string Name; 16 | 17 | public uint Elements; 18 | } 19 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Shaders/Compiler/Reflection/ShaderVariableClass.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// 4 | /// Based on the D3D shader variable type enum: D3D_SHADER_VARIABLE_CLASS . 5 | /// See: https://learn.microsoft.com/en-us/windows/win32/api/d3dcommon/ne-d3dcommon-d3d_shader_variable_class 6 | /// 7 | public enum ShaderVariableClass 8 | { 9 | Scalar = 0, 10 | 11 | Vector = 1, 12 | 13 | MatrixRows = 2, 14 | 15 | MatrixColumns = 3, 16 | 17 | Object = 4, 18 | 19 | Struct = 5, 20 | 21 | InterfaceClass = 6, 22 | 23 | InterfacePointer = 7, 24 | 25 | ForceDword = 0x7fffffff, 26 | } 27 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Shaders/Compiler/Reflection/ShaderVariableFlags.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// 4 | /// Based on the D3D shader variable flags enum: D3D_SHADER_VARIABLE_FLAGS . 5 | /// See: https://learn.microsoft.com/en-us/windows/win32/api/d3dcommon/ne-d3dcommon-d3d_shader_variable_flags 6 | /// 7 | public enum ShaderVariableFlags 8 | { 9 | None = 0, 10 | UserPacked = 1, 11 | Used = 2, 12 | InterfacePointer = 4, 13 | InterfaceParameter = 8, 14 | ForceDWord = 0x7fffffff 15 | } 16 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Shaders/Compiler/ShaderCompileFlags.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | [Flags] 4 | public enum ShaderCompileFlags 5 | { 6 | None = 0, 7 | 8 | Debug = 1, 9 | 10 | SkipValidation = 1 << 1, 11 | 12 | SkipOptimization = 1 << 2, 13 | 14 | WarningsAreErrors = 1 << 3, 15 | 16 | Level0Optimization = 1 << 4, 17 | 18 | Level1Optimization = 1 << 5, 19 | 20 | Level2Optimization = 1 << 6, 21 | 22 | Level3Optimization = 1 << 7, 23 | } 24 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Shaders/Compiler/ShaderCompilerMessage.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public class ShaderCompilerMessage 4 | { 5 | public enum Kind 6 | { 7 | Message = 0, 8 | 9 | Error = 1, 10 | 11 | Warning = 2, 12 | 13 | Debug = 3, 14 | } 15 | 16 | public string Text; 17 | 18 | public Kind MessageType; 19 | } 20 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Shaders/Compiler/ShaderDefinition.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public class ShaderDefinition 4 | { 5 | public string Name { get; set; } 6 | 7 | public string Description { get; set; } 8 | 9 | public string Author { get; set; } 10 | 11 | public string Version { get; set; } = "1.0.0"; 12 | 13 | public string File { get; set; } 14 | 15 | public ShaderPassDefinition[] Passes { get; set; } = new ShaderPassDefinition[0]; 16 | } 17 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Shaders/Compiler/ShaderPassDefinition.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace Molten.Graphics; 4 | 5 | public class ShaderPassDefinition 6 | { 7 | public string Name { get; set; } 8 | 9 | public int Iterations { get; set; } = 1; 10 | 11 | [JsonProperty("entry")] 12 | public ShaderEntryPointDefinition Entry { get; set; } = new ShaderEntryPointDefinition(); 13 | 14 | public ShaderPassParameters Parameters = new ShaderPassParameters(GraphicsStatePreset.Default, PrimitiveTopology.Triangle); 15 | 16 | public Dictionary Samplers = new(); 17 | } 18 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Shaders/Enums/BlendPreset.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public enum BlendPreset 4 | { 5 | /// The default blend mode. 6 | Default = 0, 7 | 8 | /// Additive blending mode. 9 | Additive = 1, 10 | 11 | /// Pre-multiplied alpha blending mode. 12 | PreMultipliedAlpha = 2, 13 | } 14 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Shaders/Enums/ConservativeRasterizerMode.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | /// 4 | /// Specifies the mode of conservative rasterization. 5 | /// 6 | public enum ConservativeRasterizerMode 7 | { 8 | /// 9 | /// Conservative rasterization is off. 10 | /// 11 | Off = 0x0, 12 | 13 | /// 14 | /// Conservative rasterization is on. 15 | /// 16 | On = 0x1 17 | } 18 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Shaders/Enums/DepthStencilPreset.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public enum DepthStencilPreset 4 | { 5 | /// Default depth stencil state with stencil testing enabled. 6 | Default = 0, 7 | 8 | /// The default depth stencil state, but with stencil testing disabled. 9 | DefaultNoStencil = 1, 10 | 11 | /// The same as default, but with the z-buffer disabled. 12 | ZDisabled = 2, 13 | } 14 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Shaders/Enums/RasterizerCullingMode.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | /// 4 | /// Represents various modes of culling for the rasterizer. 5 | /// 6 | public enum RasterizerCullingMode 7 | { 8 | /// 9 | /// No faces are culled during rasterization. 10 | /// 11 | None = 0x1, 12 | 13 | /// 14 | /// Front-facing faces are culled during rasterization. 15 | /// 16 | Front = 0x2, 17 | 18 | /// 19 | /// Back-facing faces are culled during rasterization. 20 | /// 21 | Back = 0x3, 22 | 23 | /// 24 | /// All faces are culled during rasterization. 25 | /// 26 | All = 0x4, 27 | } 28 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Shaders/Enums/RasterizerFillingMode.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | /// 4 | /// Represents available rasterizer filling modes. 5 | /// 6 | public enum RasterizerFillingMode 7 | { 8 | /// 9 | /// Does not rasterizer primitives. 10 | /// 11 | None = 0x0, 12 | 13 | /// 14 | /// Only fills the edges of primitives. 15 | /// 16 | Wireframe = 0x2, 17 | 18 | /// 19 | /// Fills primitives as usual. 20 | /// 21 | Solid = 0x3, 22 | 23 | /// 24 | /// Only fills an area around each vertex that makes up the primitive. 25 | /// 26 | Point = 0x16, 27 | } 28 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Shaders/Properties/CommonShaderProperties.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// 4 | /// A helper class for storing references to common shader properties, or filling missing ones in with dummy properties. 5 | /// 6 | public abstract class CommonShaderProperties 7 | { 8 | protected CommonShaderProperties(Shader shader) { } 9 | 10 | protected ShaderVariable MapValue(Shader shader, string name) 11 | { 12 | return shader[name] ?? new DummyShaderValue(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Shaders/Properties/GBufferTextureProperties.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public class GBufferTextureProperties : CommonShaderProperties 4 | { 5 | public ShaderVariable DiffuseTexture { get; set; } 6 | 7 | public ShaderVariable DiffuseTextureMS { get; set; } 8 | 9 | public ShaderVariable SampleCount { get; set; } 10 | 11 | public ShaderVariable NormalTexture { get; set; } 12 | 13 | public ShaderVariable EmissiveTexture { get; set; } 14 | 15 | public GBufferTextureProperties(Shader shader) : base(shader) 16 | { 17 | DiffuseTexture = MapValue(shader, "mapDiffuse"); 18 | DiffuseTextureMS = MapValue(shader, "mapDiffuseMS"); 19 | SampleCount = MapValue(shader, "sampleCount"); 20 | NormalTexture = MapValue(shader, "mapNormal"); 21 | EmissiveTexture = MapValue(shader, "mapEmissive"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Shaders/Properties/ObjectMaterialProperties.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public class ObjectMaterialProperties : CommonShaderProperties 4 | { 5 | public ShaderVariable World { get; set; } 6 | 7 | public ShaderVariable Wvp { get; set; } 8 | 9 | public ShaderVariable EmissivePower { get; set; } 10 | 11 | public ObjectMaterialProperties(Shader shader) : base(shader) 12 | { 13 | World = MapValue(shader, "world"); 14 | Wvp = MapValue(shader, "wvp"); 15 | EmissivePower = MapValue(shader, "emissivePower"); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Shaders/Properties/SceneMaterialProperties.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public class SceneMaterialProperties : CommonShaderProperties 4 | { 5 | public ShaderVariable View { get; private set; } 6 | 7 | public ShaderVariable Projection { get; private set; } 8 | 9 | public ShaderVariable ViewProjection { get; private set; } 10 | 11 | public ShaderVariable InvViewProjection { get; private set; } 12 | 13 | public ShaderVariable MaxSurfaceUV { get; private set; } 14 | 15 | public SceneMaterialProperties(Shader shader) : base(shader) 16 | { 17 | View = MapValue(shader, "view"); 18 | Projection = MapValue(shader, "projection"); 19 | ViewProjection = MapValue(shader, "viewProjection"); 20 | InvViewProjection = MapValue(shader, "invViewProjection"); 21 | MaxSurfaceUV = MapValue(shader, "maxSurfaceUV"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Shaders/Properties/SpriteBatchMaterialProperties.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public class SpriteBatchMaterialProperties : CommonShaderProperties 4 | { 5 | public ShaderVariable TextureSize { get; set; } 6 | 7 | public SpriteBatchMaterialProperties(Shader shader) : base(shader) 8 | { 9 | TextureSize = MapValue(shader, "textureSize"); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Shaders/ShaderBindType.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | public enum ShaderBindType : ushort 3 | { 4 | ConstantBuffer = 0, 5 | 6 | Resource = 1, 7 | 8 | UnorderedAccess = 2, 9 | } 10 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Shaders/Variables/DummyShaderValue.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// 4 | /// Represents a dummy shader value which is not linked to any shader constant buffers or resources. 5 | /// 6 | public class DummyShaderValue : ShaderVariable 7 | { 8 | internal DummyShaderValue() { } 9 | 10 | public override object Value { get; set; } 11 | } 12 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Shaders/Variables/RWVariable.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public abstract class RWVariable : ShaderResourceVariable 4 | { 5 | protected override bool ValidateResource(GpuResource res) 6 | { 7 | if (res.Flags.Has(GpuResourceFlags.UnorderedAccess) && !(res is ISwapChainSurface)) 8 | return true; 9 | else 10 | Parent.Device.Log.Warning($"Cannot use non-unordered-access or non-storage resource in ${nameof(RWVariable)}"); 11 | 12 | return false; 13 | } 14 | } 15 | 16 | public class RWVariable : RWVariable 17 | { 18 | protected override bool ValidateResource(GpuResource res) 19 | { 20 | return res is T && base.ValidateResource(res); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Shaders/Variables/ShaderSamplerVariable.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public class ShaderSamplerVariable : ShaderVariable 4 | { 5 | ShaderSampler _sampler; 6 | 7 | /// 8 | /// Gets or sets whether or not the shader sampler variable is immutable. 9 | /// 10 | public bool IsImmutable { get; internal set; } 11 | 12 | public override object Value 13 | { 14 | get => _sampler; 15 | set 16 | { 17 | if (IsImmutable) 18 | Parent.Device.Log.Error($"Unable to set the value of an immutable shader sampler variable '{Name}'."); 19 | else 20 | _sampler = (ShaderSampler)value; 21 | } 22 | } 23 | 24 | public ShaderSampler Sampler => _sampler; 25 | } 26 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Shaders/Variables/ShaderVariable.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public abstract class ShaderVariable 4 | { 5 | /// 6 | /// Gets the name of the variable. 7 | /// 8 | public string Name { get; internal set; } 9 | 10 | /// 11 | /// Gets the that the current belongs to. 12 | /// 13 | public Shader Parent { get; internal set; } 14 | 15 | /// 16 | /// Gets or sets the value of the current . 17 | /// 18 | public abstract object Value { get; set; } 19 | } 20 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Sprite/SpriteBatchException.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public class SpriteBatcherException : Exception 4 | { 5 | public SpriteBatcherException(SpriteBatcher sb, string message) : base(message) 6 | { 7 | Batcher = sb; 8 | } 9 | 10 | public SpriteBatcher Batcher { get; private set; } 11 | } 12 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Tasks/ComputeTask.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | internal struct ComputeTask : IGpuTask 4 | { 5 | internal Shader Shader; 6 | 7 | internal Vector3UI Groups; 8 | 9 | public GpuTaskCallback OnCompleted; 10 | 11 | public static bool Validate(ref ComputeTask t) => true; 12 | 13 | public static bool Process(GpuCommandList cmd, ref ComputeTask t) 14 | { 15 | cmd.Dispatch(t.Shader, t.Groups); 16 | return true; 17 | } 18 | 19 | public void Complete(bool success) 20 | { 21 | OnCompleted?.Invoke(success); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Tasks/GpuTask.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public delegate void GpuTaskCallback(bool success); 4 | 5 | public delegate void GpuTaskCallback(ref readonly T task, bool success) 6 | where T : struct, IGpuTask; 7 | 8 | public interface IGpuTask 9 | where T : struct, IGpuTask 10 | { 11 | /// 12 | /// Invoked when the task is completed. 13 | /// 14 | /// 15 | void Complete(bool success); 16 | 17 | static abstract bool Validate(ref T t); 18 | 19 | /// 20 | /// Invoked when a task should be processed immediately instead of being queued. 21 | /// 22 | /// 23 | /// The task to be immediately completed 24 | static abstract bool Process(GpuCommandList cmd, ref T t); 25 | } 26 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Tasks/Resources/BufferGetStreamTask.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | internal struct BufferGetStreamTask : IGpuTask 4 | { 5 | internal GpuBuffer Buffer; 6 | 7 | internal uint ByteOffset; 8 | 9 | internal GpuMapType MapType; 10 | 11 | internal GpuBuffer Staging; 12 | 13 | /// A callback to interact with the retrieved stream. 14 | internal event Action OnStreamOpened; 15 | 16 | public static bool Validate(ref BufferGetStreamTask t) => true; 17 | 18 | public static bool Process(GpuCommandList cmd, ref BufferGetStreamTask t) 19 | { 20 | using (GpuStream stream = cmd.MapResource(t.Buffer, 0, t.ByteOffset, t.MapType)) 21 | t.OnStreamOpened?.Invoke(t.Buffer, stream); 22 | 23 | return true; 24 | } 25 | 26 | public void Complete(bool success) { } 27 | } 28 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Tasks/Resources/GenerateMipMapsTask.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | internal struct GenerateMipMapsTask : IGpuTask 4 | { 5 | public GpuTexture Texture; 6 | 7 | public GpuTaskCallback OnCompleted; 8 | 9 | public static bool Validate(ref GenerateMipMapsTask t) => true; 10 | 11 | public static bool Process(GpuCommandList cmd, ref GenerateMipMapsTask t) 12 | { 13 | cmd.OnGenerateMipmaps(t.Texture); 14 | t.Texture.Version++; 15 | return true; 16 | } 17 | 18 | public void Complete(bool success) 19 | { 20 | OnCompleted?.Invoke(success); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Tasks/Resources/ResizeTextureTask.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics.DX12; 2 | public struct ResizeTextureTask : IGpuTask 3 | { 4 | public GpuTexture Texture; 5 | 6 | public TextureDimensions NewDimensions; 7 | 8 | public GpuResourceFormat NewFormat; 9 | 10 | public GpuTaskCallback OnCompleted; 11 | 12 | public static bool Validate(ref ResizeTextureTask t) => true; 13 | 14 | public static bool Process(GpuCommandList cmd, ref ResizeTextureTask t) 15 | { 16 | t.Texture.ProcessResize(cmd, ref t); 17 | return true; 18 | } 19 | 20 | public void Complete(bool success) 21 | { 22 | OnCompleted?.Invoke(success); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Tasks/Resources/ResourceCopyTask.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public struct ResourceCopyTask : IGpuTask 4 | { 5 | public GpuResource Source; 6 | 7 | public GpuResource Destination; 8 | 9 | public event GpuTaskCallback OnCompleted; 10 | 11 | public static bool Validate(ref ResourceCopyTask t) => true; 12 | 13 | public static bool Process(GpuCommandList cmd, ref ResourceCopyTask t) 14 | { 15 | t.Source.Apply(cmd); 16 | cmd.CopyResource(t.Source, t.Destination); 17 | 18 | return true; 19 | } 20 | 21 | public void Complete(bool success) 22 | { 23 | OnCompleted?.Invoke(success); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Tasks/Resources/TextureGetSliceTask.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | internal struct TextureGetSliceTask : IGpuTask 4 | { 5 | public GpuTexture Texture; 6 | 7 | public Action OnGetData; 8 | 9 | public uint MipMapLevel; 10 | 11 | public uint ArrayIndex; 12 | 13 | public GpuMapType MapType; 14 | 15 | public static bool Validate(ref TextureGetSliceTask t) => true; 16 | 17 | public static bool Process(GpuCommandList cmd, ref TextureGetSliceTask t) 18 | { 19 | TextureSlice slice = TextureSlice.FromTextureSlice(cmd, t.Texture, t.MipMapLevel, t.ArrayIndex, t.MapType); 20 | 21 | // Return resulting data 22 | t.OnGetData?.Invoke(slice); 23 | return true; 24 | } 25 | 26 | public void Complete(bool success) { } 27 | } 28 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Tasks/Scene/RenderAddScene.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// A task for adding to the renderer. 4 | internal struct RenderAddScene : IGpuTask 5 | { 6 | public SceneRenderData Data; 7 | 8 | public static bool Validate(ref RenderAddScene t) => true; 9 | 10 | public static bool Process(GpuCommandList cmd, ref RenderAddScene t) 11 | { 12 | cmd.Device.Renderer.Scenes.Add(t.Data); 13 | return true; 14 | } 15 | 16 | public void Complete(bool success) { } 17 | } 18 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Tasks/Scene/RenderRemoveScene.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// A for adding a to the root of a scene. 4 | internal struct RenderRemoveScene : IGpuTask 5 | { 6 | public SceneRenderData Data; 7 | 8 | public static bool Validate(ref RenderRemoveScene t) => true; 9 | 10 | public static bool Process(GpuCommandList cmd, ref RenderRemoveScene t) 11 | { 12 | cmd.Device.Renderer.Scenes.Remove(t.Data); 13 | return true; 14 | } 15 | 16 | public void Complete(bool success) { } 17 | } 18 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Text/SpriteFontCharData.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | internal struct CharData 4 | { 5 | public ushort GlyphIndex; 6 | 7 | public bool Initialized; 8 | 9 | public CharData(ushort gIndex) 10 | { 11 | GlyphIndex = gIndex; 12 | Initialized = true; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Vertices/IVertexInstanceType.cs: -------------------------------------------------------------------------------- 1 | using Molten.IO; 2 | 3 | namespace Molten.Graphics; 4 | 5 | /// Defines a vertex type that can be used with Vertex buffers. 6 | public interface IVertexInstanceType : IVertexType 7 | { 8 | static abstract void WriteBatchData(RawStream stream, ObjectRenderData data); 9 | 10 | /// 11 | /// Gets whether or not the vertex instance type should be automatically batch. 12 | /// 13 | static abstract bool IsBatched { get; } 14 | } 15 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Vertices/IVertexType.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// Defines a vertex type that can be used with Vertex buffers. 4 | public interface IVertexType 5 | { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Vertices/VertexElementUsage.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public enum VertexElementUsage 4 | { 5 | PixelPosition, 6 | Position, 7 | Color, 8 | TextureCoordinate, 9 | Normal, 10 | Binormal, 11 | Tangent, 12 | BlendIndices, 13 | BlendWeight, 14 | Depth, 15 | Fog, 16 | PointSize, 17 | Sample, 18 | TessellateFactor, 19 | VertexID, 20 | InstanceID, 21 | Custom, 22 | } 23 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Vertices/VertexInputType.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public enum VertexInputType 4 | { 5 | PerVertexData = 0, 6 | 7 | PerInstanceData = 1, 8 | } 9 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/Vertices/VertexWithID.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace Molten.Graphics; 4 | 5 | /// A placeholder vertex type for times when no vertex input is required. 6 | [StructLayout(LayoutKind.Sequential, Pack = 4)] 7 | public struct VertexWithID : IVertexType 8 | { 9 | [VertexElement(VertexElementType.UInt, VertexElementUsage.VertexID, 0)] 10 | /// Gets or sets the position as a Vector4 11 | public uint Id; 12 | } 13 | -------------------------------------------------------------------------------- /Molten.Engine/Graphics/WindowMode.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public enum WindowMode 4 | { 5 | /// Displays the program in a window, with a border and title bar. 6 | Windowed = 0, 7 | 8 | /// Removes the window border and allows the program to fill the whole screen. 9 | Borderless = 1, 10 | } 11 | -------------------------------------------------------------------------------- /Molten.Engine/IO/Logging/ILogOutput.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | public interface ILogOutput : IDisposable 4 | { 5 | /// Writes the specified text to the log output. 6 | /// The text to be added to the current log position. 7 | /// The entry representing the full line of text that has been written so far, including the additional 8 | /// If true, a timestamp will be written. 9 | void Write(string text, Logger.Entry entry, bool timestamp = true); 10 | 11 | /// Clears the log output. 12 | void Clear(); 13 | } 14 | -------------------------------------------------------------------------------- /Molten.Engine/IO/Logging/LogCategory.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | public enum LogCategory 4 | { 5 | /// 6 | /// A general message. 7 | /// 8 | Message = 0, 9 | 10 | /// 11 | /// A warning message. 12 | /// 13 | Warning = 1, 14 | 15 | /// 16 | /// An error message. 17 | /// 18 | Error = 2, 19 | 20 | /// 21 | /// A debug message. 22 | /// 23 | Debug = 3, 24 | } 25 | -------------------------------------------------------------------------------- /Molten.Engine/IO/RawStreamException.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.IO; 2 | 3 | public class RawStreamException : Exception 4 | { 5 | internal RawStreamException(RawStream stream, string message) : base(message) 6 | { 7 | Stream = stream; 8 | } 9 | 10 | public RawStream Stream { get; } 11 | } 12 | -------------------------------------------------------------------------------- /Molten.Engine/IWindow.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | /// 4 | /// Represents a window implementation. 5 | /// 6 | public interface IWindow 7 | { 8 | /// 9 | /// Closes or destroys the current . 10 | /// 11 | void Close(); 12 | 13 | /// Gets the bounds of the window surface or its inner render area. 14 | Rectangle RenderBounds { get; } 15 | 16 | /// Gets or sets the title of the window. 17 | string Title { get; set; } 18 | 19 | /// 20 | /// Gets or sets whether or not the window is visible. 21 | /// 22 | bool IsVisible { get; set; } 23 | } 24 | -------------------------------------------------------------------------------- /Molten.Engine/Input/Features/InputDeviceFeature.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Input; 2 | 3 | public abstract class InputDeviceFeature 4 | { 5 | public string Name { get; } 6 | 7 | public string Description { get; } 8 | 9 | public InputDeviceFeature(string name, string desc) 10 | { 11 | Name = name; 12 | Description = desc; 13 | } 14 | 15 | internal void Update(Timing time) 16 | { 17 | OnUpdate(time); 18 | } 19 | 20 | public abstract void ClearState(); 21 | 22 | protected abstract void OnUpdate(Timing time); 23 | } 24 | -------------------------------------------------------------------------------- /Molten.Engine/Input/Features/InputVibration.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Input; 2 | 3 | public class InputVibration : InputDeviceFeature 4 | { 5 | /// 6 | /// Gets or sets the vibration intensity value. 7 | /// 8 | public float Value { get; set; } 9 | 10 | /// 11 | /// Gets the maximum vibration intensity value. 12 | /// 13 | public float MaxValue { get; } 14 | 15 | public InputVibration(string name, float maxValue, string desc = "Vibrator") : 16 | base(name, desc) 17 | { 18 | MaxValue = maxValue; 19 | } 20 | protected override void OnUpdate(Timing time) { } 21 | 22 | public override void ClearState() 23 | { 24 | Value = 0f; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Molten.Engine/Input/Gamepad/GamepadSubType.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Input; 2 | 3 | public enum GamepadSubType 4 | { 5 | Unknown = 0, 6 | 7 | /// 8 | /// A gamepad with the same or similar configuration as an Xbox 360 controller. 9 | /// 10 | Gamepad = 0x01, 11 | 12 | Wheel = 0x02, 13 | 14 | ArcadeStick = 0x03, 15 | 16 | FlightStick = 0x04, 17 | 18 | DancePad = 0x05, 19 | 20 | Guitar = 0x06, 21 | 22 | GuitarAlternate = 0x07, 23 | 24 | DrumKit = 0x08, 25 | 26 | GuitarBass = 0x0B, 27 | 28 | ArcadePad = 0x13, 29 | 30 | /// 31 | /// A controller with the same or similar configuration as an Xbox One controller. Xbox One controllers have additional 32 | /// force feedback vibration controllers. 33 | /// 34 | XOnePad = 50, 35 | } 36 | -------------------------------------------------------------------------------- /Molten.Engine/Input/IClipboard.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Input; 2 | 3 | public interface IClipboard : IDisposable 4 | { 5 | /// Sets the current clipboard text value. 6 | /// The text to be sent to the clipboard. 7 | void SetText(string txt); 8 | 9 | /// Checks if the clipboard contains any text. Returns true if it does. 10 | /// A boolean 11 | bool ContainsText(); 12 | 13 | /// Gets the current string value on the clipboard. 14 | /// A string containing the clipboard text. 15 | string GetText(); 16 | } 17 | -------------------------------------------------------------------------------- /Molten.Engine/Input/IInputNavigation.cs: -------------------------------------------------------------------------------- 1 | using Molten.Utility; 2 | 3 | namespace Molten.Input; 4 | 5 | /// 6 | /// Represents an implementation of nagivation controls on the current platform. 7 | /// 8 | public interface IInputNavigation 9 | { 10 | /// 11 | /// Triggered when a back button is pressed. 12 | /// 13 | event MoltenEventHandler OnBackPressed; 14 | 15 | /// 16 | /// Triggered when a context menu button is pressed. 17 | /// 18 | event MoltenEventHandler OnContextButtonPressed; 19 | 20 | /// 21 | /// Gets whether or not a back button is pressed. 22 | /// 23 | bool IsBackPressed { get; } 24 | 25 | /// 26 | /// Gets whether or not a context menu button is pressed. 27 | /// 28 | bool IsContextButtonPressed { get; } 29 | } 30 | -------------------------------------------------------------------------------- /Molten.Engine/Input/InputActionType.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Input; 2 | 3 | public enum InputActionType 4 | { 5 | /// 6 | /// No tap/click/press. 7 | /// 8 | None = 0, 9 | 10 | /// 11 | /// Single tap/click/press. 12 | /// 13 | Single = 1, 14 | 15 | /// 16 | /// Double tap/click/press. 17 | /// 18 | Double = 2, 19 | } 20 | -------------------------------------------------------------------------------- /Molten.Engine/Input/Keyboard/KeyboardKeyState.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Input; 2 | 3 | public struct KeyboardKeyState : IInputState 4 | { 5 | public KeyCode Key; 6 | 7 | public KeyboardKeyType KeyType; 8 | 9 | public InputActionType ActionType { get; set; } 10 | 11 | public DateTime PressTimestamp { get; set; } 12 | 13 | public InputAction Action { get; set; } 14 | 15 | public int SetID { get; set; } 16 | 17 | public ulong UpdateID { get; set; } 18 | 19 | /// Gets the character value of the key. 20 | /// This is only populated if is equal to 21 | public char Character; 22 | } 23 | -------------------------------------------------------------------------------- /Molten.Engine/Input/Keyboard/KeyboardKeyType.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Input; 2 | 3 | public enum KeyboardKeyType 4 | { 5 | /// 6 | /// A normal key press with no specific purpose or intention. 7 | /// 8 | Normal = 0, 9 | 10 | /// 11 | /// The key represents a character. 12 | /// 13 | Character = 1, 14 | 15 | /// 16 | /// The type is an extended key on the native platform. 17 | /// 18 | Extended = 2, 19 | 20 | /// 21 | /// The type is a system key. i.e. Windows key, scroll lock or caps lock. 22 | /// 23 | System = 3, 24 | 25 | /// 26 | /// The type is a modifer key. i.e. ctrl, shift or alt. 27 | /// 28 | Modifier = 4, 29 | } 30 | -------------------------------------------------------------------------------- /Molten.Engine/Input/Pointers/PointerButton.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Input; 2 | 3 | public enum PointerButton : byte 4 | { 5 | None = 0, 6 | Left = 1, 7 | Right = 2, 8 | Middle = 3, 9 | XButton1 = 4, 10 | XButton2 = 5, 11 | } 12 | -------------------------------------------------------------------------------- /Molten.Engine/Input/Pointers/PointingDeviceType.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Input; 2 | 3 | public enum PointingDeviceType 4 | { 5 | Unknown = 0, 6 | 7 | Mouse = 1, 8 | 9 | Touchpanel = 3, 10 | 11 | Sylus = 4, 12 | } 13 | -------------------------------------------------------------------------------- /Molten.Engine/Input/Pointers/Touch/TouchDevice.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Input; 2 | 3 | public abstract class TouchDevice : PointingDevice 4 | { 5 | /// 6 | /// The number of active touch points on the current . 7 | /// 8 | public abstract int TouchPointCount { get; protected set; } 9 | 10 | public override PointingDeviceType PointerType => PointingDeviceType.Touchpanel; 11 | } 12 | -------------------------------------------------------------------------------- /Molten.Engine/ObjectHandler.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | public delegate void ObjectHandler(T obj); 4 | -------------------------------------------------------------------------------- /Molten.Engine/Scene/Changes/SceneAddObject.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | internal class SceneAddObject : SceneChange 4 | { 5 | public SceneObject Object; 6 | 7 | public SceneLayer Layer; 8 | 9 | public override void ClearForPool() 10 | { 11 | Object = null; 12 | } 13 | 14 | internal override void Process() 15 | { 16 | if (Object.Scene != Scene) 17 | { 18 | // Remove from other scene 19 | if (Object.Layer != null) 20 | Object.Layer.Objects.Remove(Object); 21 | 22 | Object.Layer = Layer; 23 | Layer.Objects.Add(Object); 24 | } 25 | 26 | Recycle(this); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Molten.Engine/Scene/Changes/SceneChange.cs: -------------------------------------------------------------------------------- 1 | using Molten.Collections; 2 | 3 | namespace Molten; 4 | 5 | internal abstract class SceneChange : IPoolable 6 | { 7 | public Scene Scene { get; internal set; } 8 | 9 | public abstract void ClearForPool(); 10 | 11 | internal abstract void Process(); 12 | } 13 | 14 | internal abstract class SceneChange : SceneChange 15 | where CHANGE : SceneChange, new() 16 | { 17 | static ObjectPool _pool = new ObjectPool(() => new CHANGE()); 18 | 19 | internal static CHANGE Get() 20 | { 21 | return _pool.GetInstance(); 22 | } 23 | 24 | internal static void Recycle(CHANGE obj) 25 | { 26 | _pool.Recycle(obj); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Molten.Engine/Scene/Changes/SceneLayerAdd.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | internal class SceneLayerAdd : SceneChange 4 | { 5 | public Scene ParentScene; 6 | 7 | public SceneLayer Layer; 8 | 9 | public override void ClearForPool() 10 | { 11 | Layer = null; 12 | ParentScene = null; 13 | } 14 | 15 | internal override void Process() 16 | { 17 | Layer.LayerID = ParentScene.Layers.Count; 18 | ParentScene.Layers.Add(Layer); 19 | Recycle(this); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Molten.Engine/Scene/Changes/SceneLayerRemove.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | internal class SceneLayerRemove : SceneChange 4 | { 5 | public Scene ParentScene; 6 | 7 | public SceneLayer Layer; 8 | 9 | public override void ClearForPool() 10 | { 11 | Layer = null; 12 | ParentScene = null; 13 | } 14 | 15 | internal override void Process() 16 | { 17 | ParentScene.Layers.Remove(Layer); 18 | Recycle(this); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Molten.Engine/Scene/Changes/SceneRemoveObject.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | internal class SceneRemoveObject : SceneChange 4 | { 5 | internal SceneObject Object; 6 | 7 | internal SceneLayer Layer; 8 | 9 | public override void ClearForPool() 10 | { 11 | Object = null; 12 | Layer = null; 13 | } 14 | 15 | internal override void Process() 16 | { 17 | if (Object.Layer == Layer) 18 | { 19 | Layer.Objects.Remove(Object); 20 | Object.Layer = null; 21 | } 22 | 23 | Recycle(this); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Molten.Engine/Scene/SceneException.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | public class SceneException : Exception 4 | { 5 | public Scene Scene { get; private set; } 6 | 7 | public SceneException(Scene scene, string message) : base(message) 8 | { 9 | Scene = scene; 10 | } 11 | } 12 | 13 | public class SceneObjectException : SceneException 14 | { 15 | public SceneObject Object { get; private set; } 16 | 17 | public SceneObjectException(Scene scene, SceneObject obj, string message) : base(scene, message) 18 | { 19 | Object = obj; 20 | } 21 | } 22 | 23 | public class SceneLayerException : SceneException 24 | { 25 | public SceneLayer Layer { get; private set; } 26 | 27 | public SceneLayerException(Scene scene, SceneLayer layer, string message) : base(scene, message) 28 | { 29 | Layer = layer; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Molten.Engine/Scene/SceneInputData.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | public delegate void SceneInputEventHandler(SceneInputData data) where T : struct; 4 | 5 | public struct SceneInputData where T : struct 6 | { 7 | /// The value which describes the button or key that was pressed. 8 | public T InputValue; 9 | 10 | /// 11 | /// The object which invoked the event. 12 | /// 13 | public SceneComponent Component; 14 | 15 | /// 16 | /// If true, the object was dragged. 17 | /// 18 | public bool WasDragged; 19 | } 20 | -------------------------------------------------------------------------------- /Molten.Engine/Services/EngineServiceException.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | public class EngineServiceException : Exception 4 | { 5 | public EngineServiceException(EngineService service, string message) : base(message) 6 | { 7 | Service = service; 8 | } 9 | 10 | public EngineService Service { get; } 11 | } 12 | -------------------------------------------------------------------------------- /Molten.Engine/Services/EngineServiceState.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | public enum EngineServiceState 4 | { 5 | /// 6 | /// The service has not been initialized. 7 | /// 8 | Uninitialized = 0, 9 | 10 | /// 11 | /// The service is initialized and ready to (re)start. 12 | /// 13 | Ready = 1, 14 | 15 | /// 16 | /// The service is starting. 17 | /// 18 | Starting = 2, 19 | 20 | /// 21 | /// The service is running. 22 | /// 23 | Running = 3, 24 | 25 | /// 26 | /// The service has been disposed. 27 | /// 28 | Disposed = 4, 29 | 30 | /// 31 | /// The service failed due to an error. 32 | /// 33 | Error = 10, 34 | } 35 | -------------------------------------------------------------------------------- /Molten.Engine/Services/ServiceStartupProperties.cs: -------------------------------------------------------------------------------- 1 | using Molten.Threading; 2 | 3 | namespace Molten.Services; 4 | 5 | public class ServiceStartupProperties 6 | { 7 | public EngineService Instance { get; init; } 8 | 9 | public ThreadingMode ThreadMode { get; init; } 10 | } 11 | -------------------------------------------------------------------------------- /Molten.Engine/Settings/NetworkSettings.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace Molten; 4 | 5 | [DataContract] 6 | public class NetworkSettings : SettingBank 7 | { 8 | public NetworkSettings() 9 | { 10 | Port = AddSetting("net_port", 6113); 11 | } 12 | 13 | /// 14 | /// The port to bind a network manager to. 15 | /// 16 | [DataMember] 17 | public SettingValue Port { get; } 18 | } 19 | -------------------------------------------------------------------------------- /Molten.Engine/Tasks/EngineAddScene.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// A for adding a to the root of a scene. 4 | internal class EngineAddScene : EngineTask 5 | { 6 | public Scene Scene; 7 | 8 | public override void ClearForPool() 9 | { 10 | Scene = null; 11 | } 12 | 13 | public override void Process(Engine engine, Timing time) 14 | { 15 | engine.Scenes.Add(Scene); 16 | Recycle(this); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Molten.Engine/Tasks/EngineRemoveScene.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | /// A for adding a to the root of a scene. 4 | internal class EngineRemoveScene : EngineTask 5 | { 6 | public Scene Scene; 7 | 8 | public override void ClearForPool() 9 | { 10 | Scene = null; 11 | } 12 | 13 | public override void Process(Engine engine, Timing time) 14 | { 15 | engine.Scenes.Remove(Scene); 16 | Recycle(this); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Molten.Engine/Tasks/EngineTask.cs: -------------------------------------------------------------------------------- 1 | using Molten.Collections; 2 | 3 | namespace Molten; 4 | 5 | internal abstract class EngineTask : IPoolable 6 | { 7 | public abstract void ClearForPool(); 8 | 9 | public abstract void Process(Engine engine, Timing time); 10 | } 11 | 12 | internal abstract class EngineTask : EngineTask 13 | where T : EngineTask, new() 14 | { 15 | static ObjectPool _pool = new ObjectPool(() => new T()); 16 | 17 | public static T Get() 18 | { 19 | return _pool.GetInstance(); 20 | } 21 | 22 | protected static void Recycle(T obj) 23 | { 24 | _pool.Recycle(obj); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Molten.Engine/Threading/EngineThreadException.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Threading; 2 | 3 | public class EngineThreadException : Exception 4 | { 5 | public EngineThreadException(EngineThread thread, string name, string message) : base(message) 6 | { 7 | Thread = thread; 8 | ThreadName = name; 9 | } 10 | 11 | public EngineThread Thread { get; private set; } 12 | 13 | public string ThreadName { get; private set; } 14 | } 15 | -------------------------------------------------------------------------------- /Molten.Engine/Threading/ThreadingMode.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Threading; 2 | 3 | public enum ThreadingMode 4 | { 5 | /// 6 | /// Run on the main application . 7 | /// 8 | MainThread = 0, 9 | 10 | /// 11 | /// Should run on it's own . 12 | /// 13 | SeparateThread = 1, 14 | } 15 | -------------------------------------------------------------------------------- /Molten.Engine/Threading/WorkerGroupException.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Threading; 2 | 3 | public class WorkerGroupException : Exception 4 | { 5 | public WorkerGroupException(WorkerGroup group, string name, string message) : base(message) 6 | { 7 | Group = group; 8 | GroupName = name; 9 | } 10 | 11 | public WorkerGroup Group { get; private set; } 12 | 13 | public string GroupName { get; private set; } 14 | } 15 | -------------------------------------------------------------------------------- /Molten.Engine/Threading/WorkerTasks/WorkerCallbackTask.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Threading; 2 | 3 | /// 4 | /// A which executes when run. 5 | /// 6 | public sealed class WorkerCallbackTask : WorkerTask 7 | { 8 | internal WorkerCallbackTask() { } 9 | 10 | protected override bool OnRun() 11 | { 12 | return Callback?.Invoke() ?? true; 13 | } 14 | 15 | protected override void OnFree() { } 16 | 17 | /// 18 | /// Gets or sets the callback method to be run by the current . 19 | /// 20 | public Func Callback { get; set; } 21 | } 22 | -------------------------------------------------------------------------------- /Molten.Engine/UI/Elements/UIConsole.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.UI; 2 | 3 | public class UIConsole : UIElement 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /Molten.Engine/UI/Elements/UIGraphBase.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.UI; 2 | 3 | /// 4 | /// A UI component dedicated to presenting text. 5 | /// 6 | public abstract class UIGraphBase : UIElement 7 | { 8 | protected override void OnInitialize(Engine engine, UISettings settings) 9 | { 10 | base.OnInitialize(engine, settings); 11 | 12 | InputRules = UIInputRuleFlags.Children; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Molten.Engine/UI/Theme/UIThemeMemberAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.UI; 2 | 3 | [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = true)] 4 | public class UIThemeMemberAttribute : Attribute 5 | { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /Molten.Engine/UI/UICancelEventArgs.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.UI; 2 | 3 | public class UICancelEventArgs : EventArgs 4 | { 5 | public bool Cancel { get; set; } 6 | } 7 | -------------------------------------------------------------------------------- /Molten.Engine/UI/UIConstants.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.UI; 2 | 3 | internal class UIConstants 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /Molten.Engine/UI/UIElementFlowDirection.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.UI; 2 | 3 | /// 4 | /// Represents the orientation or flow direction of an element. 5 | /// 6 | public enum UIElementFlowDirection 7 | { 8 | /// 9 | /// The will scroll and render vertically. 10 | /// 11 | Vertical = 0, 12 | 13 | /// 14 | /// The will scroll and render horizontally. 15 | /// 16 | Horizontal = 1 17 | } 18 | -------------------------------------------------------------------------------- /Molten.Engine/UI/UIElementState.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.UI; 2 | 3 | /// 4 | /// Represents state. 5 | /// 6 | public enum UIElementState 7 | { 8 | /// 9 | /// The default element state. 10 | /// 11 | Default = 0, 12 | 13 | /// 14 | /// The element is pressed. 15 | /// 16 | Pressed = 1, 17 | 18 | /// 19 | /// The element is being hovered over by a pointer or cursor. 20 | /// 21 | Hovered = 2, 22 | 23 | /// 24 | /// The element is disabled. 25 | /// 26 | Disabled = 3, 27 | 28 | /// 29 | /// Active, checked or selected. 30 | /// 31 | Active = 4, 32 | } 33 | -------------------------------------------------------------------------------- /Molten.Engine/UI/UIFillType.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.UI; 2 | 3 | /// 4 | /// Represents the fill type of an element or part. 5 | /// 6 | public enum UIFillType 7 | { 8 | /// 9 | /// The object will be stretched to fit the bounds of its parent. 10 | /// 11 | Fit = 0, 12 | 13 | /// 14 | /// The object will be centered at the middle of its parent, without being stretched or deformed to fit 15 | /// 16 | Center = 1, 17 | } 18 | -------------------------------------------------------------------------------- /Molten.Engine/UI/UIHorizonalAlignment.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.UI; 2 | 3 | public enum UIHorizonalAlignment 4 | { 5 | Left = 0, 6 | 7 | Center = 1, 8 | 9 | Right = 2, 10 | } 11 | -------------------------------------------------------------------------------- /Molten.Engine/UI/UIInputRuleFlags.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.UI; 2 | 3 | [Flags] 4 | public enum UIInputRuleFlags 5 | { 6 | /// 7 | /// No input accepted. 8 | /// 9 | None = 0, 10 | 11 | /// 12 | /// Input on self is accepted. 13 | /// 14 | Self = 1, 15 | 16 | /// 17 | /// Input on child element layers is accepted. 18 | /// 19 | Children = 2, 20 | 21 | /// 22 | /// All types of input are accepted. 23 | /// 24 | All = Self | Children, 25 | } 26 | -------------------------------------------------------------------------------- /Molten.Engine/UI/UIVerticalAlignment.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.UI; 2 | 3 | public enum UIVerticalAlignment 4 | { 5 | Top = 0, 6 | 7 | Center = 1, 8 | 9 | Bottom = 2, 10 | } 11 | -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/128_1.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/128_1.dds -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/128_2.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/128_2.dds -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/128_3.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/128_3.dds -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/1d_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/1d_1.png -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/1d_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/1d_2.png -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/1d_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/1d_3.png -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/Ananda Namaste Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/Ananda Namaste Regular.ttf -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/BasicColor.hlsl: -------------------------------------------------------------------------------- 1 | struct VS_IN 2 | { 3 | float4 pos : POSITION; 4 | float4 col : COLOR; 5 | }; 6 | 7 | struct PS_IN 8 | { 9 | float4 pos : SV_POSITION; 10 | float4 col : COLOR; 11 | }; 12 | 13 | cbuffer Common : register(b0) 14 | { 15 | float4x4 view : packoffset(c0); 16 | float4x4 projection : packoffset(c4); 17 | float4x4 viewProjection : packoffset(c8); 18 | float4x4 invViewProjection : packoffset(c12); 19 | } 20 | 21 | cbuffer Object : register(b1) 22 | { 23 | float4x4 wvp : packoffset(c0); 24 | float4x4 world : packoffset(c4); 25 | } 26 | 27 | PS_IN VS(VS_IN input) 28 | { 29 | PS_IN output = (PS_IN) 0; 30 | output.pos = mul(input.pos, wvp); 31 | output.col = input.col; 32 | return output; 33 | } 34 | 35 | float4 PS(PS_IN input) : SV_Target 36 | { 37 | return input.col; 38 | } -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/BasicColor.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "position-color", 4 | "author": "James Yarwood", 5 | "description": "A simple shader which renders meshes with position and color data.", 6 | "file": "BasicColor.hlsl", 7 | "passes": [ 8 | { 9 | "name": "main", 10 | "iterations": 1, 11 | "entry": { 12 | "vertex": "VS", 13 | "fragment": "PS" 14 | }, 15 | "parameters": { 16 | "formats": { 17 | "os0": "R8G8B8A8_SNorm", 18 | "depth": "R24G8" 19 | } 20 | } 21 | } 22 | ] 23 | } 24 | ] -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/BasicColorInstanced.hlsl: -------------------------------------------------------------------------------- 1 | struct VS_IN 2 | { 3 | float4 pos : POSITION; 4 | float4 col : COLOR; 5 | row_major matrix wvp : WORLD; 6 | }; 7 | 8 | struct PS_IN 9 | { 10 | float4 pos : SV_POSITION; 11 | float4 col : COLOR; 12 | }; 13 | 14 | cbuffer Common : register(b0) 15 | { 16 | float4x4 viewProjection : packoffset(c0); 17 | } 18 | 19 | PS_IN VS(VS_IN input) 20 | { 21 | PS_IN output = (PS_IN) 0; 22 | output.pos = mul(input.pos, mul(input.wvp, viewProjection)); 23 | output.col = input.col; 24 | return output; 25 | } 26 | 27 | float4 PS(PS_IN input) : SV_Target 28 | { 29 | return input.col; 30 | } -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/BasicColorInstanced.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "position-color-instanced", 4 | "author": "James Yarwood", 5 | "description": "A simple shader which renders instanced meshes with position and color data.", 6 | "file": "BasicColorInstanced.hlsl", 7 | "passes": [ 8 | { 9 | "name": "main", 10 | "iterations": 1, 11 | "entry": { 12 | "vertex": "VS", 13 | "fragment": "PS" 14 | }, 15 | "parameters": { 16 | "formats": { 17 | "os0": "R8G8B8A8_SNorm", 18 | "depth": "R24G8" 19 | } 20 | } 21 | } 22 | ] 23 | } 24 | ] -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/BasicTexture.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "position-texture", 4 | "author": "James Yarwood", 5 | "description": "A simple shader which renders 3D meshes with position and 2D UV data.", 6 | "file": "BasicTexture.hlsl", 7 | "passes": [ 8 | { 9 | "name": "main", 10 | "iterations": 1, 11 | "entry": { 12 | "vertex": "VS", 13 | "fragment": "PS" 14 | }, 15 | "parameters": { 16 | "blend": "PreMultipliedAlpha", 17 | "formats": { 18 | "os0": "R8G8B8A8_SNorm", 19 | "depth": "R24G8" 20 | } 21 | } 22 | } 23 | ] 24 | } 25 | ] -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/BasicTexture1D.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "position-texture", 4 | "author": "James Yarwood", 5 | "description": "A simple shader which renders meshes with position and 1D UV data.", 6 | "file": "BasicTexture1D.hlsl", 7 | "passes": [ 8 | { 9 | "name": "main", 10 | "iterations": 1, 11 | "entry": { 12 | "vertex": "VS", 13 | "fragment": "PS" 14 | }, 15 | "parameters": { 16 | "formats": { 17 | "os0": "R8G8B8A8_SNorm", 18 | "depth": "R24G8" 19 | } 20 | } 21 | } 22 | ] 23 | } 24 | ] -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/BasicTextureArray1D.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "position-texture-array-1d", 4 | "author": "James Yarwood", 5 | "description": "A simple material which renders meshes with position and 1D texture array coordinate data.", 6 | "file": "BasicTextureArray1D.hlsl", 7 | "passes": [ 8 | { 9 | "name": "main", 10 | "iterations": 1, 11 | "entry": { 12 | "vertex": "VS", 13 | "fragment": "PS" 14 | }, 15 | "parameters": { 16 | "formats": { 17 | "os0": "R8G8B8A8_SNorm", 18 | "depth": "R24G8" 19 | } 20 | } 21 | } 22 | ] 23 | } 24 | ] -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/BasicTextureArray2D.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "position-texture-array-2d", 4 | "author": "James Yarwood", 5 | "description": "A simple material which renders meshes with position and 2D texture array coordinate data.", 6 | "file": "BasicTextureArray2D.hlsl", 7 | "passes": [ 8 | { 9 | "name": "main", 10 | "iterations": 1, 11 | "entry": { 12 | "vertex": "VS", 13 | "fragment": "PS" 14 | }, 15 | "parameters": { 16 | "formats": { 17 | "os0": "R8G8B8A8_SNorm", 18 | "depth": "R24G8" 19 | } 20 | } 21 | } 22 | ] 23 | } 24 | ] -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/BroshK.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/BroshK.ttf -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/ComputeAdd.hlsl: -------------------------------------------------------------------------------- 1 | struct BufType 2 | { 3 | int i; 4 | float f; 5 | }; 6 | 7 | StructuredBuffer Buffer0 : register(t0); 8 | StructuredBuffer Buffer1 : register(t1); 9 | RWStructuredBuffer BufferOut : register(u0); 10 | 11 | [numthreads(1, 1, 1)] 12 | void CS(uint3 DTid : SV_DispatchThreadID) //DTid = Dispatch Thread id. 13 | { 14 | BufferOut[DTid.x].i = Buffer0[DTid.x].i + Buffer1[DTid.x].i; 15 | BufferOut[DTid.x].f = Buffer0[DTid.x].f + Buffer1[DTid.x].f; 16 | } -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/ComputeAdd.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "compute-add", 4 | "author": "James Yarwood", 5 | "description": "A simple compute shader that takes two buffers full of numbers and outputs one sum per index to an output buffer.", 6 | "file": "ComputeAdd.hlsl", 7 | "passes": [ 8 | { 9 | "name": "main", 10 | "iterations": 1, 11 | "entry": { 12 | "compute": "CS" 13 | } 14 | } 15 | ] 16 | } 17 | ] -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/Digitalt.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/Digitalt.ttf -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/FiraSans-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/FiraSans-Bold.ttf -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/FiraSans-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/FiraSans-Regular.ttf -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/cubemap.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/cubemap.dds -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/dds_bc4.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/dds_bc4.dds -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/dds_bc4_srgb.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/dds_bc4_srgb.dds -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/dds_bc5.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/dds_bc5.dds -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/dds_bc6h_fast.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/dds_bc6h_fast.dds -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/dds_bc6h_fine.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/dds_bc6h_fine.dds -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/dds_bc7_fast.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/dds_bc7_fast.dds -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/dds_bc7_fine.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/dds_bc7_fine.dds -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/dds_bc7_srgb_fast.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/dds_bc7_srgb_fast.dds -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/dds_bc7_srgb_fine.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/dds_bc7_srgb_fine.dds -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/dds_color_test.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/dds_color_test.dds -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/dds_dxt1.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/dds_dxt1.dds -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/dds_dxt3.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/dds_dxt3.dds -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/dds_dxt5.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/dds_dxt5.dds -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/dds_dxt5_srgb.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/dds_dxt5_srgb.dds -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/dds_rgba.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/dds_rgba.dds -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/dds_test.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/dds_test.dds -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/dds_test_e.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/dds_test_e.dds -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/dds_test_n.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/dds_test_n.dds -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/dds_test_red.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/dds_test_red.dds -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/euphorigenic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/euphorigenic.ttf -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/logo_512_bc6h.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/logo_512_bc6h.dds -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/logo_512_bc7.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/logo_512_bc7.dds -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/logo_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/logo_64.png -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/metal.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/metal.dds -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/metal_e.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/metal_e.dds -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/metal_n.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/metal_n.dds -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/metal_s.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/metal_s.dds -------------------------------------------------------------------------------- /Molten.Examples.Common/Assets/png_test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Common/Assets/png_test.png -------------------------------------------------------------------------------- /Molten.Examples.Common/ExampleAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Examples; 2 | 3 | public class ExampleAttribute : Attribute 4 | { 5 | public ExampleAttribute(string title, string description) 6 | { 7 | Title = title; 8 | Description = description; 9 | } 10 | 11 | public string Title { get; } 12 | 13 | public string Description { get; } 14 | } 15 | -------------------------------------------------------------------------------- /Molten.Examples.Common/SampleSpriteRenderComponent.cs: -------------------------------------------------------------------------------- 1 | using Molten.Graphics; 2 | 3 | namespace Molten.Examples; 4 | 5 | /// 6 | /// A helper component which provides a render callback for custom rendering in samples. 7 | /// 8 | public class SampleSpriteRenderComponent : SpriteRenderComponent 9 | { 10 | public SampleSpriteRenderComponent() { } 11 | 12 | protected override void OnDispose(bool immediate) { } 13 | 14 | protected override void OnRender(SpriteBatcher sb) 15 | { 16 | RenderCallback?.Invoke(sb); 17 | } 18 | 19 | public Action RenderCallback { get; set; } 20 | } 21 | -------------------------------------------------------------------------------- /Molten.Examples.Common/UIExampleListItem.cs: -------------------------------------------------------------------------------- 1 | using Molten.UI; 2 | 3 | namespace Molten.Examples; 4 | 5 | public class UIExampleListItem : UIListViewItem 6 | { 7 | public Type ExampleType { get; set; } 8 | 9 | public string Description { get; set; } 10 | } 11 | -------------------------------------------------------------------------------- /Molten.Examples.Desktop.Windows/Program.cs: -------------------------------------------------------------------------------- 1 | using Molten.Audio.OpenAL; 2 | using Molten.Graphics; 3 | using Molten.Graphics.DX12; 4 | using Molten.Input; 5 | 6 | namespace Molten.Examples; 7 | 8 | internal class Program 9 | { 10 | static ExampleBrowser _browser; 11 | 12 | static void Main(string[] args) 13 | { 14 | EngineSettings settings = new EngineSettings(); 15 | settings.Graphics.EnableDebugLayer.Value = true; 16 | settings.Graphics.VSync.Value = true; 17 | settings.Graphics.FrameBufferMode.Value = FrameBufferMode.Double; 18 | 19 | _browser = new ExampleBrowser("Example Browser"); 20 | _browser.Start(settings, true); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Molten.Examples.Desktop.Windows/dxcompiler.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Desktop.Windows/dxcompiler.dll -------------------------------------------------------------------------------- /Molten.Examples.Desktop.Windows/dxil.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Examples.Desktop.Windows/dxil.dll -------------------------------------------------------------------------------- /Molten.Graphics.DX12/CapabilitiesDX12.cs: -------------------------------------------------------------------------------- 1 | using Silk.NET.Direct3D12; 2 | 3 | namespace Molten.Graphics.DX12; 4 | 5 | internal class CapabilitiesDX12 6 | { 7 | /// 8 | /// Gets the highest supported root signature version for the current device. 9 | /// 10 | public D3DRootSignatureVersion RootSignatureVersion { get; internal set; } 11 | } 12 | -------------------------------------------------------------------------------- /Molten.Graphics.DX12/D3D12Core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Graphics.DX12/D3D12Core.dll -------------------------------------------------------------------------------- /Molten.Graphics.DX12/DX12Extensions.cs: -------------------------------------------------------------------------------- 1 | using Silk.NET.Direct3D12; 2 | using System.Runtime.CompilerServices; 3 | 4 | namespace Molten.Graphics.DX12; 5 | 6 | internal static class DX12Extensions 7 | { 8 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 9 | public static bool HasFlag(this DescriptorHeapFlags flags, DescriptorHeapFlags flag) 10 | { 11 | return (flags & flag) == flag; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Molten.Graphics.DX12/Interop/BlendInterop.cs: -------------------------------------------------------------------------------- 1 | using Silk.NET.Direct3D12; 2 | 3 | namespace Molten.Graphics.DX12; 4 | 5 | internal static class BlendInterop 6 | { 7 | public static Blend ToApi(this BlendType type) 8 | { 9 | if (type == BlendType.BlendFactorAlpha || type == BlendType.InvBlendFactorAlpha) 10 | throw new NotSupportedException("alpha blend-factor mode is not supported in dX11"); 11 | 12 | // All other values match DX11. 13 | return (Blend)type; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Molten.Graphics.DX12/Pipeline/BarrierStateTrackerDX12.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics.DX12; 2 | internal unsafe class BarrierStateTrackerDX12 3 | { 4 | BarrierStateDX12[] _ptrStates; 5 | uint _numSubResources; 6 | 7 | internal BarrierStateTrackerDX12(uint numSubResources) 8 | { 9 | _ptrStates = new BarrierStateDX12[numSubResources]; 10 | _numSubResources = numSubResources; 11 | } 12 | 13 | internal void SetAll(BarrierStateDX12 state) 14 | { 15 | for (uint i = 0; i < _numSubResources; i++) 16 | _ptrStates[i] = state; 17 | } 18 | 19 | public ref BarrierStateDX12 this[uint subResourceIndex] => ref _ptrStates[subResourceIndex]; 20 | 21 | public uint NumSubResources => _numSubResources; 22 | } 23 | -------------------------------------------------------------------------------- /Molten.Graphics.DX12/Pipeline/State/BarrierStateDX12.cs: -------------------------------------------------------------------------------- 1 | using Silk.NET.Direct3D12; 2 | 3 | namespace Molten.Graphics.DX12; 4 | 5 | struct BarrierStateDX12 6 | { 7 | public ResourceStates State; 8 | 9 | public ResourceBarrierFlags Flags; 10 | 11 | public BarrierStateDX12(ResourceStates states, ResourceBarrierFlags flags) 12 | { 13 | State = states; 14 | Flags = flags; 15 | } 16 | 17 | public static bool operator ==(BarrierStateDX12 a, BarrierStateDX12 b) 18 | { 19 | return a.State == b.State; 20 | } 21 | 22 | public static bool operator !=(BarrierStateDX12 a, BarrierStateDX12 b) 23 | { 24 | return a.State != b.State; 25 | } 26 | } -------------------------------------------------------------------------------- /Molten.Graphics.DX12/Pipeline/State/RootSignatureDX12.cs: -------------------------------------------------------------------------------- 1 | using Silk.NET.Direct3D12; 2 | 3 | namespace Molten.Graphics.DX12; 4 | 5 | internal unsafe class RootSignatureDX12 : GpuObject 6 | { 7 | ID3D12RootSignature* _handle; 8 | RootSigMetaDX12 _meta; 9 | 10 | internal RootSignatureDX12(DeviceDX12 device, ID3D12RootSignature* handle, RootSigMetaDX12 meta) : 11 | base(device) 12 | { 13 | _handle = handle; 14 | Meta = meta; 15 | } 16 | 17 | protected override void OnGpuRelease() 18 | { 19 | NativeUtil.ReleasePtr(ref _handle); 20 | _meta.Dispose(); 21 | } 22 | 23 | public static implicit operator ID3D12RootSignature*(RootSignatureDX12 sig) => sig._handle; 24 | 25 | public ref readonly ID3D12RootSignature* Handle => ref _handle; 26 | 27 | public RootSigMetaDX12 Meta { get; } 28 | } 29 | -------------------------------------------------------------------------------- /Molten.Graphics.DX12/Resources/CBHandleDX12.cs: -------------------------------------------------------------------------------- 1 | using Silk.NET.Direct3D12; 2 | 3 | namespace Molten.Graphics.DX12; 4 | internal class CBHandleDX12 : ResourceHandleDX12 5 | { 6 | internal unsafe CBHandleDX12(BufferDX12 cBuffer, ID3D12Resource1* ptr) : 7 | base(cBuffer, ptr) 8 | { 9 | CBV = new CBViewDX12(this); 10 | } 11 | 12 | protected override void OnGpuRelease() 13 | { 14 | CBV.Dispose(); 15 | base.OnGpuRelease(); 16 | } 17 | 18 | internal CBViewDX12 CBV { get; } 19 | } 20 | -------------------------------------------------------------------------------- /Molten.Graphics.DX12/Resources/DSHandleDX12.cs: -------------------------------------------------------------------------------- 1 | using Silk.NET.Direct3D12; 2 | 3 | namespace Molten.Graphics.DX12; 4 | internal class DSHandleDX12 : ResourceHandleDX12 5 | { 6 | internal unsafe DSHandleDX12(DepthSurfaceDX12 depthSurface, ID3D12Resource1* ptr) : 7 | base(depthSurface, ptr) 8 | { 9 | DSV = new DSViewDX12(this); 10 | ReadOnlyDSV = new DSViewDX12(this); 11 | } 12 | 13 | protected override void OnGpuRelease() 14 | { 15 | DSV.Dispose(); 16 | ReadOnlyDSV.Dispose(); 17 | base.OnGpuRelease(); 18 | } 19 | 20 | internal DSViewDX12 DSV { get; } 21 | 22 | internal DSViewDX12 ReadOnlyDSV { get; } 23 | } 24 | -------------------------------------------------------------------------------- /Molten.Graphics.DX12/Resources/IBHandleDX12.cs: -------------------------------------------------------------------------------- 1 | using Silk.NET.Direct3D12; 2 | 3 | namespace Molten.Graphics.DX12; 4 | internal class IBHandleDX12 : ResourceHandleDX12 5 | { 6 | IndexBufferView _view; 7 | 8 | internal unsafe IBHandleDX12(BufferDX12 buffer, ID3D12Resource1* ptr) : 9 | base(buffer, ptr) 10 | { 11 | _view = new IndexBufferView() 12 | { 13 | BufferLocation = ptr->GetGPUVirtualAddress() + buffer.Offset, 14 | Format = buffer.ResourceFormat.ToApi(), 15 | SizeInBytes = (uint)buffer.SizeInBytes, 16 | }; 17 | } 18 | 19 | internal ref IndexBufferView View => ref _view; 20 | } 21 | -------------------------------------------------------------------------------- /Molten.Graphics.DX12/Resources/RTHandleDX12.cs: -------------------------------------------------------------------------------- 1 | using Silk.NET.Direct3D12; 2 | 3 | namespace Molten.Graphics.DX12; 4 | internal class RTHandleDX12 : ResourceHandleDX12 5 | { 6 | internal unsafe RTHandleDX12(TextureDX12 texture, ID3D12Resource1* ptr) : 7 | base(texture, ptr) 8 | { 9 | RTV = new RTViewDX12(this); 10 | } 11 | 12 | protected override void OnGpuRelease() 13 | { 14 | RTV.Dispose(); 15 | base.OnGpuRelease(); 16 | } 17 | 18 | internal RTViewDX12 RTV { get; } 19 | } 20 | -------------------------------------------------------------------------------- /Molten.Graphics.DX12/Resources/VBHandleDX12.cs: -------------------------------------------------------------------------------- 1 | using Silk.NET.Direct3D12; 2 | 3 | namespace Molten.Graphics.DX12; 4 | internal class VBHandleDX12 : ResourceHandleDX12 5 | { 6 | VertexBufferView _view; 7 | 8 | internal unsafe VBHandleDX12(BufferDX12 buffer, ID3D12Resource1* ptr) : 9 | base(buffer, ptr) 10 | { 11 | _view = new VertexBufferView() 12 | { 13 | BufferLocation = ptr->GetGPUVirtualAddress() + buffer.Offset, 14 | SizeInBytes = (uint)buffer.SizeInBytes, 15 | StrideInBytes = buffer.Stride, 16 | }; 17 | } 18 | 19 | internal ref VertexBufferView View => ref _view; 20 | } 21 | -------------------------------------------------------------------------------- /Molten.Graphics.DX12/Resources/Views/CBViewDX12.cs: -------------------------------------------------------------------------------- 1 | using Silk.NET.Direct3D12; 2 | 3 | namespace Molten.Graphics.DX12; 4 | internal class CBViewDX12 : ViewDX12 5 | { 6 | public CBViewDX12(ResourceHandleDX12 handle) : 7 | base(handle) { } 8 | 9 | protected override unsafe void OnCreate(ref ConstantBufferViewDesc desc, ID3D12Resource1* resource, ref CpuDescriptorHandle heapHandle, uint resourceIndex) 10 | { 11 | Handle.Device.Handle->CreateConstantBufferView(ref desc, heapHandle); 12 | } 13 | 14 | private protected override void OnAllocateHandle(out HeapHandleDX12 handle) 15 | { 16 | handle = Handle.Device.Heap.GetResourceHandle(1); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Molten.Graphics.DX12/Resources/Views/DSViewDX12.cs: -------------------------------------------------------------------------------- 1 | using Silk.NET.Direct3D12; 2 | 3 | namespace Molten.Graphics.DX12; 4 | internal class DSViewDX12 : ViewDX12 5 | { 6 | public DSViewDX12(ResourceHandleDX12 handle) : 7 | base(handle) { } 8 | 9 | protected override unsafe void OnCreate(ref DepthStencilViewDesc desc, ID3D12Resource1* resource, ref CpuDescriptorHandle heapHandle, uint resourceIndex) 10 | { 11 | Handle.Device.Handle->CreateDepthStencilView((ID3D12Resource*)resource, desc, heapHandle); 12 | } 13 | 14 | private protected override void OnAllocateHandle(out HeapHandleDX12 handle) 15 | { 16 | handle = Handle.Device.Heap.GetDepthHandle(1); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Molten.Graphics.DX12/Resources/Views/RTViewDX12.cs: -------------------------------------------------------------------------------- 1 | using Silk.NET.Direct3D12; 2 | 3 | namespace Molten.Graphics.DX12; 4 | internal class RTViewDX12 : ViewDX12 5 | { 6 | public RTViewDX12(ResourceHandleDX12 handle) : 7 | base(handle) 8 | { } 9 | 10 | protected override unsafe void OnCreate(ref RenderTargetViewDesc desc, ID3D12Resource1* resource, ref CpuDescriptorHandle heapHandle, uint resourceIndex) 11 | { 12 | Handle.Device.Handle->CreateRenderTargetView((ID3D12Resource*)resource, ref desc, heapHandle); 13 | } 14 | 15 | private protected override void OnAllocateHandle(out HeapHandleDX12 handle) 16 | { 17 | handle = Handle.Device.Heap.GetRTHandle(1); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Molten.Graphics.DX12/Resources/Views/SRViewDX12.cs: -------------------------------------------------------------------------------- 1 | using Silk.NET.Direct3D12; 2 | 3 | namespace Molten.Graphics.DX12; 4 | internal class SRViewDX12 : ViewDX12 5 | { 6 | public SRViewDX12(ResourceHandleDX12 handle) : base(handle) 7 | { } 8 | 9 | protected override unsafe void OnCreate(ref ShaderResourceViewDesc desc, ID3D12Resource1* resource, ref CpuDescriptorHandle heapHandle, uint resourceIndex) 10 | { 11 | Handle.Device.Handle->CreateShaderResourceView((ID3D12Resource*)resource, ref desc, heapHandle); 12 | } 13 | 14 | private protected override void OnAllocateHandle(out HeapHandleDX12 handle) 15 | { 16 | handle = Handle.Device.Heap.GetResourceHandle(1); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Molten.Graphics.DX12/Resources/Views/SamplerViewDX12.cs: -------------------------------------------------------------------------------- 1 | using Silk.NET.Direct3D12; 2 | 3 | namespace Molten.Graphics.DX12; 4 | internal class SamplerViewDX12 : ViewDX12 5 | { 6 | public SamplerViewDX12(ResourceHandleDX12 handle) : base(handle) 7 | { } 8 | 9 | protected override unsafe void OnCreate(ref SamplerDesc desc, ID3D12Resource1* resource, ref CpuDescriptorHandle heapHandle, uint resourceIndex) 10 | { 11 | // TODO Samplers do not use ID3D12Resource - Refactor this to be more efficient. 12 | 13 | Handle.Device.Handle->CreateSampler(desc, heapHandle); 14 | } 15 | 16 | private protected override void OnAllocateHandle(out HeapHandleDX12 handle) 17 | { 18 | handle = Handle.Device.Heap.GetSamplerHandle(1); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Molten.Graphics.DX12/Resources/Views/UAViewDX12.cs: -------------------------------------------------------------------------------- 1 | using Silk.NET.Direct3D12; 2 | 3 | namespace Molten.Graphics.DX12; 4 | internal class UAViewDX12 : ViewDX12 5 | { 6 | public UAViewDX12(ResourceHandleDX12 handle) : base(handle) 7 | { 8 | } 9 | 10 | protected override unsafe void OnCreate(ref UnorderedAccessViewDesc desc, ID3D12Resource1* resource, ref CpuDescriptorHandle heapHandle, uint resourceIndex) 11 | { 12 | // TODO Add support for counter resources. 13 | 14 | Handle.Device.Handle->CreateUnorderedAccessView((ID3D12Resource*)resource, null, ref desc, heapHandle); 15 | } 16 | 17 | private protected override void OnAllocateHandle(out HeapHandleDX12 handle) 18 | { 19 | handle = Handle.Device.Heap.GetResourceHandle(1); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Molten.Graphics.DX12/d3d12SDKLayers.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/Molten.Graphics.DX12/d3d12SDKLayers.dll -------------------------------------------------------------------------------- /Molten.Graphics.DXGI/DxgiUsage.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics.Dxgi; 2 | 3 | /// 4 | /// See: https://docs.microsoft.com/en-us/windows/win32/direct3ddxgi/dxgi-usage 5 | /// 6 | [Flags] 7 | public enum DxgiUsage : uint 8 | { 9 | None = 0, 10 | 11 | CpuAccessDynamic = 1, 12 | 13 | CpuAccessReadWrite = 2, 14 | 15 | CpuAccessScratch = 3, 16 | 17 | CpuAccessField = 15, 18 | 19 | ShaderInput = 1 << (0 + 4), 20 | 21 | RenderTargetOutput = 1 << (1 + 4), 22 | 23 | BackBuffer = 1 << (2+4), 24 | 25 | Shared = 1 << (3 + 4), 26 | 27 | ReadOnly = 1 << (4 + 4), 28 | 29 | DiscardOnPresent = 1 << (5+4), 30 | 31 | UnorderedAccess = 1 << (6 + 4), 32 | } 33 | -------------------------------------------------------------------------------- /Molten.Graphics.DXGI/WindowAssociationFlags.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics.Dxgi; 2 | 3 | [Flags] 4 | public enum WindowAssociationFlags : uint 5 | { 6 | None = 0U, 7 | 8 | NoWindowChanges = 1U, 9 | 10 | NoAltEnter = 2U, 11 | 12 | NoPrintScreen = 4U, 13 | } 14 | -------------------------------------------------------------------------------- /Molten.Graphics.Vulkan/Hardware/ExtensionBinding.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics.Vulkan; 2 | 3 | internal class ExtensionBinding 4 | { 5 | internal Dictionary Extensions = new Dictionary(); 6 | 7 | internal List Layers = new List(); 8 | } 9 | -------------------------------------------------------------------------------- /Molten.Graphics.Vulkan/Pipeline/MemoryAllocationVK.cs: -------------------------------------------------------------------------------- 1 | using Silk.NET.Vulkan; 2 | 3 | namespace Molten.Graphics.Vulkan; 4 | 5 | internal class MemoryAllocationVK 6 | { 7 | MemoryHeapVK _heap; 8 | DeviceMemory _memory; 9 | 10 | internal MemoryAllocationVK(MemoryHeapVK heap, ulong numBytes, ref DeviceMemory memory, MemoryPropertyFlags flags) 11 | { 12 | _heap = heap; 13 | Size = numBytes; 14 | _memory = memory; 15 | Flags = flags; 16 | } 17 | 18 | internal void Free() 19 | { 20 | _heap.Free(this); 21 | } 22 | 23 | public static implicit operator DeviceMemory(MemoryAllocationVK allocation) 24 | { 25 | return allocation._memory; 26 | } 27 | 28 | internal ref DeviceMemory Handle => ref _memory; 29 | 30 | internal ulong Size { get; } 31 | 32 | internal MemoryPropertyFlags Flags { get; } 33 | } 34 | -------------------------------------------------------------------------------- /Molten.Graphics.Vulkan/Resources/ImageHandleVK.cs: -------------------------------------------------------------------------------- 1 | using Silk.NET.Vulkan; 2 | 3 | namespace Molten.Graphics.Vulkan; 4 | 5 | public unsafe class ImageHandleVK : ResourceSubHandleVK 6 | { 7 | internal ImageView* _ptrView; 8 | 9 | internal override void Initialize(DeviceVK device, bool isAllocated) 10 | { 11 | base.Initialize(device, isAllocated); 12 | _ptrView = EngineUtil.Alloc(); 13 | } 14 | 15 | internal override void Release(DeviceVK device, bool isAllocated) 16 | { 17 | if (_ptrView != null) 18 | { 19 | device.VK.DestroyImageView(device, *_ptrView, null); 20 | EngineUtil.Free(ref _ptrView); 21 | } 22 | 23 | if (Ptr != null && !isAllocated) 24 | device.VK.DestroyImage(device, *Ptr, null); 25 | 26 | base.Release(device, isAllocated); 27 | } 28 | 29 | public ref ImageView* ViewPtr => ref _ptrView; 30 | } 31 | -------------------------------------------------------------------------------- /Molten.Graphics.Vulkan/Resources/Surfaces/IRenderSurfaceVK.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics.Vulkan; 2 | 3 | internal interface IRenderSurfaceVK : IRenderSurface 4 | { 5 | /// 6 | /// Gets surface clear color, if any. 7 | /// 8 | Color? ClearColor { get; set; } 9 | } 10 | -------------------------------------------------------------------------------- /Molten.Graphics.Vulkan/Resources/Textures/Texture2DVK.cs: -------------------------------------------------------------------------------- 1 | using Silk.NET.Vulkan; 2 | 3 | namespace Molten.Graphics.Vulkan; 4 | 5 | public class Texture2DVK : TextureVK, ITexture2D 6 | { 7 | internal Texture2DVK(DeviceVK device, uint width, uint height, uint mipCount, uint arraySize, 8 | AntiAliasLevel aaLevel, MSAAQuality sampleQuality, GpuResourceFormat format, 9 | GpuResourceFlags flags, string name) : 10 | base(device, 11 | new TextureDimensions(width, height, 1, mipCount, arraySize, aaLevel, sampleQuality), format, flags, name) 12 | { } 13 | 14 | protected override void SetCreateInfo(DeviceVK device, ref ImageCreateInfo imgInfo, ref ImageViewCreateInfo viewInfo) 15 | { 16 | imgInfo.ImageType = ImageType.Type2D; 17 | viewInfo.ViewType = ArraySize == 1 ? ImageViewType.Type2D : ImageViewType.Type2DArray; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Molten.Graphics.Vulkan/Resources/Textures/Texture3DVK.cs: -------------------------------------------------------------------------------- 1 | using Silk.NET.Vulkan; 2 | 3 | namespace Molten.Graphics.Vulkan; 4 | 5 | public class Texture3DVK : TextureVK, ITexture3D 6 | { 7 | public Texture3DVK(DeviceVK device, 8 | TextureDimensions dimensions, GpuResourceFormat format, GpuResourceFlags flags, string name) : 9 | base(device, dimensions, format, flags, name) 10 | { } 11 | 12 | protected override void SetCreateInfo(DeviceVK device, ref ImageCreateInfo imgInfo, ref ImageViewCreateInfo viewInfo) 13 | { 14 | imgInfo.ImageType = ImageType.Type3D; 15 | viewInfo.ViewType = ImageViewType.Type3D; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Molten.Graphics.Vulkan/Shaders/SpirvCompileTarget.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics.Vulkan; 2 | 3 | internal enum SpirvCompileTarget 4 | { 5 | Vulkan1_0 = 0, 6 | 7 | Vulkan1_1 = 1, 8 | 9 | Vulkan1_1Spirv1_4 = 2, 10 | 11 | Vulkan1_2 = 3, 12 | 13 | Vulkan1_3 = 4, 14 | 15 | Universal1_5 = 5, 16 | } 17 | -------------------------------------------------------------------------------- /Molten.Math/AngleType.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | /// 4 | /// Describes the type of angle. 5 | /// 6 | public enum AngleType 7 | { 8 | /// 9 | /// Specifies an angle measurement in revolutions. 10 | /// 11 | Revolution, 12 | 13 | /// 14 | /// Specifies an angle measurement in degrees. 15 | /// 16 | Degree, 17 | 18 | /// 19 | /// Specifies an angle measurement in radians. 20 | /// 21 | Radian, 22 | 23 | /// 24 | /// Specifies an angle measurement in gradians. 25 | /// 26 | Gradian 27 | } 28 | -------------------------------------------------------------------------------- /Molten.Math/ContainmentType.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | /// 4 | /// Describes how one bounding volume contains another. 5 | /// 6 | public enum ContainmentType 7 | { 8 | /// 9 | /// The two bounding volumes don't intersect at all. 10 | /// 11 | Disjoint, 12 | 13 | /// 14 | /// One bounding volume completely contains another. 15 | /// 16 | Contains, 17 | 18 | /// 19 | /// The two bounding volumes overlap. 20 | /// 21 | Intersects 22 | } 23 | -------------------------------------------------------------------------------- /Molten.Math/IUniformMatrix.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | /// 4 | /// Represents an implementation of a uniform matrix, where all dimensions are the same length. 5 | /// 6 | /// The underlying component type. 7 | public interface IUniformMatrix : IMatrix 8 | where T : unmanaged 9 | { 10 | void Transpose(); 11 | } 12 | -------------------------------------------------------------------------------- /Molten.Math/P2T/EdgeEvent.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | internal class EdgeEvent 4 | { 5 | public TriEdge ConstrainedEdge; 6 | 7 | public bool Right; 8 | } 9 | -------------------------------------------------------------------------------- /Molten.Math/P2T/Node.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | internal class Node 4 | { 5 | public TriPoint Point; 6 | 7 | public Triangle Triangle; 8 | 9 | public Node Next; 10 | 11 | public Node Prev; 12 | 13 | public double Value; 14 | 15 | public Node(TriPoint p) 16 | { 17 | Point = p; 18 | Value = p.X; 19 | } 20 | 21 | public Node(TriPoint p, Triangle t) 22 | { 23 | Point = p; 24 | Triangle = t; 25 | Value = p.X; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Molten.Math/P2T/SweepBasin.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | internal class SweepBasin 4 | { 5 | public Node LeftNode; 6 | 7 | public Node BottomNode; 8 | 9 | public Node RightNode; 10 | 11 | public double Width; 12 | 13 | public bool LeftHighest; 14 | 15 | public void Clear() 16 | { 17 | LeftNode = null; 18 | BottomNode = null; 19 | RightNode = null; 20 | Width = 0; 21 | LeftHighest = false; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Molten.Math/PlainIntersectionType.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | /// 4 | /// Describes the result of an intersection with a plane in three dimensions. 5 | /// 6 | public enum PlaneIntersectionType 7 | { 8 | /// 9 | /// The object is behind the plane. 10 | /// 11 | Back, 12 | 13 | /// 14 | /// The object is in front of the plane. 15 | /// 16 | Front, 17 | 18 | /// 19 | /// The object is intersecting the plane. 20 | /// 21 | Intersecting 22 | } 23 | -------------------------------------------------------------------------------- /Molten.Math/SinglePrecision/RayHit.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace Molten; 4 | 5 | /// 6 | /// Contains ray hit data. 7 | /// 8 | [Serializable] 9 | public struct RayHit 10 | { 11 | /// 12 | /// Location of the ray hit. 13 | /// 14 | [DataMember] 15 | public Vector3F Location; 16 | /// 17 | /// Normal of the ray hit. 18 | /// 19 | [DataMember] 20 | public Vector3F Normal; 21 | 22 | /// 23 | /// T parameter of the ray hit. 24 | /// The ray hit location is equal to the ray origin added to the ray direction multiplied by T. 25 | /// 26 | [DataMember] 27 | public float T; 28 | } 29 | -------------------------------------------------------------------------------- /Molten.Math/TriangleSidedness.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | /// 4 | /// Sidedness of a triangle or mesh. 5 | /// A triangle can be double sided, or allow one of its sides to let interacting objects through. 6 | /// 7 | public enum TriangleSidedness 8 | { 9 | /// 10 | /// The triangle will interact with objects coming from both directions. 11 | /// 12 | DoubleSided, 13 | 14 | /// 15 | /// The triangle will interact with objects from which the winding of the triangle appears to be clockwise. 16 | /// 17 | Clockwise, 18 | 19 | /// 20 | /// The triangle will interact with objects from which the winding of the triangle appears to be counterclockwise.. 21 | /// 22 | Counterclockwise 23 | } 24 | -------------------------------------------------------------------------------- /Molten.Math/Winding.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | /// 4 | /// The winding of a set of points. 5 | /// 6 | public enum Winding 7 | { 8 | Clockwise = 0, 9 | 10 | CounterClockwise = 1, 11 | 12 | Collinear = 2, 13 | } 14 | -------------------------------------------------------------------------------- /Molten.Math/def_angles.json: -------------------------------------------------------------------------------- 1 | { 2 | "FieldNames": [ "Radians" ], 3 | "FieldLabels": [ "radians" ], 4 | "SubFolder": "", 5 | "Fields": { 6 | "0": { 7 | "Names": [ "Radians" ], 8 | "Labels": [ "radians" ] 9 | } 10 | }, 11 | 12 | "Types": [ 13 | { 14 | "DefName": "AngleF", 15 | "DataTypeName": "float", 16 | "Sizes": [ 1 ] 17 | }, 18 | { 19 | "DefName": "AngleD", 20 | "DataTypeName": "double", 21 | "Sizes": [ 1 ] 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /Molten.Math/def_colors.json: -------------------------------------------------------------------------------- 1 | { 2 | "SubFolder": "Colors", 3 | "Fields": { 4 | "3": { 5 | "Names": [ "R", "G", "B" ], 6 | "Labels": [ "red", "green", "blue" ] 7 | }, 8 | "4": { 9 | "Names": [ "R", "G", "B", "A" ], 10 | "Labels": [ "red", "green", "blue", "alpha" ] 11 | } 12 | }, 13 | 14 | "Types": [ 15 | { 16 | "DefName": "Color{size}", 17 | "DataTypeName": "float", 18 | "Sizes": [ 3, 4 ] 19 | }, 20 | { 21 | "DefName": "Color{size}D", 22 | "DataTypeName": "double", 23 | "Sizes": [ 3, 4 ] 24 | } 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /Molten.Math/def_quaternions.json: -------------------------------------------------------------------------------- 1 | { 2 | "SubFolder": "", 3 | "Fields": { 4 | "0": { 5 | "Names": [ "X", "Y", "Z", "W" ] 6 | } 7 | }, 8 | 9 | "Types": [ 10 | { 11 | "DefName": "QuaternionF", 12 | "DataTypeName": "float", 13 | "Sizes": [ 4 ] 14 | }, 15 | { 16 | "DefName": "QuaternionD", 17 | "DataTypeName": "double", 18 | "Sizes": [ 4 ] 19 | } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /Molten.Math/def_rectangles.json: -------------------------------------------------------------------------------- 1 | { 2 | "SubFolder": "Rectangles", 3 | "Fields": { 4 | "4": { 5 | "Names": [ "Left", "Top", "Right", "Bottom" ] 6 | } 7 | }, 8 | 9 | "Types": [ 10 | { 11 | "DefName": "Rectangle", 12 | "DataTypeName": "int", 13 | "Sizes": [ 4 ] 14 | }, 15 | { 16 | "DefName": "RectangleUI", 17 | "DataTypeName": "uint", 18 | "Sizes": [ 4 ] 19 | }, 20 | { 21 | "DefName": "RectangleL", 22 | "DataTypeName": "long", 23 | "Sizes": [ 4 ] 24 | }, 25 | { 26 | "DefName": "RectangleUL", 27 | "DataTypeName": "ulong", 28 | "Sizes": [ 4 ] 29 | }, 30 | { 31 | "DefName": "RectangleF", 32 | "DataTypeName": "float", 33 | "Sizes": [ 4 ] 34 | }, 35 | { 36 | "DefName": "RectangleD", 37 | "DataTypeName": "double", 38 | "Sizes": [ 4 ] 39 | } 40 | ] 41 | } -------------------------------------------------------------------------------- /Molten.Math/t4_angles.cs: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /Molten.Math/t4_colors.cs: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /Molten.Math/t4_header.cs: -------------------------------------------------------------------------------- 1 |  2 | -------------------------------------------------------------------------------- /Molten.Math/t4_matrix.cs: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /Molten.Math/t4_matrix2.cs: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /Molten.Math/t4_matrix2x3.cs: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /Molten.Math/t4_matrix3.cs: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /Molten.Math/t4_matrix3x2.cs: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /Molten.Math/t4_matrix4.cs: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /Molten.Math/t4_quaternions.cs: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /Molten.Math/t4_rectangles.cs: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /Molten.Math/t4_vector.cs: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /Molten.Math/t4_vector.fp.cs: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /Molten.Math/t4_vector2.cs: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /Molten.Math/t4_vector2.fp.cs: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /Molten.Math/t4_vector3.cs: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /Molten.Math/t4_vector3.fp.cs: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /Molten.Math/t4_vector4.fp.cs: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /Molten.Utility/ArrayExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | public static class ArrayExtensions 4 | { 5 | public static int IndexOf(this T[] array, T obj) 6 | { 7 | return Array.IndexOf(array, obj); 8 | } 9 | 10 | public static bool Contains(this T[] array, T obj) 11 | { 12 | return Array.IndexOf(array, obj) > -1; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Molten.Utility/Collections/ThreadedHashSet.Structures.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Utility.Collections; 2 | 3 | public partial class ThreadedHashSet 4 | { 5 | /// Used for set checking operations (using enumerables) that rely on counting 6 | internal struct ElementCount 7 | { 8 | internal int uniqueCount; 9 | internal int unfoundCount; 10 | } 11 | 12 | internal struct Slot 13 | { 14 | internal int hashCode; // Lower 31 bits of hash code, -1 if unused 15 | internal T value; 16 | internal int next; // Index of next entry, -1 if last 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Molten.Utility/Comparers/IntPtrComparer.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Comparers; 2 | 3 | public class IntPtrComparer : IComparer 4 | { 5 | public unsafe int Compare(IntPtr x, IntPtr y) 6 | { 7 | nuint ix = (nuint)x.ToPointer(); 8 | nuint iy = (nuint)y.ToPointer(); 9 | 10 | if (ix < iy) 11 | return -1; 12 | else if (ix > iy) 13 | return 1; 14 | else 15 | return 0; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Molten.Utility/Delegates/MoltenEventHandler.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Utility; 2 | 3 | public delegate void MoltenEventHandler(T o); 4 | 5 | public delegate void MoltenEventHandler(T o1, U o2); 6 | -------------------------------------------------------------------------------- /Molten.Utility/Hardware/DeviceVendor.cs: -------------------------------------------------------------------------------- 1 | namespace Molten.Graphics; 2 | 3 | public enum DeviceVendor 4 | { 5 | /// 6 | /// The vendor could not be determined. 7 | /// 8 | Unknown = 0, 9 | 10 | /// 11 | /// Advanced Micro Devices. 12 | /// 13 | AMD = 1, 14 | 15 | /// 16 | /// Intel Corporation. 17 | /// 18 | Intel = 2, 19 | 20 | /// 21 | /// Nvidia Corporation. 22 | /// 23 | Nvidia = 3, 24 | 25 | // ====== Vulkan vendor IDs ======= 26 | // See: https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VkVendorId 27 | 28 | VIV = 0x10001, 29 | 30 | VSI = 0x10002, 31 | 32 | KAZAN = 0x10003, 33 | 34 | CODEPLAY = 0x10004, 35 | 36 | MESA = 0x10005, 37 | 38 | POCL = 0x10006, 39 | } 40 | -------------------------------------------------------------------------------- /Molten.Utility/NativeUtil.cs: -------------------------------------------------------------------------------- 1 | using Silk.NET.Core.Native; 2 | 3 | namespace Molten; 4 | 5 | public unsafe static class NativeUtil 6 | { 7 | /// Releases the specified pointer, sets it to null and returns the updated, unmanaged reference count. 8 | /// The type of pointer. 9 | /// The pointer. 10 | /// The new pointer reference count. 11 | public static uint ReleasePtr(ref T* ptr) 12 | where T : unmanaged 13 | { 14 | if (ptr == null) 15 | return 0; 16 | 17 | uint r = ((IUnknown*)ptr)->Release(); 18 | ptr = null; 19 | return r; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Molten.Utility/ReorderMode.cs: -------------------------------------------------------------------------------- 1 | namespace Molten; 2 | 3 | public enum ReorderMode 4 | { 5 | /// 6 | /// Pushes an item backward by one ID. 7 | /// 8 | PushBackward, 9 | 10 | /// 11 | /// Pushes an item forward by one ID. 12 | /// 13 | PushForward, 14 | 15 | /// 16 | /// Sends an item to the back of a list or collection. 17 | /// 18 | SendToBack, 19 | 20 | /// 21 | /// Sends an item to the front of a list or collection. 22 | /// 23 | BringToFront, 24 | } 25 | -------------------------------------------------------------------------------- /Molten.Utility/StringHelper.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | using System.Text; 3 | 4 | namespace Molten; 5 | 6 | public static class StringHelper 7 | { 8 | public static byte[] GetBytes(object o) 9 | { 10 | int size = Marshal.SizeOf(o); 11 | byte[] arr = new byte[size]; 12 | IntPtr ptr = Marshal.AllocHGlobal(size); 13 | Marshal.StructureToPtr(o, ptr, true); 14 | Marshal.Copy(ptr, arr, 0, size); 15 | Marshal.FreeHGlobal(ptr); 16 | return arr; 17 | } 18 | 19 | public static byte[] GetBytes(string str, Encoding encoding) 20 | { 21 | return encoding.GetBytes(str); ; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /SRC/test_texture.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/SRC/test_texture.psd -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-midnight 2 | markdown: GFM -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | ############### 2 | # folder # 3 | ############### 4 | /**/DROP/ 5 | /**/TEMP/ 6 | /**/packages/ 7 | /**/bin/ 8 | /**/obj/ 9 | 10 | -------------------------------------------------------------------------------- /docs/api/.gitignore: -------------------------------------------------------------------------------- 1 | ############### 2 | # temp file # 3 | ############### 4 | .manifest 5 | -------------------------------------------------------------------------------- /docs/api/index.md: -------------------------------------------------------------------------------- 1 | # PLACEHOLDER 2 | TODO: Add .NET projects to the *src* folder and run `docfx` to generate **REAL** *API Documentation*! 3 | -------------------------------------------------------------------------------- /docs/api/toc.yml: -------------------------------------------------------------------------------- 1 | - name: TO BE REPLACED 2 | href: index.md 3 | -------------------------------------------------------------------------------- /docs/articles/changelog.md: -------------------------------------------------------------------------------- 1 | # Changelogs 2 | 3 | Here is a list of all available changelogs, sorted from latest to oldest version. 4 | - [Version 0.7.4](changelogs/CHANGELOG_0_7_4.html) 5 | - [Version 0.7.3](changelogs/CHANGELOG_0_7_3.html) 6 | - [Version 0.7.2](changelogs/CHANGELOG_0_7_2.html) 7 | - [Version 0.7.1](changelogs/CHANGELOG_0_7_1.html) 8 | - [Version 0.7](changelogs/CHANGELOG_0_7.html) 9 | - [Version 0.6](changelogs/CHANGELOG_0_6.html) 10 | - [Version 0.5](changelogs/CHANGELOG_0_5.html) 11 | - [Version 0.4](changelogs/CHANGELOG_0_4.html) 12 | - [Version 0.3](changelogs/CHANGELOG_0_3.html) 13 | - [Version 0.2](changelogs/CHANGELOG_0_2.html) 14 | - Version 0.1 - No changelogs available 15 | -------------------------------------------------------------------------------- /docs/articles/changelogs/CHANGELOG_0_2.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/docs/articles/changelogs/CHANGELOG_0_2.md -------------------------------------------------------------------------------- /docs/articles/changelogs/CHANGELOG_0_3.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/docs/articles/changelogs/CHANGELOG_0_3.md -------------------------------------------------------------------------------- /docs/articles/changelogs/CHANGELOG_0_7_2.md: -------------------------------------------------------------------------------- 1 | # Version 0.7.2 Changelog 2 |
3 | 4 | | Commit | Changes | 5 | | ------ | ------- | 6 | | [[477453d2](https://github.com/Syncaidius/MoltenEngine/commits/477453d2fa7389596b4ce5ad09e4994cff25f376)] | Updated V0.7.2 changelog | | [[f4ca7fe8](https://github.com/Syncaidius/MoltenEngine/commits/f4ca7fe83beb2c556081f1935af33d9db763d1eb)] | [Engine] Begin removing foreach from tight render/update areas | | [[d0a3142e](https://github.com/Syncaidius/MoltenEngine/commits/d0a3142e40dd07cfd55eb7e0cd99aca05da4d273)] | [Engine] Fixed SceneComponentCollection.RemoveByType() not functioning | | [[95cb2dee](https://github.com/Syncaidius/MoltenEngine/commits/95cb2dee93a54a48fe5eaebc82d6ed7c6fd8d66c)] | Bump project to version 0.7.2 | | [[d3136e72](https://github.com/Syncaidius/MoltenEngine/commits/d3136e728bc394f3d056980a7d2c9f24f2f6266d)] | [Graphics] Fixed format exception in profiler overlay | 7 | -------------------------------------------------------------------------------- /docs/articles/toc.yml: -------------------------------------------------------------------------------- 1 | - name: Changelog 2 | href: changelog.md 3 | -------------------------------------------------------------------------------- /docs/molten-template/ManagedReference.extension.js: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | /** 5 | * This method will be called at the start of exports.transform in ManagedReference.html.primary.js 6 | */ 7 | exports.preTransform = function (model) { 8 | return model; 9 | } 10 | 11 | /** 12 | * This method will be called at the end of exports.transform in ManagedReference.html.primary.js 13 | */ 14 | exports.postTransform = function (model) { 15 | return model; 16 | } -------------------------------------------------------------------------------- /docs/molten-template/ManagedReference.html.primary.tmpl: -------------------------------------------------------------------------------- 1 | {{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}} 2 | {{!master(layout/_master.tmpl)}} 3 | 4 | {{#isNamespace}} 5 | {{>partials/namespace}} 6 | {{/isNamespace}} 7 | 8 | {{#_splitReference}} 9 | {{#isClass}} 10 | {{>partials/class.memberpage}} 11 | {{/isClass}} 12 | {{/_splitReference}} 13 | {{^_splitReference}} 14 | {{#isClass}} 15 | {{>partials/class}} 16 | {{/isClass}} 17 | {{/_splitReference}} 18 | 19 | {{#isEnum}} 20 | {{>partials/enum}} 21 | {{/isEnum}} 22 | {{>partials/customMREFContent}} -------------------------------------------------------------------------------- /docs/molten-template/RestApi.extension.js: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | /** 5 | * This method will be called at the start of exports.transform in RestApi.html.primary.js 6 | */ 7 | exports.preTransform = function (model) { 8 | return model; 9 | } 10 | 11 | /** 12 | * This method will be called at the end of exports.transform in RestApi.html.primary.js 13 | */ 14 | exports.postTransform = function (model) { 15 | return model; 16 | } -------------------------------------------------------------------------------- /docs/molten-template/RestApi.html.primary.tmpl: -------------------------------------------------------------------------------- 1 | {{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}} 2 | {{!master(layout/_master.tmpl)}} 3 | {{>partials/rest}} -------------------------------------------------------------------------------- /docs/molten-template/UniversalReference.extension.js: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | /** 5 | * This method will be called at the start of exports.transform in UniversalReference.html.primary.js 6 | */ 7 | exports.preTransform = function (model) { 8 | return model; 9 | } 10 | 11 | /** 12 | * This method will be called at the end of exports.transform in UniversalReference.html.primary.js 13 | */ 14 | exports.postTransform = function (model) { 15 | return model; 16 | } -------------------------------------------------------------------------------- /docs/molten-template/UniversalReference.html.primary.tmpl: -------------------------------------------------------------------------------- 1 | {{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}} 2 | {{!master(layout/_master.tmpl)}} 3 | 4 | {{#isNamespace}} 5 | {{>partials/uref/namespace}} 6 | {{/isNamespace}} 7 | {{#isClass}} 8 | {{>partials/uref/class}} 9 | {{/isClass}} 10 | {{#isEnum}} 11 | {{>partials/enum}} 12 | {{/isEnum}} 13 | -------------------------------------------------------------------------------- /docs/molten-template/conceptual.extension.js: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | /** 5 | * This method will be called at the start of exports.transform in conceptual.html.primary.js 6 | */ 7 | exports.preTransform = function (model) { 8 | return model; 9 | } 10 | 11 | /** 12 | * This method will be called at the end of exports.transform in conceptual.html.primary.js 13 | */ 14 | exports.postTransform = function (model) { 15 | return model; 16 | } -------------------------------------------------------------------------------- /docs/molten-template/conceptual.html.primary.js: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | var common = require('./common.js'); 5 | var extension = require('./conceptual.extension.js') 6 | 7 | exports.transform = function (model) { 8 | if (extension && extension.preTransform) { 9 | model = extension.preTransform(model); 10 | } 11 | 12 | model._disableToc = model._disableToc || !model._tocPath || (model._navPath === model._tocPath); 13 | model.docurl = model.docurl || common.getImproveTheDocHref(model, model._gitContribute, model._gitUrlPattern); 14 | 15 | if (extension && extension.postTransform) { 16 | model = extension.postTransform(model); 17 | } 18 | 19 | return model; 20 | } -------------------------------------------------------------------------------- /docs/molten-template/conceptual.html.primary.tmpl: -------------------------------------------------------------------------------- 1 | {{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}} 2 | {{!master(layout/_master.tmpl)}} 3 | {{{rawTitle}}} 4 | {{{conceptual}}} -------------------------------------------------------------------------------- /docs/molten-template/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/docs/molten-template/favicon.ico -------------------------------------------------------------------------------- /docs/molten-template/partials/breadcrumb.tmpl.partial: -------------------------------------------------------------------------------- 1 | {{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}} 2 | 3 | 10 | -------------------------------------------------------------------------------- /docs/molten-template/partials/classSubtitle.tmpl.partial: -------------------------------------------------------------------------------- 1 | {{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}} 2 | {{#inConstructor}} 3 | {{__global.constructorsInSubtitle}} 4 | {{/inConstructor}} 5 | {{#inField}} 6 | {{__global.fieldsInSubtitle}} 7 | {{/inField}} 8 | {{#inProperty}} 9 | {{__global.propertiesInSubtitle}} 10 | {{/inProperty}} 11 | {{#inMethod}} 12 | {{__global.methodsInSubtitle}} 13 | {{/inMethod}} 14 | {{#inEvent}} 15 | {{__global.eventsInSubtitle}} 16 | {{/inEvent}} 17 | {{#inOperator}} 18 | {{__global.operatorsInSubtitle}} 19 | {{/inOperator}} 20 | {{#inEii}} 21 | {{__global.eiisInSubtitle}} 22 | {{/inEii}} 23 | {{#inFunction}} 24 | {{__global.functionsInSubtitle}} 25 | {{/inFunction}} 26 | {{#inMember}} 27 | {{__global.membersInSubtitle}} 28 | {{/inMember}} -------------------------------------------------------------------------------- /docs/molten-template/partials/customMREFContent.tmpl.partial: -------------------------------------------------------------------------------- 1 | {{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}} 2 | {{!Add your own custom template for the content for ManagedReference here}} 3 | {{#_splitReference}} 4 | {{#isCollection}} 5 | {{>partials/collection}} 6 | {{/isCollection}} 7 | {{#isItem}} 8 | {{>partials/item}} 9 | {{/isItem}} 10 | {{/_splitReference}} -------------------------------------------------------------------------------- /docs/molten-template/partials/dd-li.tmpl.partial: -------------------------------------------------------------------------------- 1 | {{#items}} 2 |
  • {{name}}
  • 3 | {{/items}} 4 | -------------------------------------------------------------------------------- /docs/molten-template/partials/footer.tmpl.partial: -------------------------------------------------------------------------------- 1 | {{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}} 2 | 3 |
    4 |
    5 | 14 |
    15 | -------------------------------------------------------------------------------- /docs/molten-template/partials/item.tmpl.partial: -------------------------------------------------------------------------------- 1 | {{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}} 2 | 3 | {{>partials/class.header}} -------------------------------------------------------------------------------- /docs/molten-template/partials/logo.tmpl.partial: -------------------------------------------------------------------------------- 1 | {{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}} 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /docs/molten-template/partials/namespace.tmpl.partial: -------------------------------------------------------------------------------- 1 | {{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}} 2 | 3 |

    {{>partials/title}}

    4 |
    {{{summary}}}
    5 |
    {{{conceptual}}}
    6 |
    {{{remarks}}}
    7 | {{#children}} 8 |

    {{>partials/namespaceSubtitle}}

    9 | {{#children}} 10 |

    11 |
    {{{summary}}}
    12 | {{/children}} 13 | {{/children}} 14 | -------------------------------------------------------------------------------- /docs/molten-template/partials/namespaceSubtitle.tmpl.partial: -------------------------------------------------------------------------------- 1 | {{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}} 2 | 3 | {{#inNamespace}} 4 | {{__global.namespacesInSubtitle}} 5 | {{/inNamespace}} 6 | {{#inClass}} 7 | {{__global.classesInSubtitle}} 8 | {{/inClass}} 9 | {{#inStruct}} 10 | {{__global.structsInSubtitle}} 11 | {{/inStruct}} 12 | {{#inInterface}} 13 | {{__global.interfacesInSubtitle}} 14 | {{/inInterface}} 15 | {{#inEnum}} 16 | {{__global.enumsInSubtitle}} 17 | {{/inEnum}} 18 | {{#inDelegate}} 19 | {{__global.delegatesInSubtitle}} 20 | {{/inDelegate}} 21 | {{#inFunction}} 22 | {{__global.functionsInSubtitle}} 23 | {{/inFunction}} 24 | {{#inVariable}} 25 | {{__global.variablesInSubtitle}} 26 | {{/inVariable}} 27 | {{#inTypeAlias}} 28 | {{__global.typeAliasesInSubtitle}} 29 | {{/inTypeAlias}} 30 | -------------------------------------------------------------------------------- /docs/molten-template/partials/scripts.tmpl.partial: -------------------------------------------------------------------------------- 1 | {{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}} 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /docs/molten-template/partials/searchResults.tmpl.partial: -------------------------------------------------------------------------------- 1 | {{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}} 2 | 3 |
    4 |
    {{__global.searchResults}}
    5 |
    6 |

    7 |
    8 |
      9 |
      10 | -------------------------------------------------------------------------------- /docs/molten-template/partials/toc.tmpl.partial: -------------------------------------------------------------------------------- 1 | {{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}} 2 | 3 | 9 | -------------------------------------------------------------------------------- /docs/molten-template/partials/uref/inheritance.tmpl.partial: -------------------------------------------------------------------------------- 1 | {{#inheritance}} 2 | {{>partials/uref/inheritance}} 3 | {{/inheritance}} 4 |
      {{{type.specName.0.value}}}
      5 | -------------------------------------------------------------------------------- /docs/molten-template/partials/uref/parameters.tmpl.partial: -------------------------------------------------------------------------------- 1 | {{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}} 2 | 3 | {{#properties.0}} 4 |
      Properties
      5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | {{/properties.0}} 15 | {{#properties}} 16 | 17 | 18 | 19 | 23 | 24 | {{/properties}} 25 | {{#properties.0}} 26 | 27 |
      {{__global.type}}{{__global.name}}{{__global.description}}
      {{{type.specName.0.value}}}{{{id}}} 20 | {{{description}}} 21 | {{>partials/parameters}} 22 |
      28 | {{/properties.0}} -------------------------------------------------------------------------------- /docs/molten-template/styles/glyphicons-halflings-regular-ACNUA6UY.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/docs/molten-template/styles/glyphicons-halflings-regular-ACNUA6UY.ttf -------------------------------------------------------------------------------- /docs/molten-template/styles/glyphicons-halflings-regular-JOUF32XT.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/docs/molten-template/styles/glyphicons-halflings-regular-JOUF32XT.woff -------------------------------------------------------------------------------- /docs/molten-template/styles/glyphicons-halflings-regular-PIHUWCJO.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/docs/molten-template/styles/glyphicons-halflings-regular-PIHUWCJO.eot -------------------------------------------------------------------------------- /docs/molten-template/styles/glyphicons-halflings-regular-W4DYDFZM.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncaidius/MoltenEngine/b81decc013b3bbed27afaa674c3fc32aa38d664e/docs/molten-template/styles/glyphicons-halflings-regular-W4DYDFZM.woff2 -------------------------------------------------------------------------------- /docs/molten-template/styles/main.js: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | -------------------------------------------------------------------------------- /docs/molten-template/toc.extension.js: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | /** 5 | * This method will be called at the start of exports.transform in toc.html.js 6 | */ 7 | exports.preTransform = function (model) { 8 | return model; 9 | } 10 | 11 | /** 12 | * This method will be called at the end of exports.transform in toc.html.js 13 | */ 14 | exports.postTransform = function (model) { 15 | return model; 16 | } -------------------------------------------------------------------------------- /docs/molten-template/toc.html.tmpl: -------------------------------------------------------------------------------- 1 | {{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}} 2 | 3 |
      4 |
      5 | {{^_disableSideFilter}} 6 |
      7 |
      8 | 9 | 10 | 11 |
      12 |
      13 | {{/_disableSideFilter}} 14 |
      15 |
      16 | {{^leaf}} 17 | {{>partials/li}} 18 | {{/leaf}} 19 |
      20 |
      21 |
      22 |
      -------------------------------------------------------------------------------- /docs/toc.yml: -------------------------------------------------------------------------------- 1 | - name: Articles 2 | href: articles/ 3 | - name: Api Documentation 4 | href: api/ 5 | homepage: api/index.md 6 | - name: GitHub 7 | href: https://github.com/Syncaidius/MoltenEngine/ 8 | - name: NuGet 9 | href: https://www.nuget.org/packages?q=syncaidius 10 | --------------------------------------------------------------------------------