├── .gitattributes ├── .gitignore ├── .gitmodules ├── README.md ├── RmlUi ├── .gitignore ├── Dependencies │ ├── include │ │ ├── freetype │ │ │ ├── config │ │ │ │ ├── ftconfig.h │ │ │ │ ├── ftheader.h │ │ │ │ ├── ftmodule.h │ │ │ │ ├── ftoption.h │ │ │ │ ├── ftstdlib.h │ │ │ │ ├── integer-types.h │ │ │ │ ├── mac-support.h │ │ │ │ └── public-macros.h │ │ │ ├── freetype.h │ │ │ ├── ftadvanc.h │ │ │ ├── ftbbox.h │ │ │ ├── ftbdf.h │ │ │ ├── ftbitmap.h │ │ │ ├── ftbzip2.h │ │ │ ├── ftcache.h │ │ │ ├── ftchapters.h │ │ │ ├── ftcid.h │ │ │ ├── ftcolor.h │ │ │ ├── ftdriver.h │ │ │ ├── fterrdef.h │ │ │ ├── fterrors.h │ │ │ ├── ftfntfmt.h │ │ │ ├── ftgasp.h │ │ │ ├── ftglyph.h │ │ │ ├── ftgxval.h │ │ │ ├── ftgzip.h │ │ │ ├── ftimage.h │ │ │ ├── ftincrem.h │ │ │ ├── ftlcdfil.h │ │ │ ├── ftlist.h │ │ │ ├── ftlogging.h │ │ │ ├── ftlzw.h │ │ │ ├── ftmac.h │ │ │ ├── ftmm.h │ │ │ ├── ftmodapi.h │ │ │ ├── ftmoderr.h │ │ │ ├── ftotval.h │ │ │ ├── ftoutln.h │ │ │ ├── ftparams.h │ │ │ ├── ftpfr.h │ │ │ ├── ftrender.h │ │ │ ├── ftsizes.h │ │ │ ├── ftsnames.h │ │ │ ├── ftstroke.h │ │ │ ├── ftsynth.h │ │ │ ├── ftsystem.h │ │ │ ├── fttrigon.h │ │ │ ├── fttypes.h │ │ │ ├── ftwinfnt.h │ │ │ ├── otsvg.h │ │ │ ├── t1tables.h │ │ │ ├── ttnameid.h │ │ │ ├── tttables.h │ │ │ └── tttags.h │ │ ├── ft2build.h │ │ ├── lunasvg.h │ │ └── rlottie.h │ └── libs │ │ ├── lunasvg-Debug-x86.lib │ │ ├── lunasvg-debug-x64.lib │ │ ├── lunasvg-release-x64.lib │ │ ├── lunasvg-release-x86.lib │ │ ├── rlottie-debug-x64.lib │ │ ├── rlottie-debug-x86.lib │ │ ├── rlottie-release-x64.lib │ │ └── rlottie-release-x86.lib ├── README.md ├── RmlCore │ ├── RmlCore.props │ ├── RmlCore.vcxproj │ └── RmlCore.vcxproj.filters ├── RmlDebugger │ ├── RmlDebugger.props │ ├── RmlDebugger.vcxproj │ └── RmlDebugger.vcxproj.filters ├── RmlLottie │ ├── RmlLottie.props │ ├── RmlLottie.vcxproj │ └── RmlLottie.vcxproj.filters ├── RmlSvg │ ├── RmlSvg.props │ ├── RmlSvg.vcxproj │ └── RmlSvg.vcxproj.filters ├── RmlUi.sln └── src │ └── RmlUi │ ├── Include │ └── RmlUi │ │ ├── Config │ │ └── Config.h │ │ ├── Core.h │ │ ├── Core │ │ ├── Animation.h │ │ ├── BaseXMLParser.h │ │ ├── Box.h │ │ ├── CallbackTexture.h │ │ ├── Colour.h │ │ ├── Colour.inl │ │ ├── CompiledFilterShader.h │ │ ├── ComputedValues.h │ │ ├── Containers │ │ │ ├── LICENSE.txt │ │ │ ├── itlib │ │ │ │ ├── flat_map.hpp │ │ │ │ └── flat_set.hpp │ │ │ └── robin_hood.h │ │ ├── Context.h │ │ ├── ContextInstancer.h │ │ ├── ConvolutionFilter.h │ │ ├── Core.h │ │ ├── DataModelHandle.h │ │ ├── DataStructHandle.h │ │ ├── DataTypeRegister.h │ │ ├── DataTypes.h │ │ ├── DataVariable.h │ │ ├── Debug.h │ │ ├── DecorationTypes.h │ │ ├── Decorator.h │ │ ├── Dictionary.h │ │ ├── EffectSpecification.h │ │ ├── Element.h │ │ ├── Element.inl │ │ ├── ElementDocument.h │ │ ├── ElementInstancer.h │ │ ├── ElementScroll.h │ │ ├── ElementText.h │ │ ├── ElementUtilities.h │ │ ├── Elements │ │ │ ├── ElementForm.h │ │ │ ├── ElementFormControl.h │ │ │ ├── ElementFormControlInput.h │ │ │ ├── ElementFormControlSelect.h │ │ │ ├── ElementFormControlTextArea.h │ │ │ ├── ElementProgress.h │ │ │ └── ElementTabSet.h │ │ ├── Event.h │ │ ├── EventInstancer.h │ │ ├── EventListener.h │ │ ├── EventListenerInstancer.h │ │ ├── Factory.h │ │ ├── FileInterface.h │ │ ├── Filter.h │ │ ├── FontEffect.h │ │ ├── FontEffectInstancer.h │ │ ├── FontEngineInterface.h │ │ ├── FontGlyph.h │ │ ├── FontMetrics.h │ │ ├── Geometry.h │ │ ├── Header.h │ │ ├── ID.h │ │ ├── Input.h │ │ ├── Log.h │ │ ├── Math.h │ │ ├── Matrix4.h │ │ ├── Matrix4.inl │ │ ├── Mesh.h │ │ ├── MeshUtilities.h │ │ ├── NumericValue.h │ │ ├── ObserverPtr.h │ │ ├── Platform.h │ │ ├── Plugin.h │ │ ├── Profiling.h │ │ ├── PropertiesIteratorView.h │ │ ├── Property.h │ │ ├── PropertyDefinition.h │ │ ├── PropertyDictionary.h │ │ ├── PropertyIdSet.h │ │ ├── PropertyParser.h │ │ ├── PropertySpecification.h │ │ ├── Rectangle.h │ │ ├── RenderInterface.h │ │ ├── RenderInterfaceCompatibility.h │ │ ├── RenderManager.h │ │ ├── ScriptInterface.h │ │ ├── ScrollTypes.h │ │ ├── Span.h │ │ ├── Spritesheet.h │ │ ├── StableVector.h │ │ ├── Stream.h │ │ ├── StreamMemory.h │ │ ├── StringUtilities.h │ │ ├── StyleSheet.h │ │ ├── StyleSheetContainer.h │ │ ├── StyleSheetSpecification.h │ │ ├── StyleSheetTypes.h │ │ ├── StyleTypes.h │ │ ├── SystemInterface.h │ │ ├── TextInputContext.h │ │ ├── TextInputHandler.h │ │ ├── TextShapingContext.h │ │ ├── Texture.h │ │ ├── Traits.h │ │ ├── Transform.h │ │ ├── TransformPrimitive.h │ │ ├── Tween.h │ │ ├── TypeConverter.h │ │ ├── TypeConverter.inl │ │ ├── Types.h │ │ ├── URL.h │ │ ├── UniqueRenderResource.h │ │ ├── Unit.h │ │ ├── Utilities.h │ │ ├── Variant.h │ │ ├── Variant.inl │ │ ├── Vector2.h │ │ ├── Vector2.inl │ │ ├── Vector3.h │ │ ├── Vector3.inl │ │ ├── Vector4.h │ │ ├── Vector4.inl │ │ ├── Vertex.h │ │ ├── XMLNodeHandler.h │ │ └── XMLParser.h │ │ ├── Debugger.h │ │ ├── Debugger │ │ ├── Debugger.h │ │ └── Header.h │ │ ├── Lottie │ │ └── ElementLottie.h │ │ └── SVG │ │ └── ElementSVG.h │ └── RmlUi │ ├── Core │ ├── BaseXMLParser.cpp │ ├── Box.cpp │ ├── CMakeLists.txt │ ├── CallbackTexture.cpp │ ├── Clock.cpp │ ├── Clock.h │ ├── CompiledFilterShader.cpp │ ├── ComputeProperty.cpp │ ├── ComputeProperty.h │ ├── ComputedValues.cpp │ ├── Context.cpp │ ├── ContextInstancer.cpp │ ├── ContextInstancerDefault.cpp │ ├── ContextInstancerDefault.h │ ├── ControlledLifetimeResource.h │ ├── ConvolutionFilter.cpp │ ├── Core.cpp │ ├── DataController.cpp │ ├── DataController.h │ ├── DataControllerDefault.cpp │ ├── DataControllerDefault.h │ ├── DataExpression.cpp │ ├── DataExpression.h │ ├── DataModel.cpp │ ├── DataModel.h │ ├── DataModelHandle.cpp │ ├── DataTypeRegister.cpp │ ├── DataVariable.cpp │ ├── DataView.cpp │ ├── DataView.h │ ├── DataViewDefault.cpp │ ├── DataViewDefault.h │ ├── Decorator.cpp │ ├── DecoratorGradient.cpp │ ├── DecoratorGradient.h │ ├── DecoratorNinePatch.cpp │ ├── DecoratorNinePatch.h │ ├── DecoratorShader.cpp │ ├── DecoratorShader.h │ ├── DecoratorTiled.cpp │ ├── DecoratorTiled.h │ ├── DecoratorTiledBox.cpp │ ├── DecoratorTiledBox.h │ ├── DecoratorTiledHorizontal.cpp │ ├── DecoratorTiledHorizontal.h │ ├── DecoratorTiledImage.cpp │ ├── DecoratorTiledImage.h │ ├── DecoratorTiledVertical.cpp │ ├── DecoratorTiledVertical.h │ ├── DocumentHeader.cpp │ ├── DocumentHeader.h │ ├── EffectSpecification.cpp │ ├── Element.cpp │ ├── ElementAnimation.cpp │ ├── ElementAnimation.h │ ├── ElementBackgroundBorder.cpp │ ├── ElementBackgroundBorder.h │ ├── ElementDefinition.cpp │ ├── ElementDefinition.h │ ├── ElementDocument.cpp │ ├── ElementEffects.cpp │ ├── ElementEffects.h │ ├── ElementHandle.cpp │ ├── ElementHandle.h │ ├── ElementInstancer.cpp │ ├── ElementMeta.cpp │ ├── ElementMeta.h │ ├── ElementScroll.cpp │ ├── ElementStyle.cpp │ ├── ElementStyle.h │ ├── ElementText.cpp │ ├── ElementUtilities.cpp │ ├── Elements │ │ ├── CMakeLists.txt │ │ ├── ElementForm.cpp │ │ ├── ElementFormControl.cpp │ │ ├── ElementFormControlInput.cpp │ │ ├── ElementFormControlSelect.cpp │ │ ├── ElementFormControlTextArea.cpp │ │ ├── ElementImage.cpp │ │ ├── ElementImage.h │ │ ├── ElementLabel.cpp │ │ ├── ElementLabel.h │ │ ├── ElementProgress.cpp │ │ ├── ElementTabSet.cpp │ │ ├── ElementTextSelection.cpp │ │ ├── ElementTextSelection.h │ │ ├── InputType.cpp │ │ ├── InputType.h │ │ ├── InputTypeButton.cpp │ │ ├── InputTypeButton.h │ │ ├── InputTypeCheckbox.cpp │ │ ├── InputTypeCheckbox.h │ │ ├── InputTypeRadio.cpp │ │ ├── InputTypeRadio.h │ │ ├── InputTypeRange.cpp │ │ ├── InputTypeRange.h │ │ ├── InputTypeSubmit.cpp │ │ ├── InputTypeSubmit.h │ │ ├── InputTypeText.cpp │ │ ├── InputTypeText.h │ │ ├── WidgetDropDown.cpp │ │ ├── WidgetDropDown.h │ │ ├── WidgetSlider.cpp │ │ ├── WidgetSlider.h │ │ ├── WidgetTextInput.cpp │ │ ├── WidgetTextInput.h │ │ ├── WidgetTextInputMultiLine.cpp │ │ ├── WidgetTextInputMultiLine.h │ │ ├── WidgetTextInputSingleLine.cpp │ │ ├── WidgetTextInputSingleLine.h │ │ ├── WidgetTextInputSingleLinePassword.cpp │ │ ├── WidgetTextInputSingleLinePassword.h │ │ ├── XMLNodeHandlerSelect.cpp │ │ ├── XMLNodeHandlerSelect.h │ │ ├── XMLNodeHandlerTabSet.cpp │ │ ├── XMLNodeHandlerTabSet.h │ │ ├── XMLNodeHandlerTextArea.cpp │ │ └── XMLNodeHandlerTextArea.h │ ├── Event.cpp │ ├── EventDispatcher.cpp │ ├── EventDispatcher.h │ ├── EventInstancer.cpp │ ├── EventInstancerDefault.cpp │ ├── EventInstancerDefault.h │ ├── EventListenerInstancer.cpp │ ├── EventSpecification.cpp │ ├── EventSpecification.h │ ├── Factory.cpp │ ├── FileInterface.cpp │ ├── FileInterfaceDefault.cpp │ ├── FileInterfaceDefault.h │ ├── Filter.cpp │ ├── FilterBasic.cpp │ ├── FilterBasic.h │ ├── FilterBlur.cpp │ ├── FilterBlur.h │ ├── FilterDropShadow.cpp │ ├── FilterDropShadow.h │ ├── FontEffect.cpp │ ├── FontEffectBlur.cpp │ ├── FontEffectBlur.h │ ├── FontEffectGlow.cpp │ ├── FontEffectGlow.h │ ├── FontEffectInstancer.cpp │ ├── FontEffectOutline.cpp │ ├── FontEffectOutline.h │ ├── FontEffectShadow.cpp │ ├── FontEffectShadow.h │ ├── FontEngineDefault │ │ ├── CMakeLists.txt │ │ ├── FontEngineInterfaceDefault.cpp │ │ ├── FontEngineInterfaceDefault.h │ │ ├── FontFace.cpp │ │ ├── FontFace.h │ │ ├── FontFaceHandleDefault.cpp │ │ ├── FontFaceHandleDefault.h │ │ ├── FontFaceLayer.cpp │ │ ├── FontFaceLayer.h │ │ ├── FontFamily.cpp │ │ ├── FontFamily.h │ │ ├── FontProvider.cpp │ │ ├── FontProvider.h │ │ ├── FontTypes.h │ │ ├── FreeTypeInterface.cpp │ │ └── FreeTypeInterface.h │ ├── FontEngineInterface.cpp │ ├── Geometry.cpp │ ├── GeometryBackgroundBorder.cpp │ ├── GeometryBackgroundBorder.h │ ├── GeometryBoxShadow.cpp │ ├── GeometryBoxShadow.h │ ├── IdNameMap.h │ ├── Layout │ │ ├── BlockContainer.cpp │ │ ├── BlockContainer.h │ │ ├── BlockFormattingContext.cpp │ │ ├── BlockFormattingContext.h │ │ ├── CMakeLists.txt │ │ ├── ContainerBox.cpp │ │ ├── ContainerBox.h │ │ ├── FlexFormattingContext.cpp │ │ ├── FlexFormattingContext.h │ │ ├── FloatedBoxSpace.cpp │ │ ├── FloatedBoxSpace.h │ │ ├── FormattingContext.cpp │ │ ├── FormattingContext.h │ │ ├── InlineBox.cpp │ │ ├── InlineBox.h │ │ ├── InlineContainer.cpp │ │ ├── InlineContainer.h │ │ ├── InlineLevelBox.cpp │ │ ├── InlineLevelBox.h │ │ ├── InlineTypes.h │ │ ├── LayoutBox.cpp │ │ ├── LayoutBox.h │ │ ├── LayoutDetails.cpp │ │ ├── LayoutDetails.h │ │ ├── LayoutEngine.cpp │ │ ├── LayoutEngine.h │ │ ├── LayoutPools.cpp │ │ ├── LayoutPools.h │ │ ├── LineBox.cpp │ │ ├── LineBox.h │ │ ├── ReplacedFormattingContext.cpp │ │ ├── ReplacedFormattingContext.h │ │ ├── TableFormattingContext.cpp │ │ ├── TableFormattingContext.h │ │ ├── TableFormattingDetails.cpp │ │ └── TableFormattingDetails.h │ ├── Log.cpp │ ├── LogDefault.cpp │ ├── LogDefault.h │ ├── Math.cpp │ ├── Memory.cpp │ ├── Memory.h │ ├── MeshUtilities.cpp │ ├── ObserverPtr.cpp │ ├── Plugin.cpp │ ├── PluginRegistry.cpp │ ├── PluginRegistry.h │ ├── Pool.h │ ├── Pool.inl │ ├── Profiling.cpp │ ├── PropertiesIterator.h │ ├── PropertiesIteratorView.cpp │ ├── Property.cpp │ ├── PropertyDefinition.cpp │ ├── PropertyDictionary.cpp │ ├── PropertyParserAnimation.cpp │ ├── PropertyParserAnimation.h │ ├── PropertyParserBoxShadow.cpp │ ├── PropertyParserBoxShadow.h │ ├── PropertyParserColorStopList.cpp │ ├── PropertyParserColorStopList.h │ ├── PropertyParserColour.cpp │ ├── PropertyParserColour.h │ ├── PropertyParserDecorator.cpp │ ├── PropertyParserDecorator.h │ ├── PropertyParserFilter.cpp │ ├── PropertyParserFilter.h │ ├── PropertyParserFontEffect.cpp │ ├── PropertyParserFontEffect.h │ ├── PropertyParserKeyword.cpp │ ├── PropertyParserKeyword.h │ ├── PropertyParserNumber.cpp │ ├── PropertyParserNumber.h │ ├── PropertyParserRatio.cpp │ ├── PropertyParserRatio.h │ ├── PropertyParserString.cpp │ ├── PropertyParserString.h │ ├── PropertyParserTransform.cpp │ ├── PropertyParserTransform.h │ ├── PropertyShorthandDefinition.h │ ├── PropertySpecification.cpp │ ├── RenderInterface.cpp │ ├── RenderInterfaceCompatibility.cpp │ ├── RenderManager.cpp │ ├── RenderManagerAccess.cpp │ ├── RenderManagerAccess.h │ ├── ScrollController.cpp │ ├── ScrollController.h │ ├── Spritesheet.cpp │ ├── Stream.cpp │ ├── StreamFile.cpp │ ├── StreamFile.h │ ├── StreamMemory.cpp │ ├── StringUtilities.cpp │ ├── StyleSheet.cpp │ ├── StyleSheetContainer.cpp │ ├── StyleSheetFactory.cpp │ ├── StyleSheetFactory.h │ ├── StyleSheetNode.cpp │ ├── StyleSheetNode.h │ ├── StyleSheetParser.cpp │ ├── StyleSheetParser.h │ ├── StyleSheetSelector.cpp │ ├── StyleSheetSelector.h │ ├── StyleSheetSpecification.cpp │ ├── SystemInterface.cpp │ ├── Template.cpp │ ├── Template.h │ ├── TemplateCache.cpp │ ├── TemplateCache.h │ ├── Texture.cpp │ ├── TextureDatabase.cpp │ ├── TextureDatabase.h │ ├── TextureLayout.cpp │ ├── TextureLayout.h │ ├── TextureLayoutRectangle.cpp │ ├── TextureLayoutRectangle.h │ ├── TextureLayoutRow.cpp │ ├── TextureLayoutRow.h │ ├── TextureLayoutTexture.cpp │ ├── TextureLayoutTexture.h │ ├── Traits.cpp │ ├── Transform.cpp │ ├── TransformPrimitive.cpp │ ├── TransformState.cpp │ ├── TransformState.h │ ├── TransformUtilities.cpp │ ├── TransformUtilities.h │ ├── Tween.cpp │ ├── TypeConverter.cpp │ ├── URL.cpp │ ├── Variant.cpp │ ├── WidgetScroll.cpp │ ├── WidgetScroll.h │ ├── XMLNodeHandler.cpp │ ├── XMLNodeHandlerBody.cpp │ ├── XMLNodeHandlerBody.h │ ├── XMLNodeHandlerDefault.cpp │ ├── XMLNodeHandlerDefault.h │ ├── XMLNodeHandlerHead.cpp │ ├── XMLNodeHandlerHead.h │ ├── XMLNodeHandlerTemplate.cpp │ ├── XMLNodeHandlerTemplate.h │ ├── XMLParseTools.cpp │ ├── XMLParseTools.h │ ├── XMLParser.cpp │ └── precompiled.h │ ├── Debugger │ ├── .clang-format │ ├── BeaconSource.h │ ├── CMakeLists.txt │ ├── CommonSource.h │ ├── Debugger.cpp │ ├── DebuggerPlugin.cpp │ ├── DebuggerPlugin.h │ ├── DebuggerSystemInterface.cpp │ ├── DebuggerSystemInterface.h │ ├── ElementContextHook.cpp │ ├── ElementContextHook.h │ ├── ElementDebugDocument.cpp │ ├── ElementDebugDocument.h │ ├── ElementInfo.cpp │ ├── ElementInfo.h │ ├── ElementLog.cpp │ ├── ElementLog.h │ ├── FontSource.h │ ├── Geometry.cpp │ ├── Geometry.h │ ├── InfoSource.h │ ├── LICENSE.txt │ ├── LogSource.h │ └── MenuSource.h │ ├── Lottie │ ├── CMakeLists.txt │ ├── ElementLottie.cpp │ ├── LottiePlugin.cpp │ └── LottiePlugin.h │ └── SVG │ ├── CMakeLists.txt │ ├── ElementSVG.cpp │ ├── SVGPlugin.cpp │ └── SVGPlugin.h ├── examples ├── directx11 │ ├── directx11.vcxproj │ ├── directx11.vcxproj.filters │ └── src │ │ └── main.cpp ├── directx9 │ ├── directx9.vcxproj │ ├── directx9.vcxproj.filters │ └── src │ │ └── main.cpp ├── opengl3 │ ├── glfw │ │ ├── GLFW │ │ │ ├── glfw3.h │ │ │ └── glfw3native.h │ │ └── libs │ │ │ ├── glfw3-x64.lib │ │ │ └── glfw3-x86.lib │ ├── opengl3.vcxproj │ ├── opengl3.vcxproj.filters │ ├── resources │ │ ├── resources.aps │ │ └── resources.rc │ └── src │ │ └── main.cpp └── resources │ ├── images │ └── image.png │ ├── rmlui │ └── test.rml │ └── shared-resources.rc ├── null-rmlui.props ├── null-rmlui.sln ├── null-rmlui.vcxproj ├── null-rmlui.vcxproj.filters ├── render-interfaces ├── directx11 │ ├── null-rmlui-renderer-directx11-feature1.vcxproj │ ├── null-rmlui-renderer-directx11-feature1.vcxproj.filters │ ├── null-rmlui-renderer-directx11.props │ ├── null-rmlui-renderer-directx11.vcxproj │ ├── null-rmlui-renderer-directx11.vcxproj.filters │ └── src │ │ ├── null-rmlui-renderer-directx11.cpp │ │ ├── null-rmlui-renderer-directx11.h │ │ └── null-rmlui-renderer-directx11 │ │ ├── mesh-pool │ │ ├── mesh-pool.cpp │ │ └── mesh-pool.h │ │ └── shaders │ │ ├── blend-mask │ │ ├── blend-mask.h │ │ ├── compiled-object.h │ │ └── hlsl │ │ │ └── blend-mask.hlsl │ │ ├── bliting │ │ ├── bliting.cpp │ │ ├── bliting.h │ │ ├── compiled-object.h │ │ └── hlsl │ │ │ └── bliting.hlsl │ │ ├── blur │ │ ├── blur.cpp │ │ ├── blur.h │ │ ├── compiled-object.h │ │ └── hlsl │ │ │ ├── blur-ps.hlsl │ │ │ └── blur-vs.hlsl │ │ ├── color-matrix │ │ ├── color-matrix.cpp │ │ ├── color-matrix.h │ │ ├── compiled-object.h │ │ └── hlsl │ │ │ └── color-matrix.hlsl │ │ ├── color │ │ ├── color.cpp │ │ ├── color.h │ │ ├── compiled-object.h │ │ └── hlsl │ │ │ └── color.hlsl │ │ ├── drop-shadow │ │ ├── compiled-object.h │ │ ├── drop-shadow.cpp │ │ ├── drop-shadow.h │ │ └── hlsl │ │ │ └── drop-shadow.hlsl │ │ ├── gradient │ │ ├── compiled-object.h │ │ ├── gradient.cpp │ │ ├── gradient.h │ │ └── hlsl │ │ │ └── gradient.hlsl │ │ └── texture │ │ ├── texture.cpp │ │ └── texture.h ├── directx9 │ ├── null-rmlui-renderer-directx9.props │ ├── null-rmlui-renderer-directx9.vcxproj │ ├── null-rmlui-renderer-directx9.vcxproj.filters │ └── src │ │ ├── null-rmlui-renderer-directx9.cpp │ │ ├── null-rmlui-renderer-directx9.h │ │ └── null-rmlui-renderer-directx9 │ │ ├── mesh-pool │ │ ├── mesh-pool.cpp │ │ └── mesh-pool.h │ │ └── shaders │ │ ├── blend-mask │ │ ├── blend-mask.h │ │ ├── compiled-object.h │ │ └── hlsl │ │ │ └── blend-mask.hlsl │ │ ├── bliting │ │ ├── bliting.cpp │ │ ├── bliting.h │ │ ├── compiled-object.h │ │ └── hlsl │ │ │ └── bliting.hlsl │ │ ├── blur │ │ ├── blur.cpp │ │ ├── blur.h │ │ ├── compiled-object.h │ │ └── hlsl │ │ │ ├── blur-ps.hlsl │ │ │ └── blur-vs.hlsl │ │ ├── color-matrix │ │ ├── color-matrix.cpp │ │ ├── color-matrix.h │ │ ├── compiled-object.h │ │ └── hlsl │ │ │ └── color-matrix.hlsl │ │ ├── color │ │ ├── color.h │ │ ├── compiled-object.h │ │ └── hlsl │ │ │ └── color.hlsl │ │ ├── drop-shadow │ │ ├── compiled-object.h │ │ ├── drop-shadow.cpp │ │ ├── drop-shadow.h │ │ └── hlsl │ │ │ └── drop-shadow.hlsl │ │ ├── gradient │ │ ├── compiled-object.h │ │ ├── gradient.cpp │ │ ├── gradient.h │ │ └── hlsl │ │ │ └── gradient.hlsl │ │ └── texture │ │ └── texture.h └── opengl3 │ ├── null-rmlui-renderer-opengl3.props │ ├── null-rmlui-renderer-opengl3.vcxproj │ ├── null-rmlui-renderer-opengl3.vcxproj.filters │ ├── resources │ └── null-rmlui-opengl3-resources.rc │ └── src │ ├── null-rmlui-renderer-opengl3.cpp │ ├── null-rmlui-renderer-opengl3.h │ └── null-rmlui-renderer-opengl3 │ ├── mesh-pool │ ├── mesh-pool.cpp │ └── mesh-pool.h │ └── shaders │ ├── blend-mask │ ├── blend-mask.h │ ├── compiled-object.h │ └── glsl │ │ └── blend-mask.frag │ ├── bliting │ ├── bliting.cpp │ ├── bliting.h │ ├── compiled-object.h │ └── glsl │ │ └── bliting.frag │ ├── blur │ ├── blur.cpp │ ├── blur.h │ ├── compiled-object.h │ └── glsl │ │ ├── blur.frag │ │ └── blur.vert │ ├── color-matrix │ ├── color-matrix.cpp │ ├── color-matrix.h │ ├── compiled-object.h │ └── glsl │ │ └── color-matrix.frag │ ├── color │ ├── color.h │ ├── compiled-object.h │ └── glsl │ │ └── color.vert │ ├── drop-shadow │ ├── compiled-object.h │ ├── drop-shadow.cpp │ ├── drop-shadow.h │ └── glsl │ │ └── drop-shadow.frag │ ├── gradient │ ├── compiled-object.h │ ├── glsl │ │ └── gradient.frag │ ├── gradient.cpp │ └── gradient.h │ └── texture │ └── texture.h └── src ├── null-rmlui.cpp ├── null-rmlui.h └── null-rmlui ├── compatibility ├── color.h ├── rect.h ├── vec2.h └── vec4.h ├── extensions ├── colorpicker-element │ ├── colorpicker-element.cpp │ └── colorpicker-element.h ├── extensions.h └── multiselect-element │ ├── multiselect-element.cpp │ └── multiselect-element.h └── rmlui-implementation ├── backend ├── backend.cpp └── backend.h ├── file-interface ├── file-interface.cpp ├── file-interface.h └── loaders │ ├── default-file-loader.h │ ├── file-loader.h │ └── resource-loader.h ├── render-interface ├── interfaces │ └── shaders │ │ ├── blend-mask.h │ │ ├── bliting.h │ │ ├── blur.h │ │ ├── color-matrix.h │ │ ├── color.h │ │ ├── drop-shadow.h │ │ ├── gradient.h │ │ └── texture.h ├── mesh-pool │ ├── mesh-pool.h │ ├── offsetAllocator.cpp │ └── offsetAllocator.hpp ├── post-processing │ ├── filters │ │ ├── blur-filter │ │ │ ├── blur-filter.cpp │ │ │ └── blur-filter.h │ │ ├── color-matrix-filter │ │ │ ├── color-matrix-filter.cpp │ │ │ └── color-matrix-filter.h │ │ ├── factory │ │ │ ├── factory.cpp │ │ │ └── factory.h │ │ ├── gradient-filter │ │ │ ├── gradient-shader-filter.cpp │ │ │ └── gradient-shader-filter.h │ │ ├── mask-image-filter │ │ │ ├── mask-image-filter.cpp │ │ │ └── mask-image-filter.h │ │ ├── passthrough-filter │ │ │ ├── passthrough-filter.cpp │ │ │ └── passthrough-filter.h │ │ └── shadow-filter │ │ │ ├── shadow-filter.cpp │ │ │ └── shadow-filter.h │ ├── layers.cpp │ └── layers.h ├── render-interface.cpp └── render-interface.h └── system-interface ├── system-interface.cpp └── system-interface.h /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | *.c linguist-language=cpp 4 | *.cpp linguist-language=cpp 5 | *.h linguist-language=cpp 6 | *.hpp linguist-language=cpp 7 | 8 | *.rml linguist-language=HTML 9 | *.rcss linguist-language=CSS -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | .vs/ 3 | *.user 4 | *.log 5 | 6 | examples/opengl3/glfw/GLFW 7 | RmlUi/Dependencies/build 8 | RmlUi/Dependencies/libs/*.pdb 9 | RmlUi/Dependencies/libs/*.idb 10 | 11 | render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/blend-mask/compiled 12 | render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/bliting/compiled 13 | render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/blur/compiled 14 | render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/color/compiled 15 | render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/color-matrix/compiled 16 | render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/drop-shadow/compiled 17 | render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/gradient/compiled 18 | 19 | render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/blend-mask/compiled 20 | render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/bliting/compiled 21 | render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/blur/compiled 22 | render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/color/compiled 23 | render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/color-matrix/compiled 24 | render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/drop-shadow/compiled 25 | render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/gradient/compiled 26 | /examples/resources/rmlui/test-clip.rml 27 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "third-party/null-sdk"] 2 | path = third-party/null-sdk 3 | url = https://github.com/nullptr-sources/null-sdk 4 | [submodule "third-party/null-render"] 5 | path = third-party/null-render 6 | url = https://github.com/nullptr-sources/null-render 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # null-rmlui 2 | renderer, system and file interfaces for rmlui with with small extensions. 3 | 4 | # rmlui implementation 5 | * render interface 6 | * support all null-render renderers 7 | * file interface 8 | * ability to load files from resources 9 | * formatting paths for up to regular files 10 | * system interface 11 | * wnd_proc and small helper functions 12 | 13 | # extensions 14 | * elements 15 | * colorpicker 16 | * multiselect 17 | 18 | # plugins 19 | [null-rmlui-lua](https://github.com/nullptr-sources/null-rmlui-lua) - original [RmlSolLua](https://github.com/LoneBoco/RmlSolLua) lua bindings.\ 20 | 21 | # examples 22 | [![nullptr-injector](https://i.imgur.com/EAnyGo8.png)](https://github.com/nullptr-sources/nullptr-injector) 23 | 24 | # usage 25 | - compile RmlCore/RmlDebugger/RmlSvg in third-party\RmlUi folder, all libraries will be connected immediately 26 | 27 | # credits 28 | [RmlUi](https://github.com/mikke89/RmlUi) \ 29 | [ezEngine](https://github.com/ezEngine/ezEngine) \ 30 | [RmlSolLua](https://github.com/LoneBoco/RmlSolLua) 31 | 32 | # dependencies 33 | [null-render](https://github.com/nullptr-sources/null-render) \ 34 | [null-sdk](https://github.com/nullptr-sources/null-sdk) -------------------------------------------------------------------------------- /RmlUi/.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | .vs/ 3 | *.user -------------------------------------------------------------------------------- /RmlUi/Dependencies/include/freetype/config/ftconfig.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftconfig.h 4 | * 5 | * ANSI-specific configuration file (specification only). 6 | * 7 | * Copyright (C) 1996-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | /************************************************************************** 20 | * 21 | * This header file contains a number of macro definitions that are used by 22 | * the rest of the engine. Most of the macros here are automatically 23 | * determined at compile time, and you should not need to change it to port 24 | * FreeType, except to compile the library with a non-ANSI compiler. 25 | * 26 | * Note however that if some specific modifications are needed, we advise 27 | * you to place a modified copy in your build directory. 28 | * 29 | * The build directory is usually `builds/`, and contains 30 | * system-specific files that are always included first when building the 31 | * library. 32 | * 33 | * This ANSI version should stay in `include/config/`. 34 | * 35 | */ 36 | 37 | #ifndef FTCONFIG_H_ 38 | #define FTCONFIG_H_ 39 | 40 | #include 41 | #include FT_CONFIG_OPTIONS_H 42 | #include FT_CONFIG_STANDARD_LIBRARY_H 43 | 44 | #include 45 | #include 46 | #include 47 | 48 | #endif /* FTCONFIG_H_ */ 49 | 50 | 51 | /* END */ 52 | -------------------------------------------------------------------------------- /RmlUi/Dependencies/include/freetype/config/ftmodule.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file registers the FreeType modules compiled into the library. 3 | * 4 | * If you use GNU make, this file IS NOT USED! Instead, it is created in 5 | * the objects directory (normally `/objs/`) based on information 6 | * from `/modules.cfg`. 7 | * 8 | * Please read `docs/INSTALL.ANY` and `docs/CUSTOMIZE` how to compile 9 | * FreeType without GNU make. 10 | * 11 | */ 12 | 13 | FT_USE_MODULE( FT_Module_Class, autofit_module_class ) 14 | FT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class ) 15 | FT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class ) 16 | FT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class ) 17 | FT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class ) 18 | FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class ) 19 | FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class ) 20 | FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class ) 21 | FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class ) 22 | FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class ) 23 | FT_USE_MODULE( FT_Module_Class, psaux_module_class ) 24 | FT_USE_MODULE( FT_Module_Class, psnames_module_class ) 25 | FT_USE_MODULE( FT_Module_Class, pshinter_module_class ) 26 | FT_USE_MODULE( FT_Module_Class, sfnt_module_class ) 27 | FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class ) 28 | FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class ) 29 | FT_USE_MODULE( FT_Renderer_Class, ft_sdf_renderer_class ) 30 | FT_USE_MODULE( FT_Renderer_Class, ft_bitmap_sdf_renderer_class ) 31 | FT_USE_MODULE( FT_Renderer_Class, ft_svg_renderer_class ) 32 | 33 | /* EOF */ 34 | -------------------------------------------------------------------------------- /RmlUi/Dependencies/include/freetype/config/mac-support.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * config/mac-support.h 4 | * 5 | * Mac/OS X support configuration header. 6 | * 7 | * Copyright (C) 1996-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | #ifndef FREETYPE_CONFIG_MAC_SUPPORT_H_ 18 | #define FREETYPE_CONFIG_MAC_SUPPORT_H_ 19 | 20 | /************************************************************************** 21 | * 22 | * Mac support 23 | * 24 | * This is the only necessary change, so it is defined here instead 25 | * providing a new configuration file. 26 | */ 27 | #if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) ) 28 | /* No Carbon frameworks for 64bit 10.4.x. */ 29 | /* `AvailabilityMacros.h` is available since Mac OS X 10.2, */ 30 | /* so guess the system version by maximum errno before inclusion. */ 31 | #include 32 | #ifdef ECANCELED /* defined since 10.2 */ 33 | #include "AvailabilityMacros.h" 34 | #endif 35 | #if defined( __LP64__ ) && \ 36 | ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 ) 37 | #undef FT_MACINTOSH 38 | #endif 39 | 40 | #elif defined( __SC__ ) || defined( __MRC__ ) 41 | /* Classic MacOS compilers */ 42 | #include "ConditionalMacros.h" 43 | #if TARGET_OS_MAC 44 | #define FT_MACINTOSH 1 45 | #endif 46 | 47 | #endif /* Mac support */ 48 | 49 | #endif /* FREETYPE_CONFIG_MAC_SUPPORT_H_ */ 50 | -------------------------------------------------------------------------------- /RmlUi/Dependencies/include/ft2build.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ft2build.h 4 | * 5 | * FreeType 2 build and setup macros. 6 | * 7 | * Copyright (C) 1996-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | /************************************************************************** 20 | * 21 | * This is the 'entry point' for FreeType header file inclusions, to be 22 | * loaded before all other header files. 23 | * 24 | * A typical example is 25 | * 26 | * ``` 27 | * #include 28 | * #include 29 | * ``` 30 | * 31 | */ 32 | 33 | 34 | #ifndef FT2BUILD_H_ 35 | #define FT2BUILD_H_ 36 | 37 | #include 38 | 39 | #endif /* FT2BUILD_H_ */ 40 | 41 | 42 | /* END */ 43 | -------------------------------------------------------------------------------- /RmlUi/Dependencies/libs/lunasvg-Debug-x86.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0suddenly0/null-rmlui/bd96ff0528a57185172acd9d7c1ed453383ac6ee/RmlUi/Dependencies/libs/lunasvg-Debug-x86.lib -------------------------------------------------------------------------------- /RmlUi/Dependencies/libs/lunasvg-debug-x64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0suddenly0/null-rmlui/bd96ff0528a57185172acd9d7c1ed453383ac6ee/RmlUi/Dependencies/libs/lunasvg-debug-x64.lib -------------------------------------------------------------------------------- /RmlUi/Dependencies/libs/lunasvg-release-x64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0suddenly0/null-rmlui/bd96ff0528a57185172acd9d7c1ed453383ac6ee/RmlUi/Dependencies/libs/lunasvg-release-x64.lib -------------------------------------------------------------------------------- /RmlUi/Dependencies/libs/lunasvg-release-x86.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0suddenly0/null-rmlui/bd96ff0528a57185172acd9d7c1ed453383ac6ee/RmlUi/Dependencies/libs/lunasvg-release-x86.lib -------------------------------------------------------------------------------- /RmlUi/Dependencies/libs/rlottie-debug-x64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0suddenly0/null-rmlui/bd96ff0528a57185172acd9d7c1ed453383ac6ee/RmlUi/Dependencies/libs/rlottie-debug-x64.lib -------------------------------------------------------------------------------- /RmlUi/Dependencies/libs/rlottie-debug-x86.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0suddenly0/null-rmlui/bd96ff0528a57185172acd9d7c1ed453383ac6ee/RmlUi/Dependencies/libs/rlottie-debug-x86.lib -------------------------------------------------------------------------------- /RmlUi/Dependencies/libs/rlottie-release-x64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0suddenly0/null-rmlui/bd96ff0528a57185172acd9d7c1ed453383ac6ee/RmlUi/Dependencies/libs/rlottie-release-x64.lib -------------------------------------------------------------------------------- /RmlUi/Dependencies/libs/rlottie-release-x86.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0suddenly0/null-rmlui/bd96ff0528a57185172acd9d7c1ed453383ac6ee/RmlUi/Dependencies/libs/rlottie-release-x86.lib -------------------------------------------------------------------------------- /RmlUi/README.md: -------------------------------------------------------------------------------- 1 | # Using guide 2 | - compile RmlCore/RmlDebugger/RmlSvg 3 | - link include directories and .lib files 4 | 5 | # Changes 6 | - Added additional methods for data models. Enabled via RMLUI_DATAMODELS_EXTENSIONS. (used by default) 7 | - Some elements have changed access qualifiers and added method override capability. Enabled via RMLUI_ELEMENTS_EXTENSIONS. (used by default) 8 | - In the latest version of RmlUI scrollbar ignores the right and bottom padding, to roll back to the behavior of version 5.1, use RMLUI_OLD_SCROLL_PADDING (used by default) 9 | - The standard RmlUI supports only percentage and integer color components, support for floating-point color components is added through RMLUI_FLOAT_COLOR_PARSER (used by default) 10 | - RmlUi throws assert when using nested data-models (I personally have not noticed any errors because of this), to disable assert, you can use RMLUI_ALLOW_NESTED_DATAMODELS (used by default) 11 | - RMLUI_FIX_DRAG_CLONE_POSITION (used by default) - corrects the drag_clone position when creating 12 | - RMLUI_TEXTINPUT_EXTENSIONS (used by default) - corrects copying of text from input type password -------------------------------------------------------------------------------- /RmlUi/RmlCore/RmlCore.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildThisFileDirectory) 5 | debug 6 | release 7 | 8 | 9 | 10 | 11 | RMLUI_DATAMODELS_EXTENSIONS;RMLUI_ELEMENTS_EXTENSIONS;RMLUI_ALLOW_NESTED_DATAMODELS;RMLUI_FLOAT_COLOR_PARSER;RMLUI_OLD_SCROLL_PADDING;RMLUI_FIX_DRAG_CLONE_POSITION;RMLUI_TEXTINPUT_EXTENSIONS;RMLUI_STATIC_LIB;RMLUI_VERSION="6.0-dev";%(PreprocessorDefinitions) 12 | $(RmlCoreRoot)..\src\RmlUi;$(RmlCoreRoot)..\src\RmlUi\Include;$(ProjectDir)..\Dependencies\include;%(AdditionalIncludeDirectories) 13 | 14 | 15 | $(RmlCoreRoot)build;%(AdditionalLibraryDirectories) 16 | RmlCore-$(RmlCoreConfiguration)-$(LibrariesArchitecture).lib;%(AdditionalDependencies) 17 | 18 | 19 | -------------------------------------------------------------------------------- /RmlUi/RmlDebugger/RmlDebugger.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildThisFileDirectory) 5 | debug 6 | release 7 | 8 | 9 | 10 | 11 | $(RmlDebuggerRoot)build;%(AdditionalLibraryDirectories) 12 | RmlDebugger-$(RmlDebuggerConfiguration)-$(LibrariesArchitecture).lib;%(AdditionalDependencies) 13 | 14 | 15 | -------------------------------------------------------------------------------- /RmlUi/RmlLottie/RmlLottie.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildThisFileDirectory) 5 | debug 6 | release 7 | $(RmlLottieConfiguration)-$(LibrariesArchitecture) 8 | 9 | 10 | 11 | 12 | RLOTTIE_BUILD=0;%(PreprocessorDefinitions) 13 | 14 | 15 | $(RmlLottieRoot)build;$(RmlLottieRoot)..\Dependencies\libs;%(AdditionalLibraryDirectories) 16 | 17 | 18 | $(RmlLottieRoot)build;$(RmlLottieRoot)..\Dependencies\libs;%(AdditionalLibraryDirectories) 19 | RmlLottie-$(RmlLottieLibPostfix).lib;rlottie-$(RmlLottieLibPostfix).lib;%(AdditionalDependencies) 20 | 21 | 22 | -------------------------------------------------------------------------------- /RmlUi/RmlLottie/RmlLottie.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {d11addc5-089b-4237-a3dd-c21f8f81dcf1} 6 | 7 | 8 | 9 | 10 | RmlUi 11 | 12 | 13 | RmlUi 14 | 15 | 16 | 17 | 18 | RmlUi 19 | 20 | 21 | RmlUi 22 | 23 | 24 | -------------------------------------------------------------------------------- /RmlUi/RmlSvg/RmlSvg.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildThisFileDirectory) 5 | debug 6 | release 7 | 8 | 9 | 10 | 11 | $(RmlSvgRoot)build;$(RmlSvgRoot)..\Dependencies\libs;%(AdditionalLibraryDirectories) 12 | 13 | 14 | $(RmlSvgRoot)build;$(RmlSvgRoot)..\Dependencies\libs;%(AdditionalLibraryDirectories) 15 | RmlSVG-$(RmlSvgConfiguration)-$(LibrariesArchitecture).lib;lunasvg-$(RmlSvgConfiguration)-$(LibrariesArchitecture).lib;%(AdditionalDependencies) 16 | 17 | 18 | -------------------------------------------------------------------------------- /RmlUi/RmlSvg/RmlSvg.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {d11addc5-089b-4237-a3dd-c21f8f81dcf1} 6 | 7 | 8 | 9 | 10 | RmlUi 11 | 12 | 13 | RmlUi 14 | 15 | 16 | 17 | 18 | RmlUi 19 | 20 | 21 | RmlUi 22 | 23 | 24 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/Include/RmlUi/Core/Mesh.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #ifndef RMLUI_CORE_MESH_H 30 | #define RMLUI_CORE_MESH_H 31 | 32 | #include "Header.h" 33 | #include "Texture.h" 34 | #include "Vertex.h" 35 | 36 | namespace Rml { 37 | 38 | struct Mesh { 39 | Vector vertices; 40 | Vector indices; 41 | 42 | explicit operator bool() const { return !indices.empty(); } 43 | }; 44 | 45 | struct TexturedMesh { 46 | Mesh mesh; 47 | Texture texture; 48 | }; 49 | 50 | using TexturedMeshList = Vector; 51 | 52 | } // namespace Rml 53 | #endif 54 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/Include/RmlUi/Core/ScriptInterface.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #ifndef RMLUI_CORE_SCRIPTINTERFACE_H 30 | #define RMLUI_CORE_SCRIPTINTERFACE_H 31 | 32 | #include "Header.h" 33 | #include "Traits.h" 34 | #include "Types.h" 35 | 36 | namespace Rml { 37 | 38 | /** 39 | Base class for all objects that hold a scriptable object. 40 | @author Peter Curry 41 | */ 42 | 43 | class RMLUICORE_API ScriptInterface : public Releasable { 44 | public: 45 | RMLUI_RTTI_Define(ScriptInterface) 46 | 47 | virtual ~ScriptInterface() {} 48 | 49 | virtual ScriptObject GetScriptObject() const { return nullptr; } 50 | }; 51 | 52 | } // namespace Rml 53 | #endif 54 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/Include/RmlUi/Core/TextShapingContext.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #ifndef RMLUI_CORE_TEXTSHAPINGCONTEXT_H 30 | #define RMLUI_CORE_TEXTSHAPINGCONTEXT_H 31 | 32 | #include "StyleTypes.h" 33 | #include "Types.h" 34 | 35 | namespace Rml { 36 | 37 | /* 38 | Data extracted from the properties of an element to help provide context for text shaping and spacing. 39 | */ 40 | struct TextShapingContext { 41 | const String& language; 42 | Style::Direction text_direction = Style::Direction::Auto; 43 | float letter_spacing = 0.0f; // Measured in pixels. 44 | }; 45 | 46 | } // namespace Rml 47 | #endif 48 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/Include/RmlUi/Core/Utilities.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #ifndef RMLUI_CORE_UTILITIES_H 30 | #define RMLUI_CORE_UTILITIES_H 31 | 32 | #include "Types.h" 33 | 34 | namespace Rml { 35 | 36 | namespace Utilities { 37 | 38 | template 39 | inline void HashCombine(size_t& seed, const T& v) 40 | { 41 | Hash hasher; 42 | seed ^= hasher(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2); 43 | } 44 | 45 | } // namespace Utilities 46 | } // namespace Rml 47 | #endif 48 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/Include/RmlUi/Core/Vertex.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #ifndef RMLUI_CORE_VERTEX_H 30 | #define RMLUI_CORE_VERTEX_H 31 | 32 | #include "Header.h" 33 | #include "Types.h" 34 | 35 | namespace Rml { 36 | 37 | /** 38 | The element that makes up all geometry sent to the renderer. 39 | 40 | @author Peter Curry 41 | */ 42 | 43 | struct RMLUICORE_API Vertex { 44 | /// Two-dimensional position of the vertex (usually in pixels). 45 | Vector2f position; 46 | /// RGBA-ordered 8-bit/channel colour with premultiplied alpha. 47 | ColourbPremultiplied colour; 48 | /// Texture coordinate for any associated texture. 49 | Vector2f tex_coord; 50 | }; 51 | 52 | } // namespace Rml 53 | #endif 54 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/Include/RmlUi/Debugger.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #ifndef RMLUI_DEBUGGER_H 30 | #define RMLUI_DEBUGGER_H 31 | 32 | #include "Debugger/Debugger.h" 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/Include/RmlUi/Debugger/Header.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #ifndef RMLUI_DEBUGGER_HEADER_H 30 | #define RMLUI_DEBUGGER_HEADER_H 31 | 32 | #include "../Core/Platform.h" 33 | 34 | #if !defined RMLUI_STATIC_LIB 35 | #ifdef RMLUI_PLATFORM_WIN32 36 | #ifdef RMLUI_DEBUGGER_EXPORTS 37 | #define RMLUIDEBUGGER_API __declspec(dllexport) 38 | #else 39 | #define RMLUIDEBUGGER_API __declspec(dllimport) 40 | #endif 41 | #else 42 | #define RMLUIDEBUGGER_API __attribute__((visibility("default"))) 43 | #endif 44 | #else 45 | #define RMLUIDEBUGGER_API 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/RmlUi/Core/Clock.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #include "Clock.h" 30 | #include "../../Include/RmlUi/Core/Core.h" 31 | #include "../../Include/RmlUi/Core/SystemInterface.h" 32 | 33 | namespace Rml { 34 | 35 | RMLUICORE_API double Clock::GetElapsedTime() 36 | { 37 | SystemInterface* system_interface = GetSystemInterface(); 38 | if (system_interface != nullptr) 39 | return system_interface->GetElapsedTime(); 40 | else 41 | return 0; 42 | } 43 | 44 | } // namespace Rml 45 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/RmlUi/Core/Clock.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #ifndef RMLUI_CORE_CLOCK_H 30 | #define RMLUI_CORE_CLOCK_H 31 | 32 | #include "../../Include/RmlUi/Core/Header.h" 33 | 34 | namespace Rml { 35 | 36 | /** 37 | RmlUi's Interface to Time. 38 | 39 | @author Lloyd Weehuizen 40 | */ 41 | class Clock { 42 | public: 43 | /// Get the elapsed time since application startup 44 | /// @return Seconds elapsed since application startup. 45 | RMLUICORE_API static double GetElapsedTime(); 46 | }; 47 | 48 | } // namespace Rml 49 | #endif 50 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/RmlUi/Core/ContextInstancer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #include "../../Include/RmlUi/Core/ContextInstancer.h" 30 | 31 | namespace Rml { 32 | 33 | ContextInstancer::~ContextInstancer() {} 34 | 35 | } // namespace Rml 36 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/RmlUi/Core/Elements/WidgetTextInputSingleLinePassword.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #include "WidgetTextInputSingleLinePassword.h" 30 | #include "../../../Include/RmlUi/Core/ElementText.h" 31 | 32 | namespace Rml { 33 | 34 | WidgetTextInputSingleLinePassword::WidgetTextInputSingleLinePassword(ElementFormControl* parent) : WidgetTextInputSingleLine(parent) { 35 | #ifdef RMLUI_TEXTINPUT_EXTENSIONS 36 | DisallowValueCopy(); 37 | #endif 38 | } 39 | 40 | void WidgetTextInputSingleLinePassword::TransformValue(String& value) 41 | { 42 | for (auto& c : value) 43 | c = '*'; 44 | } 45 | 46 | } // namespace Rml 47 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/RmlUi/Core/Elements/WidgetTextInputSingleLinePassword.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #ifndef RMLUI_CORE_ELEMENTS_WIDGETTEXTINPUTSINGLELINEPASSWORD_H 30 | #define RMLUI_CORE_ELEMENTS_WIDGETTEXTINPUTSINGLELINEPASSWORD_H 31 | 32 | #include "WidgetTextInputSingleLine.h" 33 | 34 | namespace Rml { 35 | 36 | /** 37 | @author Peter Curry 38 | */ 39 | 40 | class WidgetTextInputSingleLinePassword : public WidgetTextInputSingleLine { 41 | public: 42 | WidgetTextInputSingleLinePassword(ElementFormControl* parent); 43 | 44 | protected: 45 | /// Transforms the displayed value of the text box, typically used for password fields. 46 | void TransformValue(String& value) override; 47 | }; 48 | 49 | } // namespace Rml 50 | #endif 51 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/RmlUi/Core/Elements/XMLNodeHandlerSelect.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #ifndef RMLUI_CORE_ELEMENTS_XMLNODEHANDLERSELECT_H 30 | #define RMLUI_CORE_ELEMENTS_XMLNODEHANDLERSELECT_H 31 | 32 | #include "../XMLNodeHandlerDefault.h" 33 | 34 | namespace Rml { 35 | 36 | /** 37 | XML node handler for processing the select and option tags. 38 | */ 39 | 40 | class XMLNodeHandlerSelect : public XMLNodeHandlerDefault { 41 | public: 42 | XMLNodeHandlerSelect(); 43 | virtual ~XMLNodeHandlerSelect(); 44 | 45 | /// Called when a new element start is opened 46 | Element* ElementStart(XMLParser* parser, const String& name, const XMLAttributes& attributes) override; 47 | }; 48 | 49 | } // namespace Rml 50 | #endif 51 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/RmlUi/Core/EventInstancer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #include "../../Include/RmlUi/Core/EventInstancer.h" 30 | 31 | namespace Rml { 32 | 33 | EventInstancer::~EventInstancer() {} 34 | 35 | } // namespace Rml 36 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/RmlUi/Core/EventInstancerDefault.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #include "EventInstancerDefault.h" 30 | #include "../../Include/RmlUi/Core/Event.h" 31 | 32 | namespace Rml { 33 | 34 | EventInstancerDefault::EventInstancerDefault() {} 35 | 36 | EventInstancerDefault::~EventInstancerDefault() {} 37 | 38 | EventPtr EventInstancerDefault::InstanceEvent(Element* target, EventId id, const String& type, const Dictionary& parameters, bool interruptible) 39 | { 40 | return EventPtr(new Event(target, id, type, parameters, interruptible)); 41 | } 42 | 43 | void EventInstancerDefault::ReleaseEvent(Event* event) 44 | { 45 | delete event; 46 | } 47 | 48 | void EventInstancerDefault::Release() 49 | { 50 | delete this; 51 | } 52 | 53 | } // namespace Rml 54 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/RmlUi/Core/EventListenerInstancer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #include "../../Include/RmlUi/Core/EventListenerInstancer.h" 30 | 31 | namespace Rml { 32 | 33 | EventListenerInstancer::~EventListenerInstancer() {} 34 | 35 | } // namespace Rml 36 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/RmlUi/Core/Filter.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #include "../../Include/RmlUi/Core/Filter.h" 30 | #include "../../Include/RmlUi/Core/RenderManager.h" 31 | 32 | namespace Rml { 33 | 34 | Filter::Filter() {} 35 | 36 | Filter::~Filter() {} 37 | 38 | void Filter::ExtendInkOverflow(Element* /*element*/, Rectanglef& /*scissor_region*/) const {} 39 | 40 | FilterInstancer::FilterInstancer() {} 41 | 42 | FilterInstancer::~FilterInstancer() {} 43 | 44 | } // namespace Rml 45 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/RmlUi/Core/FontEngineDefault/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # RMLUI_CMAKE_MINIMUM_VERSION_RAISE_NOTICE: 2 | # Using absolute paths to prevent improper interpretation of relative paths Relative paths can be used once the minimum 3 | # CMake version is greater or equal than CMake 3.13 4 | target_sources(rmlui_core PRIVATE 5 | "${CMAKE_CURRENT_SOURCE_DIR}/FontEngineInterfaceDefault.cpp" 6 | "${CMAKE_CURRENT_SOURCE_DIR}/FontEngineInterfaceDefault.h" 7 | "${CMAKE_CURRENT_SOURCE_DIR}/FontFace.cpp" 8 | "${CMAKE_CURRENT_SOURCE_DIR}/FontFace.h" 9 | "${CMAKE_CURRENT_SOURCE_DIR}/FontFaceHandleDefault.cpp" 10 | "${CMAKE_CURRENT_SOURCE_DIR}/FontFaceHandleDefault.h" 11 | "${CMAKE_CURRENT_SOURCE_DIR}/FontFaceLayer.cpp" 12 | "${CMAKE_CURRENT_SOURCE_DIR}/FontFaceLayer.h" 13 | "${CMAKE_CURRENT_SOURCE_DIR}/FontFamily.cpp" 14 | "${CMAKE_CURRENT_SOURCE_DIR}/FontFamily.h" 15 | "${CMAKE_CURRENT_SOURCE_DIR}/FontProvider.cpp" 16 | "${CMAKE_CURRENT_SOURCE_DIR}/FontProvider.h" 17 | "${CMAKE_CURRENT_SOURCE_DIR}/FontTypes.h" 18 | "${CMAKE_CURRENT_SOURCE_DIR}/FreeTypeInterface.cpp" 19 | "${CMAKE_CURRENT_SOURCE_DIR}/FreeTypeInterface.h" 20 | ) 21 | 22 | target_compile_definitions(rmlui_core PRIVATE "RMLUI_FONT_ENGINE_FREETYPE") 23 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/RmlUi/Core/Layout/LayoutBox.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #include "LayoutBox.h" 30 | #include "LayoutPools.h" 31 | 32 | namespace Rml { 33 | 34 | const Box* LayoutBox::GetIfBox() const 35 | { 36 | return nullptr; 37 | } 38 | 39 | bool LayoutBox::GetBaselineOfLastLine(float& /*out_baseline*/) const 40 | { 41 | return false; 42 | } 43 | 44 | float LayoutBox::GetShrinkToFitWidth() const 45 | { 46 | return 0.f; 47 | } 48 | void* LayoutBox::operator new(size_t size) 49 | { 50 | void* memory = LayoutPools::AllocateLayoutChunk(size); 51 | return memory; 52 | } 53 | 54 | void LayoutBox::operator delete(void* chunk, size_t size) 55 | { 56 | LayoutPools::DeallocateLayoutChunk(chunk, size); 57 | } 58 | 59 | } // namespace Rml 60 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/RmlUi/Core/Layout/LayoutPools.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #ifndef RMLUI_CORE_LAYOUT_LAYOUTPOOLS_H 30 | #define RMLUI_CORE_LAYOUT_LAYOUTPOOLS_H 31 | 32 | #include "../../../Include/RmlUi/Core/Types.h" 33 | 34 | namespace Rml { 35 | 36 | namespace LayoutPools { 37 | 38 | void Initialize(); 39 | void Shutdown(); 40 | 41 | void* AllocateLayoutChunk(size_t size); 42 | void DeallocateLayoutChunk(void* chunk, size_t size); 43 | 44 | } // namespace LayoutPools 45 | 46 | } // namespace Rml 47 | #endif 48 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/RmlUi/Core/LogDefault.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #ifndef RMLUI_CORE_LOGDEFAULT_H 30 | #define RMLUI_CORE_LOGDEFAULT_H 31 | 32 | #include "../../Include/RmlUi/Core/Log.h" 33 | #include "../../Include/RmlUi/Core/Types.h" 34 | 35 | namespace Rml { 36 | 37 | /** 38 | Provides a platform-dependent default implementation for message logging. 39 | */ 40 | 41 | class LogDefault { 42 | public: 43 | static bool LogMessage(Log::Type type, const String& message); 44 | }; 45 | 46 | } // namespace Rml 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/RmlUi/Core/Profiling.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #include "../../Include/RmlUi/Core/Profiling.h" 30 | 31 | #ifdef RMLUI_TRACY_MEMORY_PROFILING 32 | #include 33 | #include 34 | 35 | void* operator new(size_t n) 36 | { 37 | // Overload global new and delete for memory inspection 38 | void* ptr = std::malloc(n); 39 | TracyAlloc(ptr, n); 40 | return ptr; 41 | } 42 | 43 | void operator delete(void* ptr) noexcept 44 | { 45 | TracyFree(ptr); 46 | std::free(ptr); 47 | } 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/RmlUi/Core/PropertyParserFilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #ifndef RMLUI_CORE_PROPERTYPARSERFILTER_H 30 | #define RMLUI_CORE_PROPERTYPARSERFILTER_H 31 | 32 | #include "../../Include/RmlUi/Core/PropertyParser.h" 33 | 34 | namespace Rml { 35 | 36 | /** 37 | A property parser for the filter property. 38 | */ 39 | 40 | class PropertyParserFilter : public PropertyParser { 41 | public: 42 | PropertyParserFilter(); 43 | virtual ~PropertyParserFilter(); 44 | 45 | /// Called to parse a decorator declaration. 46 | bool ParseValue(Property& property, const String& value, const ParameterMap& parameters) const override; 47 | }; 48 | 49 | } // namespace Rml 50 | #endif 51 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/RmlUi/Core/PropertyParserFontEffect.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #ifndef RMLUI_CORE_PROPERTYPARSERFONTEFFECT_H 30 | #define RMLUI_CORE_PROPERTYPARSERFONTEFFECT_H 31 | 32 | #include "../../Include/RmlUi/Core/PropertyParser.h" 33 | 34 | namespace Rml { 35 | 36 | /** 37 | A property parser for the font-effect property. 38 | */ 39 | 40 | class PropertyParserFontEffect : public PropertyParser { 41 | public: 42 | PropertyParserFontEffect(); 43 | virtual ~PropertyParserFontEffect(); 44 | 45 | /// Called to parse a font-effect declaration. 46 | bool ParseValue(Property& property, const String& value, const ParameterMap& parameters) const override; 47 | }; 48 | 49 | } // namespace Rml 50 | #endif 51 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/RmlUi/Core/PropertyParserKeyword.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #include "PropertyParserKeyword.h" 30 | 31 | namespace Rml { 32 | 33 | PropertyParserKeyword::PropertyParserKeyword() {} 34 | 35 | PropertyParserKeyword::~PropertyParserKeyword() {} 36 | 37 | bool PropertyParserKeyword::ParseValue(Property& property, const String& value, const ParameterMap& parameters) const 38 | { 39 | ParameterMap::const_iterator iterator = parameters.find(StringUtilities::ToLower(value)); 40 | if (iterator == parameters.end()) 41 | return false; 42 | 43 | property.value = Variant((*iterator).second); 44 | property.unit = Unit::KEYWORD; 45 | 46 | return true; 47 | } 48 | 49 | } // namespace Rml 50 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/RmlUi/Core/PropertyParserString.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #include "PropertyParserString.h" 30 | 31 | namespace Rml { 32 | 33 | PropertyParserString::PropertyParserString() {} 34 | 35 | PropertyParserString::~PropertyParserString() {} 36 | 37 | bool PropertyParserString::ParseValue(Property& property, const String& value, const ParameterMap& /*parameters*/) const 38 | { 39 | property.value = Variant(value); 40 | property.unit = Unit::STRING; 41 | 42 | return true; 43 | } 44 | 45 | } // namespace Rml 46 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/RmlUi/Core/Traits.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2019-2024 The RmlUi Team, and contributors 7 | * 8 | * Permission is hereby granted, free of charge, to any person obtaining a copy 9 | * of this software and associated documentation files (the "Software"), to deal 10 | * in the Software without restriction, including without limitation the rights 11 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the Software is 13 | * furnished to do so, subject to the following conditions: 14 | * 15 | * The above copyright notice and this permission notice shall be included in 16 | * all copies or substantial portions of the Software. 17 | * 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | * THE SOFTWARE. 25 | * 26 | */ 27 | 28 | #include "../../Include/RmlUi/Core/Traits.h" 29 | 30 | namespace Rml { 31 | 32 | int FamilyBase::GetNewId() 33 | { 34 | static int id = 0; 35 | return id++; 36 | } 37 | 38 | } // namespace Rml 39 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/RmlUi/Core/XMLNodeHandler.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #include "../../Include/RmlUi/Core/XMLNodeHandler.h" 30 | 31 | namespace Rml { 32 | 33 | XMLNodeHandler::~XMLNodeHandler() {} 34 | 35 | } // namespace Rml 36 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/RmlUi/Core/precompiled.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #ifndef RMLUI_CORE_PRECOMPILED_H 30 | #define RMLUI_CORE_PRECOMPILED_H 31 | 32 | #include "../../Include/RmlUi/Core.h" 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/RmlUi/Debugger/.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: InheritParentConfig 2 | NamespaceIndentation: None 3 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/RmlUi/Debugger/BeaconSource.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | static const char* beacon_rcss = R"RCSS( 30 | body 31 | { 32 | position: absolute; 33 | top: 5px; 34 | right: 33dp; 35 | z-index: 1000000; 36 | width: 20px; 37 | font-family: rmlui-debugger-font; 38 | font-size: 12dp; 39 | color: black; 40 | visibility: hidden; 41 | } 42 | button 43 | { 44 | display: block; 45 | width: 18dp; 46 | height: 18dp; 47 | text-align: center; 48 | border-width: 1px; 49 | font-weight: bold; 50 | } 51 | )RCSS"; 52 | 53 | static const char* beacon_rml = R"RML( 54 | 55 | )RML"; 56 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/RmlUi/Debugger/ElementDebugDocument.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2024 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #include "ElementDebugDocument.h" 30 | 31 | namespace Rml { 32 | namespace Debugger { 33 | 34 | ElementDebugDocument::ElementDebugDocument(const String& tag) : ElementDocument(tag) 35 | { 36 | SetFocusableFromModal(true); 37 | } 38 | 39 | } // namespace Debugger 40 | } // namespace Rml 41 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/RmlUi/Debugger/ElementDebugDocument.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2024 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #ifndef RMLUI_DEBUGGER_ELEMENTDEBUGDOCUMENT_H 30 | #define RMLUI_DEBUGGER_ELEMENTDEBUGDOCUMENT_H 31 | 32 | #include "../../Include/RmlUi/Core/ElementDocument.h" 33 | 34 | namespace Rml { 35 | namespace Debugger { 36 | 37 | class ElementDebugDocument : public ElementDocument { 38 | public: 39 | RMLUI_RTTI_DefineWithParent(ElementDebugDocument, ElementDocument) 40 | 41 | ElementDebugDocument(const String& tag); 42 | }; 43 | 44 | } // namespace Debugger 45 | } // namespace Rml 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/RmlUi/Lottie/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This plugin targets rmlui_core directly and is incorporated into the core library when enabled. 2 | 3 | target_sources(rmlui_core PRIVATE 4 | "${CMAKE_CURRENT_SOURCE_DIR}/ElementLottie.cpp" 5 | "${CMAKE_CURRENT_SOURCE_DIR}/LottiePlugin.cpp" 6 | "${CMAKE_CURRENT_SOURCE_DIR}/LottiePlugin.h" 7 | "${PROJECT_SOURCE_DIR}/Include/RmlUi/Lottie/ElementLottie.h" 8 | ) 9 | 10 | target_compile_definitions(rmlui_core PRIVATE "RMLUI_LOTTIE_PLUGIN") 11 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/RmlUi/Lottie/LottiePlugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #ifndef RMLUI_LOTTIE_LOTTIE_PLUGIN_H 30 | #define RMLUI_LOTTIE_LOTTIE_PLUGIN_H 31 | 32 | namespace Rml { 33 | namespace Lottie { 34 | 35 | void Initialise(); 36 | 37 | } 38 | } // namespace Rml 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/RmlUi/SVG/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This plugin targets rmlui_core directly and is incorporated into the core library when enabled. 2 | 3 | target_sources(rmlui_core PRIVATE 4 | "${CMAKE_CURRENT_SOURCE_DIR}/ElementSVG.cpp" 5 | "${CMAKE_CURRENT_SOURCE_DIR}/SVGPlugin.cpp" 6 | "${CMAKE_CURRENT_SOURCE_DIR}/SVGPlugin.h" 7 | "${PROJECT_SOURCE_DIR}/Include/RmlUi/SVG/ElementSVG.h" 8 | ) 9 | 10 | target_compile_definitions(rmlui_core PRIVATE "RMLUI_SVG_PLUGIN") 11 | -------------------------------------------------------------------------------- /RmlUi/src/RmlUi/RmlUi/SVG/SVGPlugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This source file is part of RmlUi, the HTML/CSS Interface Middleware 3 | * 4 | * For the latest information, see http://github.com/mikke89/RmlUi 5 | * 6 | * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd 7 | * Copyright (c) 2019-2023 The RmlUi Team, and contributors 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | */ 28 | 29 | #ifndef RMLUI_SVG_SVG_PLUGIN_H 30 | #define RMLUI_SVG_SVG_PLUGIN_H 31 | 32 | namespace Rml { 33 | namespace SVG { 34 | 35 | void Initialise(); 36 | 37 | } 38 | } // namespace Rml 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /examples/directx11/directx11.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {83abc276-0ab2-4f35-8c92-cceca6c3baab} 10 | 11 | 12 | 13 | 14 | src 15 | 16 | 17 | 18 | 19 | resources 20 | 21 | 22 | -------------------------------------------------------------------------------- /examples/directx9/directx9.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {f118d2f2-ed8e-4e3a-86ef-baf767b508ff} 10 | 11 | 12 | 13 | 14 | src 15 | 16 | 17 | 18 | 19 | resources 20 | 21 | 22 | -------------------------------------------------------------------------------- /examples/opengl3/glfw/libs/glfw3-x64.lib: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e64bfe0dfc05aa59fd68edc7c030922a0c645a00e4f8e19aa65614b4128e45b7 3 | size 634898 4 | -------------------------------------------------------------------------------- /examples/opengl3/glfw/libs/glfw3-x86.lib: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:fa2392f183336148d51e8c12cb2eff920c89751fcffdafe209bc93d2a17697ce 3 | size 494168 4 | -------------------------------------------------------------------------------- /examples/opengl3/opengl3.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {b96080db-f9ff-43e7-97c3-b20bf6a73306} 10 | 11 | 12 | 13 | 14 | src 15 | 16 | 17 | 18 | 19 | resources 20 | 21 | 22 | -------------------------------------------------------------------------------- /examples/opengl3/resources/resources.aps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0suddenly0/null-rmlui/bd96ff0528a57185172acd9d7c1ed453383ac6ee/examples/opengl3/resources/resources.aps -------------------------------------------------------------------------------- /examples/opengl3/resources/resources.rc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include -------------------------------------------------------------------------------- /examples/resources/images/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0suddenly0/null-rmlui/bd96ff0528a57185172acd9d7c1ed453383ac6ee/examples/resources/images/image.png -------------------------------------------------------------------------------- /examples/resources/rmlui/test.rml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 64 | 65 | 66 |
67 |
68 | 69 |
70 |
71 | 72 | 73 |
-------------------------------------------------------------------------------- /examples/resources/shared-resources.rc: -------------------------------------------------------------------------------- 1 | test.rml rml "rmlui/test.rml" 2 | image.png images "images/image.png" -------------------------------------------------------------------------------- /null-rmlui.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildThisFileDirectory) 5 | debug 6 | release 7 | 8 | 9 | 10 | 11 | $(NullRmluiRoot)src;$(NullRmluiRoot)RmlUi\Dependencies\include;%(AdditionalIncludeDirectories) 12 | 13 | 14 | $(NullRmluiRoot)build;%(AdditionalLibraryDirectories) 15 | null-rmlui-$(NullRmluiConfiguration)-$(LibrariesArchitecture).lib;%(AdditionalDependencies) 16 | 17 | 18 | -------------------------------------------------------------------------------- /render-interfaces/directx11/null-rmlui-renderer-directx11-feature1.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {1770fd49-9301-4a65-b628-3b612e7ac6ee} 5 | 6 | 7 | 8 | feature1 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /render-interfaces/directx11/null-rmlui-renderer-directx11-feature1.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /render-interfaces/directx11/null-rmlui-renderer-directx11.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildThisFileDirectory) 5 | debug 6 | release 7 | 8 | 9 | 10 | 11 | $(NullRmluiRendererDirectx11Root)src;%(AdditionalIncludeDirectories) 12 | 13 | 14 | $(NullRmluiRendererDirectx11Root)build;%(AdditionalLibraryDirectories) 15 | null-rmlui-renderer-directx11-$(NullRmluiRendererDirectx11Configuration)-$(LibrariesArchitecture).lib;%(AdditionalDependencies) 16 | 17 | 18 | -------------------------------------------------------------------------------- /render-interfaces/directx11/src/null-rmlui-renderer-directx11.cpp: -------------------------------------------------------------------------------- 1 | #include "null-rmlui-renderer-directx11.h" 2 | 3 | #include "null-rmlui-renderer-directx11/shaders/color/color.h" 4 | #include "null-rmlui-renderer-directx11/shaders/texture/texture.h" 5 | #include "null-rmlui-renderer-directx11/shaders/bliting/bliting.h" 6 | #include "null-rmlui-renderer-directx11/shaders/color-matrix/color-matrix.h" 7 | #include "null-rmlui-renderer-directx11/shaders/blend-mask/blend-mask.h" 8 | #include "null-rmlui-renderer-directx11/shaders/gradient/gradient.h" 9 | #include "null-rmlui-renderer-directx11/shaders/blur/blur.h" 10 | #include "null-rmlui-renderer-directx11/shaders/drop-shadow/drop-shadow.h" 11 | 12 | namespace ntl::rml::directx11 { 13 | void c_render::set_secondary_texture(void* texture) { 14 | render::directx11::shared.context->PSSetShaderResources(1, 1, (ID3D11ShaderResourceView**)&texture); 15 | } 16 | 17 | std::unique_ptr c_render::instance_mesh_pool() { 18 | return std::make_unique(); 19 | } 20 | 21 | void c_render::initialize() { 22 | renderer::color_shader = std::make_unique(); 23 | renderer::texture_shader = std::make_unique(); 24 | renderer::bliting_shader = std::make_unique(); 25 | renderer::color_matrix_shader = std::make_unique(); 26 | renderer::blend_mask_shader = std::make_unique(); 27 | renderer::gradient_shader = std::make_unique(); 28 | renderer::blur_shader = std::make_unique(); 29 | renderer::drop_shadow_shader = std::make_unique(); 30 | i_render_interface::initialize(); 31 | } 32 | } -------------------------------------------------------------------------------- /render-interfaces/directx11/src/null-rmlui-renderer-directx11.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "null-rmlui-renderer-directx11/mesh-pool/mesh-pool.h" 3 | 4 | namespace ntl::rml::directx11 { 5 | class c_render : public i_render_interface { 6 | public: 7 | void set_secondary_texture(void* texture) override; 8 | std::unique_ptr instance_mesh_pool() override; 9 | 10 | public: 11 | void initialize(); 12 | }; 13 | } -------------------------------------------------------------------------------- /render-interfaces/directx11/src/null-rmlui-renderer-directx11/mesh-pool/mesh-pool.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace ntl::rml::directx11 { 6 | class c_mesh_pool : public renderer::i_mesh_pool { 7 | public: using i_mesh_pool::i_mesh_pool; 8 | public: 9 | ID3D11InputLayout* input_layout{ }; 10 | ID3D11Buffer* vtx_buffer{ }, *idx_buffer{ }; 11 | 12 | public: 13 | bool create(mesh_t& mesh, Rml::Span& vertex_buffer, Rml::Span& index_buffer) override; 14 | 15 | public: 16 | void create() override; 17 | void destroy() override; 18 | 19 | public: 20 | void compile() override { } 21 | 22 | void use() override; 23 | }; 24 | } -------------------------------------------------------------------------------- /render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/blend-mask/blend-mask.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "compiled-object.h" 5 | 6 | namespace ntl::rml::directx11 { 7 | class c_blend_mask_shader : public renderer::i_blend_mask_shader, public render::directx11::c_shader { 8 | public: 9 | c_blend_mask_shader() : c_shader(&blend_mask_shader_object, &render::directx11::passthrough_vertex_shader_object) { } 10 | }; 11 | } -------------------------------------------------------------------------------- /render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/blend-mask/compiled-object.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace ntl::rml::directx11 { 5 | namespace sources { 6 | static const std::vector& blend_mask() { 7 | #include "compiled/blend-mask.h" 8 | static const std::vector source(shader_data, shader_data + sizeof(shader_data)); 9 | return source; 10 | } 11 | } 12 | 13 | class c_blend_mask_shader_object : public render::directx11::c_pixel_shader { 14 | public: 15 | void create() override { 16 | if(!empty()) return; 17 | compile(sources::blend_mask()); 18 | } 19 | } inline blend_mask_shader_object{ }; 20 | } -------------------------------------------------------------------------------- /render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/blend-mask/hlsl/blend-mask.hlsl: -------------------------------------------------------------------------------- 1 | struct ps_input_t { 2 | float4 position : POSITION0; 3 | float2 uv : TEXCOORD0; 4 | float4 color : COLOR0; 5 | }; 6 | 7 | sampler texture_sampler; 8 | Texture2D texture_source : register(t0); 9 | Texture2D mask_source : register(t1); 10 | 11 | float4 main(ps_input_t input) : SV_Target { 12 | float4 texture_color = texture_source.Sample(texture_sampler, input.uv); 13 | float mask_alpha = mask_source.Sample(texture_sampler, input.uv).a; 14 | return texture_color * mask_alpha; 15 | } -------------------------------------------------------------------------------- /render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/bliting/bliting.cpp: -------------------------------------------------------------------------------- 1 | #include "bliting.h" 2 | 3 | namespace ntl::rml::directx11 { 4 | void c_bliting_shader::set_constants(const constants_t& constants) { 5 | bliting_shader_object.set_constant(constants); 6 | } 7 | } -------------------------------------------------------------------------------- /render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/bliting/bliting.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "compiled-object.h" 4 | 5 | namespace ntl::rml::directx11 { 6 | class c_bliting_shader : public renderer::i_bliting_shader, public render::directx11::c_shader { 7 | public: 8 | c_bliting_shader() : c_shader(&bliting_shader_object, &render::directx11::passthrough_vertex_shader_object) { } 9 | 10 | public: 11 | void set_constants(const constants_t& constants) override; 12 | }; 13 | } -------------------------------------------------------------------------------- /render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/bliting/compiled-object.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace ntl::rml::directx11 { 6 | namespace sources { 7 | static const std::vector& bliting() { 8 | #include "compiled/bliting.h" 9 | static const std::vector source(shader_data, shader_data + sizeof(shader_data)); 10 | return source; 11 | } 12 | } 13 | 14 | class c_bliting_shader_object : public render::directx11::c_pixel_shader { 15 | public: 16 | render::directx11::c_constant_buffer constant_buffer{ }; 17 | 18 | public: 19 | void set_constant(const renderer::i_bliting_shader::constants_t& constant, int slot = 0) { 20 | constant_buffer.edit_constant(constant); 21 | set_constant_buffer(constant_buffer.buffer, slot); 22 | } 23 | 24 | public: 25 | void create() override { 26 | if(!empty()) return; 27 | compile(sources::bliting()); 28 | constant_buffer.create(); 29 | } 30 | 31 | void destroy() override { c_pixel_shader::destroy(); constant_buffer.destroy(); } 32 | } inline bliting_shader_object{ }; 33 | } -------------------------------------------------------------------------------- /render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/bliting/hlsl/bliting.hlsl: -------------------------------------------------------------------------------- 1 | cbuffer constant_buffer : register(b0) { 2 | float4 uv_limits; 3 | }; 4 | 5 | struct ps_input_t { 6 | float4 position : POSITION0; 7 | float2 uv : TEXCOORD0; 8 | float4 color : COLOR0; 9 | }; 10 | 11 | sampler texture_sampler; 12 | Texture2D texture_source; 13 | 14 | float4 main(ps_input_t input) : SV_Target { 15 | return texture_source.Sample(texture_sampler, clamp(input.uv, uv_limits.xy, uv_limits.zw)); 16 | } -------------------------------------------------------------------------------- /render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/blur/blur.cpp: -------------------------------------------------------------------------------- 1 | #include "blur.h" 2 | 3 | namespace ntl::rml::directx11 { 4 | void c_blur_shader::set_constants(const constants_t& constants) { 5 | blur_vertex_shader_object.set_constant({ constants.texel_offset }); 6 | 7 | c_blur_pixel_shader_object::constant_buffer_t pixel_constant_buffer{ }; 8 | pixel_constant_buffer.uv_limits = constants.uv_limits; 9 | for(auto [i, weight] : constants.weights | std::views::enumerate) { 10 | pixel_constant_buffer.weights[i].x = weight; 11 | } 12 | blur_pixel_shader_object.set_constant(pixel_constant_buffer); 13 | } 14 | } -------------------------------------------------------------------------------- /render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/blur/blur.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "compiled-object.h" 4 | 5 | namespace ntl::rml::directx11 { 6 | class c_blur_shader : public renderer::i_blur_shader, public render::directx11::c_shader { 7 | public: 8 | c_blur_shader() : c_shader(&blur_pixel_shader_object, &blur_vertex_shader_object) { } 9 | 10 | public: 11 | void set_constants(const constants_t& constants) override; 12 | }; 13 | } -------------------------------------------------------------------------------- /render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/blur/hlsl/blur-ps.hlsl: -------------------------------------------------------------------------------- 1 | #define _blur_size 7 2 | #define _num_weights ((_blur_size + 1) / 2) 3 | 4 | cbuffer constant_buffer : register(b0) { 5 | float4 uv_limits; 6 | float4 weights[_num_weights]; 7 | }; 8 | 9 | struct ps_input_t { 10 | float4 position : SV_POSITION; 11 | float2 uv[_blur_size] : TEXCOORD0; 12 | float4 color : COLOR0; 13 | }; 14 | 15 | sampler texture_sampler; 16 | Texture2D texture_source; 17 | 18 | float4 main(ps_input_t input) : SV_Target { 19 | float4 color = float4(0.0, 0.0, 0.0, 0.0); 20 | for (int i = 0; i < _blur_size; i++) { 21 | float2 in_region = step(uv_limits.xy, input.uv[i]) * step(input.uv[i], uv_limits.zw); 22 | color += texture_source.Sample(texture_sampler, input.uv[i]) * in_region.x * in_region.y * weights[abs(i - _num_weights + 1)].x; 23 | } 24 | return color; 25 | } -------------------------------------------------------------------------------- /render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/blur/hlsl/blur-vs.hlsl: -------------------------------------------------------------------------------- 1 | #define _blur_size 7 2 | #define _num_weights ((_blur_size + 1) / 2) 3 | 4 | cbuffer constant_buffer : register(b0) { 5 | float2 texel_offset; 6 | }; 7 | 8 | struct vs_input_t { 9 | float2 position : POSITION0; 10 | float2 uv : TEXCOORD0; 11 | float4 color : COLOR0; 12 | }; 13 | 14 | struct ps_input_t { 15 | float4 position : SV_POSITION; 16 | float2 uv[_blur_size] : TEXCOORD0; 17 | float4 color : COLOR0; 18 | }; 19 | 20 | ps_input_t main(vs_input_t input) { 21 | ps_input_t output; 22 | 23 | for(int i = 0; i < _blur_size; i++) 24 | output.uv[i] = input.uv - float(i - _num_weights + 1) * texel_offset; 25 | 26 | output.color = input.color; 27 | output.position = float4(input.position, 0.f, 1.f); 28 | return output; 29 | } -------------------------------------------------------------------------------- /render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/color-matrix/color-matrix.cpp: -------------------------------------------------------------------------------- 1 | #include "color-matrix.h" 2 | 3 | namespace ntl::rml::directx11 { 4 | void c_color_matrix_shader::set_constants(const constants_t& constants) { 5 | color_matrix_shader_object.set_constant(constants); 6 | } 7 | } -------------------------------------------------------------------------------- /render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/color-matrix/color-matrix.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "compiled-object.h" 4 | 5 | namespace ntl::rml::directx11 { 6 | class c_color_matrix_shader : public renderer::i_color_matrix_shader, public render::directx11::c_shader { 7 | public: 8 | c_color_matrix_shader() : c_shader(&color_matrix_shader_object, &render::directx11::passthrough_vertex_shader_object) { } 9 | 10 | public: 11 | void set_constants(const constants_t& constants) override; 12 | }; 13 | } -------------------------------------------------------------------------------- /render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/color-matrix/compiled-object.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace ntl::rml::directx11 { 6 | namespace sources { 7 | static const std::vector& color_matrix() { 8 | #include "compiled/color-matrix.h" 9 | static const std::vector source(shader_data, shader_data + sizeof(shader_data)); 10 | return source; 11 | } 12 | } 13 | 14 | class c_color_matrix_shader_object : public render::directx11::c_pixel_shader { 15 | public: 16 | render::directx11::c_constant_buffer constant_buffer{ }; 17 | 18 | public: 19 | void set_constant(const renderer::i_color_matrix_shader::constants_t& constant, int slot = 0) { 20 | constant_buffer.edit_constant(constant); 21 | set_constant_buffer(constant_buffer.buffer, slot); 22 | } 23 | 24 | public: 25 | void create() override { 26 | if(!empty()) return; 27 | compile(sources::color_matrix()); 28 | constant_buffer.create(); 29 | } 30 | 31 | void destroy() override { c_pixel_shader::destroy(); constant_buffer.destroy(); } 32 | } inline color_matrix_shader_object{ }; 33 | } -------------------------------------------------------------------------------- /render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/color-matrix/hlsl/color-matrix.hlsl: -------------------------------------------------------------------------------- 1 | cbuffer constant_buffer : register(b0) { 2 | float4x4 color_matrix; 3 | }; 4 | 5 | struct ps_input_t { 6 | float4 position : POSITION0; 7 | float2 uv : TEXCOORD0; 8 | float4 color : COLOR0; 9 | }; 10 | 11 | sampler texture_sampler; 12 | Texture2D texture_source; 13 | 14 | float4 main(ps_input_t input) : SV_Target { 15 | float4 sampler_color = texture_source.Sample(texture_sampler, input.uv); 16 | float4 transformed_color = mul(color_matrix, sampler_color); 17 | return float4(transformed_color.xyz, sampler_color.a); 18 | } -------------------------------------------------------------------------------- /render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/color/color.cpp: -------------------------------------------------------------------------------- 1 | #include "color.h" 2 | 3 | namespace ntl::rml::directx11 { 4 | void c_color_shader::use() { 5 | if(empty()) return; 6 | c_shader::use(); 7 | 8 | color_shader_object.set_constant({ 9 | ntl::render::backend::renderer->get_matrix(), 10 | ntl::render::backend::renderer->get_translation(), 11 | ntl::render::backend::renderer->get_depth() 12 | }); 13 | } 14 | } -------------------------------------------------------------------------------- /render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/color/color.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include "compiled-object.h" 6 | 7 | namespace ntl::rml::directx11 { 8 | class c_color_shader : public renderer::i_color_shader, public render::directx11::c_shader { 9 | public: 10 | c_color_shader() : c_shader(&render::directx11::color_pixel_shader_object, &color_shader_object) { } 11 | 12 | public: 13 | void use() override; 14 | }; 15 | } -------------------------------------------------------------------------------- /render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/color/compiled-object.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace ntl::rml::directx11 { 6 | namespace sources { 7 | static const std::vector& color() { 8 | #include "compiled/color.h" 9 | static const std::vector source(shader_data, shader_data + sizeof(shader_data)); 10 | return source; 11 | } 12 | } 13 | 14 | class c_color_shader_object : public render::directx11::c_vertex_shader { 15 | public: 16 | struct constant_buffer_t { 17 | public: 18 | matrix4x4_t matrix{ }; 19 | vec2_t translation{ }; 20 | float depth{ }; 21 | }; 22 | render::directx11::c_constant_buffer constant_buffer{ }; 23 | 24 | public: 25 | void set_constant(const constant_buffer_t& constant, int slot = 0) { 26 | constant_buffer.edit_constant(constant); 27 | set_constant_buffer(constant_buffer.buffer, slot); 28 | } 29 | 30 | public: 31 | void create() override { 32 | if(!empty()) return; 33 | compile(sources::color()); 34 | constant_buffer.create(); 35 | } 36 | 37 | void destroy() override { c_vertex_shader::destroy(); constant_buffer.destroy(); } 38 | } inline color_shader_object{ }; 39 | } -------------------------------------------------------------------------------- /render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/color/hlsl/color.hlsl: -------------------------------------------------------------------------------- 1 | cbuffer constant_buffer : register(b0) { 2 | matrix projection_matrix; 3 | float2 translation; 4 | float depth; 5 | }; 6 | 7 | struct vs_input_t { 8 | float2 position : POSITION; 9 | float2 uv : TEXCOORD0; 10 | float4 color : COLOR0; 11 | }; 12 | 13 | struct ps_input_t { 14 | float4 position : SV_POSITION; 15 | float2 uv : TEXCOORD0; 16 | float4 color : COLOR0; 17 | }; 18 | 19 | ps_input_t main(vs_input_t input) { 20 | ps_input_t output; 21 | output.position = mul(projection_matrix, float4(input.position + translation, depth, 1.f)); 22 | output.color = input.color; 23 | output.uv = input.uv; 24 | return output; 25 | } -------------------------------------------------------------------------------- /render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/drop-shadow/compiled-object.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace ntl::rml::directx11 { 6 | namespace sources { 7 | static const std::vector& drop_shadow() { 8 | #include "compiled/drop-shadow.h" 9 | static const std::vector source(shader_data, shader_data + sizeof(shader_data)); 10 | return source; 11 | } 12 | } 13 | 14 | class c_drop_shadow_shader_object : public render::directx11::c_pixel_shader { 15 | public: 16 | render::directx11::c_constant_buffer constant_buffer{ }; 17 | 18 | public: 19 | void set_constant(const renderer::i_drop_shadow_shader::constants_t& constant, int slot = 0) { 20 | constant_buffer.edit_constant(constant); 21 | set_constant_buffer(constant_buffer.buffer, slot); 22 | } 23 | 24 | public: 25 | void create() override { 26 | if(!empty()) return; 27 | compile(sources::drop_shadow()); 28 | constant_buffer.create(); 29 | } 30 | 31 | void destroy() override { c_pixel_shader::destroy(); constant_buffer.destroy(); } 32 | } inline drop_shadow_shader_object{ }; 33 | } -------------------------------------------------------------------------------- /render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/drop-shadow/drop-shadow.cpp: -------------------------------------------------------------------------------- 1 | #include "drop-shadow.h" 2 | 3 | namespace ntl::rml::directx11 { 4 | void c_drop_shadow_shader::set_constants(const constants_t& constants) { 5 | drop_shadow_shader_object.set_constant(constants); 6 | } 7 | } -------------------------------------------------------------------------------- /render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/drop-shadow/drop-shadow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "compiled-object.h" 4 | 5 | namespace ntl::rml::directx11 { 6 | class c_drop_shadow_shader : public renderer::i_drop_shadow_shader, public render::directx11::c_shader { 7 | public: 8 | c_drop_shadow_shader() : c_shader(&drop_shadow_shader_object, &render::directx11::passthrough_vertex_shader_object) { } 9 | 10 | public: 11 | void set_constants(const constants_t& constants) override; 12 | }; 13 | } -------------------------------------------------------------------------------- /render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/drop-shadow/hlsl/drop-shadow.hlsl: -------------------------------------------------------------------------------- 1 | cbuffer constant_buffer : register(b0) { 2 | float4 uv_limits; 3 | float4 shadow_color; 4 | }; 5 | 6 | struct ps_input_t { 7 | float4 position : SV_POSITION; 8 | float2 uv : TEXCOORD0; 9 | float4 color : COLOR0; 10 | }; 11 | 12 | sampler texture_sampler; 13 | Texture2D texture_source; 14 | 15 | float4 main(ps_input_t input) : SV_Target { 16 | float2 in_region = step(uv_limits.xy, input.uv) * step(input.uv, uv_limits.zw); 17 | return texture_source.Sample(texture_sampler, input.uv).a * in_region.x * in_region.y * shadow_color; 18 | } -------------------------------------------------------------------------------- /render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/gradient/compiled-object.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace ntl::rml::directx11 { 5 | namespace sources { 6 | static const std::vector& gradient() { 7 | #include "compiled/gradient.h" 8 | static const std::vector source(shader_data, shader_data + sizeof(shader_data)); 9 | return source; 10 | } 11 | } 12 | 13 | class c_gradient_shader_object : public render::directx11::c_pixel_shader { 14 | public: 15 | struct constant_buffer_t { 16 | public: 17 | std::array, 16> colors{ }; 18 | std::array, 16> stops{ }; 19 | vec2_t p{ }, v{ }; 20 | int func{ }, num_stops{ }; 21 | }; 22 | render::directx11::c_constant_buffer constant_buffer{ }; 23 | 24 | public: 25 | void set_constant(const constant_buffer_t& constant, int slot = 0) { 26 | constant_buffer.edit_constant(constant); 27 | set_constant_buffer(constant_buffer.buffer, slot); 28 | } 29 | 30 | public: 31 | void create() override { 32 | if(!empty()) return; 33 | compile(sources::gradient()); 34 | constant_buffer.create(); 35 | } 36 | 37 | void destroy() override { c_pixel_shader::destroy(); constant_buffer.destroy(); } 38 | } inline gradient_shader_object{ }; 39 | } -------------------------------------------------------------------------------- /render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/gradient/gradient.cpp: -------------------------------------------------------------------------------- 1 | #include "gradient.h" 2 | 3 | namespace ntl::rml::directx11 { 4 | void c_gradient_shader::use() { 5 | if(empty()) return; 6 | c_shader::use(); 7 | 8 | color_shader_object.set_constant({ 9 | ntl::render::backend::renderer->get_matrix(), 10 | ntl::render::backend::renderer->get_translation(), 11 | ntl::render::backend::renderer->get_depth() 12 | }); 13 | } 14 | 15 | void c_gradient_shader::set_constants(const constants_t& constants) { 16 | c_gradient_shader_object::constant_buffer_t constant_buffer{ }; 17 | 18 | for(auto [color, stop, pair] : std::views::zip(constant_buffer.colors, constant_buffer.stops, constants.stops)) { 19 | color = pair.first; 20 | stop.x = pair.second; 21 | } 22 | 23 | constant_buffer.p = constants.p; 24 | constant_buffer.v = constants.v; 25 | constant_buffer.func = (int)constants.function; 26 | constant_buffer.num_stops = constants.stops.size(); 27 | 28 | gradient_shader_object.set_constant(constant_buffer); 29 | } 30 | } -------------------------------------------------------------------------------- /render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/gradient/gradient.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "../color/compiled-object.h" 5 | #include "compiled-object.h" 6 | 7 | namespace ntl::rml::directx11 { 8 | class c_gradient_shader : public renderer::i_gradient_shader, public render::directx11::c_shader { 9 | public: 10 | c_gradient_shader() : c_shader(&gradient_shader_object, &color_shader_object) { } 11 | 12 | public: 13 | void use() override; 14 | 15 | public: 16 | void set_constants(const constants_t& constants) override; 17 | }; 18 | } -------------------------------------------------------------------------------- /render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/gradient/hlsl/gradient.hlsl: -------------------------------------------------------------------------------- 1 | #define _linear 0 2 | #define _radial 1 3 | #define _conic 2 4 | #define _repeating_linear 3 5 | #define _repeating_radial 4 6 | #define _repeating_conic 5 7 | #define _pi 3.14159265 8 | 9 | cbuffer constant_buffer : register(b0) { 10 | float4 stop_colors[16]; 11 | float4 stop_positions[16]; // normalized, 0 -> starting point, 1 -> ending point 12 | float2 p; // linear: starting point, radial: center, conic: center 13 | float2 v; // linear: vector to ending point, radial: 2d curvature (inverse radius), conic: angled unit vector 14 | int func; // one of the above definitions 15 | int num_stops; 16 | }; 17 | 18 | struct ps_input_t { 19 | float4 position : POSITION0; 20 | float2 uv : TEXCOORD0; 21 | float4 color : COLOR0; 22 | }; 23 | 24 | float4 mix_stop_colors(float t) { 25 | float4 color = stop_colors[0]; 26 | 27 | for (int i = 1; i < num_stops; i++) 28 | color = lerp(color, stop_colors[i], smoothstep(stop_positions[i - 1].x, stop_positions[i].x, t)); 29 | 30 | return color; 31 | } 32 | 33 | float mod(float x, float y) { return x - y * floor(x / y); } 34 | 35 | float4 main(ps_input_t input) : SV_Target { 36 | float t = 0.0; 37 | 38 | if (func == _linear || func == _repeating_linear) { 39 | float dist_square = dot(v, v); 40 | float2 V = input.uv - p; 41 | t = dot(v, V) / dist_square; 42 | } else if (func == _radial || func == _repeating_radial) { 43 | float2 V = input.uv - p; 44 | t = length(v * V); 45 | } else if (func == _conic || func == _repeating_conic) { 46 | float2x2 R = float2x2(v.x, -v.y, v.y, v.x); 47 | float2 V = mul(R, input.uv - p); 48 | t = 0.5 + atan2(-V.x, V.y) / (2.0 * _pi); 49 | } 50 | 51 | if (func == _repeating_linear || func == _repeating_radial || func == _repeating_conic) { 52 | float t0 = stop_positions[0].x; 53 | float t1 = stop_positions[num_stops - 1].x; 54 | t = t0 + mod(t - t0, t1 - t0); 55 | } 56 | 57 | return input.color * mix_stop_colors(t); 58 | } -------------------------------------------------------------------------------- /render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/texture/texture.cpp: -------------------------------------------------------------------------------- 1 | #include "texture.h" 2 | 3 | namespace ntl::rml::directx11 { 4 | void c_texture_shader::use() { 5 | if(empty()) return; 6 | c_shader::use(); 7 | 8 | color_shader_object.set_constant({ 9 | ntl::render::backend::renderer->get_matrix(), 10 | ntl::render::backend::renderer->get_translation(), 11 | ntl::render::backend::renderer->get_depth() 12 | }); 13 | } 14 | } -------------------------------------------------------------------------------- /render-interfaces/directx11/src/null-rmlui-renderer-directx11/shaders/texture/texture.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include "../color/compiled-object.h" 6 | 7 | namespace ntl::rml::directx11 { 8 | class c_texture_shader : public renderer::i_texture_shader, public render::directx11::c_shader { 9 | public: 10 | c_texture_shader() : c_shader(&render::directx11::texture_shader_object, &color_shader_object) { } 11 | 12 | public: 13 | void use() override; 14 | }; 15 | } -------------------------------------------------------------------------------- /render-interfaces/directx9/null-rmlui-renderer-directx9.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildThisFileDirectory) 5 | debug 6 | release 7 | 8 | 9 | 10 | 11 | $(NullRmluiRendererDirectx9Root)src;%(AdditionalIncludeDirectories) 12 | 13 | 14 | $(NullRmluiRendererDirectx9Root)build;%(AdditionalLibraryDirectories) 15 | null-rmlui-renderer-directx9-$(NullRmluiRendererDirectx9Configuration)-$(LibrariesArchitecture).lib;%(AdditionalDependencies) 16 | 17 | 18 | -------------------------------------------------------------------------------- /render-interfaces/directx9/src/null-rmlui-renderer-directx9.cpp: -------------------------------------------------------------------------------- 1 | #include "null-rmlui-renderer-directx9.h" 2 | 3 | #include "null-rmlui-renderer-directx9/shaders/color/color.h" 4 | #include "null-rmlui-renderer-directx9/shaders/texture/texture.h" 5 | #include "null-rmlui-renderer-directx9/shaders/bliting/bliting.h" 6 | #include "null-rmlui-renderer-directx9/shaders/color-matrix/color-matrix.h" 7 | #include "null-rmlui-renderer-directx9/shaders/blend-mask/blend-mask.h" 8 | #include "null-rmlui-renderer-directx9/shaders/gradient/gradient.h" 9 | #include "null-rmlui-renderer-directx9/shaders/blur/blur.h" 10 | #include "null-rmlui-renderer-directx9/shaders/drop-shadow/drop-shadow.h" 11 | 12 | namespace ntl::rml::directx9 { 13 | void c_render::set_secondary_texture(void* texture) { 14 | render::directx9::shared.device->SetTexture(1, (IDirect3DTexture9*)texture); 15 | } 16 | 17 | std::unique_ptr c_render::instance_mesh_pool() { 18 | return std::make_unique(); 19 | } 20 | 21 | void c_render::initialize() { 22 | renderer::color_shader = std::make_unique(); 23 | renderer::texture_shader = std::make_unique(); 24 | renderer::bliting_shader = std::make_unique(); 25 | renderer::color_matrix_shader = std::make_unique(); 26 | renderer::blend_mask_shader = std::make_unique(); 27 | renderer::gradient_shader = std::make_unique(); 28 | renderer::blur_shader = std::make_unique(); 29 | renderer::drop_shadow_shader = std::make_unique(); 30 | i_render_interface::initialize(); 31 | } 32 | } -------------------------------------------------------------------------------- /render-interfaces/directx9/src/null-rmlui-renderer-directx9.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "null-rmlui-renderer-directx9/mesh-pool/mesh-pool.h" 3 | 4 | namespace ntl::rml::directx9 { 5 | class c_render : public i_render_interface { 6 | public: 7 | void set_secondary_texture(void* texture) override; 8 | std::unique_ptr instance_mesh_pool() override; 9 | 10 | public: 11 | void initialize() override; 12 | }; 13 | } -------------------------------------------------------------------------------- /render-interfaces/directx9/src/null-rmlui-renderer-directx9/mesh-pool/mesh-pool.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace ntl::rml::directx9 { 6 | class c_mesh_pool : public renderer::i_mesh_pool { 7 | public: using i_mesh_pool::i_mesh_pool; 8 | public: 9 | IDirect3DVertexDeclaration9* vertex_declaration{ }; 10 | IDirect3DVertexBuffer9* vtx_buffer{ }; 11 | IDirect3DIndexBuffer9* idx_buffer{ }; 12 | 13 | public: 14 | bool create(mesh_t& mesh, Rml::Span& vertex_buffer, Rml::Span& index_buffer) override; 15 | 16 | public: 17 | void create() override; 18 | void destroy() override; 19 | 20 | public: 21 | void compile() override { } 22 | 23 | void use() override; 24 | }; 25 | } -------------------------------------------------------------------------------- /render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/blend-mask/blend-mask.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "compiled-object.h" 5 | 6 | namespace ntl::rml::directx9 { 7 | class c_blend_mask_shader : public renderer::i_blend_mask_shader, public render::directx9::c_shader { 8 | public: 9 | c_blend_mask_shader() : c_shader(&blend_mask_shader_object, &render::directx9::passthrough_vertex_shader_object) { } 10 | }; 11 | } -------------------------------------------------------------------------------- /render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/blend-mask/compiled-object.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace ntl::rml::directx9 { 5 | namespace sources { 6 | static const std::vector& blend_mask() { 7 | #include "compiled/blend-mask.h" 8 | static const std::vector source(shader_data, shader_data + sizeof(shader_data)); 9 | return source; 10 | } 11 | } 12 | 13 | class c_blend_mask_shader_object : public render::directx9::c_pixel_shader { 14 | public: 15 | virtual const byte* get_source() override { return sources::blend_mask().data(); } 16 | } inline blend_mask_shader_object{ }; 17 | } -------------------------------------------------------------------------------- /render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/blend-mask/hlsl/blend-mask.hlsl: -------------------------------------------------------------------------------- 1 | struct ps_input_t { 2 | float4 position : POSITION0; 3 | float2 uv : TEXCOORD0; 4 | float4 color : COLOR0; 5 | }; 6 | 7 | sampler texture_sampler : register(s0); 8 | sampler mask_sampler : register(s1); 9 | 10 | float4 main(ps_input_t input) : COLOR { 11 | float4 texture_color = tex2D(texture_sampler, input.uv); 12 | float mask_alpha = tex2D(mask_sampler, input.uv).a; 13 | return texture_color * mask_alpha; 14 | } -------------------------------------------------------------------------------- /render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/bliting/bliting.cpp: -------------------------------------------------------------------------------- 1 | #include "bliting.h" 2 | 3 | namespace ntl::rml::directx9 { 4 | void c_bliting_shader::set_constants(const constants_t& constants) { 5 | pixel_shader->set_constant(0, constants.uv_limits.linear_corners.data()); 6 | } 7 | } -------------------------------------------------------------------------------- /render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/bliting/bliting.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "compiled-object.h" 5 | 6 | namespace ntl::rml::directx9 { 7 | class c_bliting_shader : public renderer::i_bliting_shader, public render::directx9::c_shader { 8 | public: 9 | c_bliting_shader() : c_shader(&bliting_shader_object, &render::directx9::passthrough_vertex_shader_object) { } 10 | 11 | public: 12 | void set_constants(const constants_t& constants) override; 13 | }; 14 | } -------------------------------------------------------------------------------- /render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/bliting/compiled-object.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace ntl::rml::directx9 { 5 | namespace sources { 6 | static const std::vector& bliting() { 7 | #include "compiled/bliting.h" 8 | static const std::vector source(shader_data, shader_data + sizeof(shader_data)); 9 | return source; 10 | } 11 | } 12 | 13 | class c_bliting_shader_object : public render::directx9::c_pixel_shader { 14 | public: 15 | virtual const byte* get_source() override { return sources::bliting().data(); } 16 | } inline bliting_shader_object{ }; 17 | } -------------------------------------------------------------------------------- /render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/bliting/hlsl/bliting.hlsl: -------------------------------------------------------------------------------- 1 | struct ps_input_t { 2 | float4 position : POSITION0; 3 | float2 uv : TEXCOORD0; 4 | float4 color : COLOR0; 5 | }; 6 | 7 | sampler texture_sampler; 8 | 9 | float4 uv_limits : register(c0); 10 | 11 | float4 main(ps_input_t input) : COLOR { 12 | return tex2D(texture_sampler, clamp(input.uv, uv_limits.xy, uv_limits.zw)); 13 | } -------------------------------------------------------------------------------- /render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/blur/blur.cpp: -------------------------------------------------------------------------------- 1 | #include "blur.h" 2 | 3 | namespace ntl::rml::directx9 { 4 | void c_blur_shader::set_constants(const constants_t& constants) { 5 | vertex_shader->set_constant(1, constants.texel_offset.coordinates.data()); 6 | 7 | pixel_shader->set_constant(0, constants.uv_limits.min.coordinates.data()); 8 | pixel_shader->set_constant(1, constants.uv_limits.max.coordinates.data()); 9 | 10 | std::vector> align_weights{ }; 11 | for(float weight : constants.weights) { 12 | align_weights.push_back(vec4_t(weight)); 13 | } 14 | pixel_shader->set_constant(2, (float*)align_weights.data(), _num_weights); 15 | } 16 | } -------------------------------------------------------------------------------- /render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/blur/blur.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "compiled-object.h" 5 | 6 | namespace ntl::rml::directx9 { 7 | class c_blur_shader : public renderer::i_blur_shader, public render::directx9::c_shader { 8 | public: 9 | c_blur_shader() : c_shader(&blur_pixel_shader_object, &blur_vertex_shader_object) { } 10 | 11 | public: 12 | void set_constants(const constants_t& constants) override; 13 | }; 14 | } -------------------------------------------------------------------------------- /render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/blur/compiled-object.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace ntl::rml::directx9 { 5 | namespace sources { 6 | static const std::vector& blur_ps() { 7 | #include "compiled/blur-ps.h" 8 | static const std::vector source(shader_data, shader_data + sizeof(shader_data)); 9 | return source; 10 | } 11 | 12 | static const std::vector& blur_vs() { 13 | #include "compiled/blur-vs.h" 14 | static const std::vector source(shader_data, shader_data + sizeof(shader_data)); 15 | return source; 16 | } 17 | } 18 | 19 | class c_blur_pixel_shader_object : public render::directx9::c_pixel_shader { 20 | public: 21 | virtual const byte* get_source() override { return sources::blur_ps().data(); } 22 | } inline blur_pixel_shader_object{ }; 23 | 24 | class c_blur_vertex_shader_object : public render::directx9::c_vertex_shader { 25 | public: 26 | virtual const byte* get_source() override { return sources::blur_vs().data(); } 27 | } inline blur_vertex_shader_object{ }; 28 | } -------------------------------------------------------------------------------- /render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/blur/hlsl/blur-ps.hlsl: -------------------------------------------------------------------------------- 1 | #define _blur_size 7 2 | #define _num_weights ((_blur_size + 1) / 2) 3 | 4 | struct ps_input_t { 5 | float4 position : POSITION0; 6 | float2 uv[_blur_size] : TEXCOORD0; 7 | float4 color : COLOR0; 8 | }; 9 | 10 | sampler texture_sampler; 11 | 12 | //@note: Everything breaks if you use float4 (Most likely due to alignment). 13 | // I fuck shaders on dx9, so I don't intend to waste extra time just to reduce the number of variables 14 | float2 uv_min : register(c0); 15 | float2 uv_max : register(c1); 16 | float4 weights[_num_weights] : register(c2); 17 | 18 | float4 main(ps_input_t input) : COLOR { 19 | float4 color = float4(0.0, 0.0, 0.0, 0.0); 20 | for (int i = 0; i < _blur_size; i++) { 21 | float2 in_region = step(uv_min, input.uv[i]) * step(input.uv[i], uv_max); 22 | color += tex2D(texture_sampler, input.uv[i]) * in_region.x * in_region.y * weights[abs(i - _num_weights + 1)].x; 23 | } 24 | return color; 25 | } -------------------------------------------------------------------------------- /render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/blur/hlsl/blur-vs.hlsl: -------------------------------------------------------------------------------- 1 | #define _blur_size 7 2 | #define _num_weights ((_blur_size + 1) / 2) 3 | 4 | float2 texel_offset : register(c0); 5 | float2 blur_texel_offset : register(c1); 6 | 7 | struct vs_input_t { 8 | float2 position : POSITION0; 9 | float2 uv : TEXCOORD0; 10 | float4 color : COLOR0; 11 | }; 12 | 13 | struct ps_input_t { 14 | float4 position : POSITION0; 15 | float2 uv[_blur_size] : TEXCOORD0; 16 | float4 color : COLOR0; 17 | }; 18 | 19 | ps_input_t main(vs_input_t input) { 20 | ps_input_t output; 21 | 22 | for(int i = 0; i < _blur_size; i++) 23 | output.uv[i] = input.uv - float(i - _num_weights + 1) * blur_texel_offset; 24 | 25 | output.color = input.color; 26 | output.position = float4(input.position, 0.0f, 1.0f); 27 | output.position.xy += texel_offset; 28 | return output; 29 | } -------------------------------------------------------------------------------- /render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/color-matrix/color-matrix.cpp: -------------------------------------------------------------------------------- 1 | #include "color-matrix.h" 2 | 3 | namespace ntl::rml::directx9 { 4 | void c_color_matrix_shader::set_constants(const constants_t& constants) { 5 | pixel_shader->set_constant(0, constants.color_matrix.linear_array.data(), 4); 6 | } 7 | } -------------------------------------------------------------------------------- /render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/color-matrix/color-matrix.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "compiled-object.h" 5 | 6 | namespace ntl::rml::directx9 { 7 | class c_color_matrix_shader : public renderer::i_color_matrix_shader, public render::directx9::c_shader { 8 | public: 9 | c_color_matrix_shader() : c_shader(&color_matrix_shader_object, &render::directx9::passthrough_vertex_shader_object) { } 10 | 11 | public: 12 | void set_constants(const constants_t& constants) override; 13 | }; 14 | } -------------------------------------------------------------------------------- /render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/color-matrix/compiled-object.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace ntl::rml::directx9 { 5 | namespace sources { 6 | static const std::vector& color_matrix() { 7 | #include "compiled/color-matrix.h" 8 | static const std::vector source(shader_data, shader_data + sizeof(shader_data)); 9 | return source; 10 | } 11 | } 12 | 13 | class c_color_matrix_shader_object : public render::directx9::c_pixel_shader { 14 | public: 15 | virtual const byte* get_source() override { return sources::color_matrix().data(); } 16 | } inline color_matrix_shader_object{ }; 17 | } -------------------------------------------------------------------------------- /render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/color-matrix/hlsl/color-matrix.hlsl: -------------------------------------------------------------------------------- 1 | struct ps_input_t { 2 | float4 position : POSITION0; 3 | float2 uv : TEXCOORD0; 4 | float4 color : COLOR0; 5 | }; 6 | 7 | float4x4 color_matrix : register(c0); 8 | 9 | sampler texture_sampler; 10 | 11 | float4 main(ps_input_t input) : COLOR { 12 | float4 sampler_color = tex2D(texture_sampler, input.uv); 13 | float4 transformed_color = mul(color_matrix, sampler_color); 14 | return float4(transformed_color.xyz, sampler_color.a); 15 | } -------------------------------------------------------------------------------- /render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/color/color.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "compiled-object.h" 5 | 6 | namespace ntl::rml::directx9 { 7 | class c_color_shader : public renderer::i_color_shader, public render::directx9::c_default_shader { 8 | public: 9 | c_color_shader() : c_default_shader(&render::directx9::color_pixel_shader_object, &color_shader_object) { } 10 | }; 11 | } -------------------------------------------------------------------------------- /render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/color/compiled-object.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace ntl::rml::directx9 { 6 | namespace sources { 7 | static const std::vector& color() { 8 | #include "compiled/color.h" 9 | static const std::vector source(shader_data, shader_data + sizeof(shader_data)); 10 | return source; 11 | } 12 | } 13 | 14 | class c_color_shader_object : public render::directx9::c_vertex_shader { 15 | public: 16 | virtual const byte* get_source() override { return sources::color().data(); } 17 | } inline color_shader_object{ }; 18 | } -------------------------------------------------------------------------------- /render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/color/hlsl/color.hlsl: -------------------------------------------------------------------------------- 1 | float2 texel_offset : register(c0); 2 | matrix projection_matrix : register(c1); 3 | float2 translation : register(c5); 4 | float depth : register(c6); 5 | 6 | struct vs_input_t { 7 | float2 position : POSITION0; 8 | float2 uv : TEXCOORD0; 9 | float4 color : COLOR0; 10 | }; 11 | 12 | struct ps_input_t { 13 | float4 position : POSITION0; 14 | float2 uv : TEXCOORD0; 15 | float4 color : COLOR0; 16 | }; 17 | 18 | ps_input_t main(vs_input_t input) { 19 | ps_input_t output; 20 | output.uv = input.uv; 21 | output.color = input.color; 22 | output.position = mul(projection_matrix, float4(input.position + translation, depth, 1.0f)); 23 | output.position.xy += texel_offset; 24 | return output; 25 | } -------------------------------------------------------------------------------- /render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/drop-shadow/compiled-object.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace ntl::rml::directx9 { 5 | namespace sources { 6 | static const std::vector& drop_shadow() { 7 | #include "compiled/drop-shadow.h" 8 | static const std::vector source(shader_data, shader_data + sizeof(shader_data)); 9 | return source; 10 | } 11 | } 12 | 13 | class c_drop_shadow_shader_object : public render::directx9::c_pixel_shader { 14 | public: 15 | virtual const byte* get_source() override { return sources::drop_shadow().data(); } 16 | } inline drop_shadow_shader_object{ }; 17 | } -------------------------------------------------------------------------------- /render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/drop-shadow/drop-shadow.cpp: -------------------------------------------------------------------------------- 1 | #include "drop-shadow.h" 2 | 3 | namespace ntl::rml::directx9 { 4 | void c_drop_shadow_shader::set_constants(const constants_t& constants) { 5 | pixel_shader->set_constant(0, constants.uv_limits.linear_corners.data(), 4); 6 | pixel_shader->set_constant(1, constants.color.channels.data()); 7 | } 8 | } -------------------------------------------------------------------------------- /render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/drop-shadow/drop-shadow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "compiled-object.h" 5 | 6 | namespace ntl::rml::directx9 { 7 | class c_drop_shadow_shader : public renderer::i_drop_shadow_shader, public render::directx9::c_shader { 8 | public: 9 | c_drop_shadow_shader() : c_shader(&drop_shadow_shader_object, &render::directx9::passthrough_vertex_shader_object) { } 10 | 11 | public: 12 | void set_constants(const constants_t& constants) override; 13 | }; 14 | } -------------------------------------------------------------------------------- /render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/drop-shadow/hlsl/drop-shadow.hlsl: -------------------------------------------------------------------------------- 1 | struct ps_input_t { 2 | float4 position : POSITION0; 3 | float2 uv : TEXCOORD0; 4 | float4 color : COLOR0; 5 | }; 6 | 7 | sampler texture_sampler; 8 | 9 | float4 uv_limits : register(c0); 10 | float4 shadow_color : register(c1); 11 | 12 | float4 main(ps_input_t input) : COLOR { 13 | float2 in_region = step(uv_limits.xy, input.uv) * step(input.uv, uv_limits.zw); 14 | return tex2D(texture_sampler, input.uv).a * in_region.x * in_region.y * shadow_color; 15 | } -------------------------------------------------------------------------------- /render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/gradient/compiled-object.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace ntl::rml::directx9 { 5 | namespace sources { 6 | static const std::vector& gradient() { 7 | #include "compiled/gradient.h" 8 | static const std::vector source(shader_data, shader_data + sizeof(shader_data)); 9 | return source; 10 | } 11 | } 12 | 13 | class c_gradient_shader_object : public render::directx9::c_pixel_shader { 14 | public: 15 | virtual const byte* get_source() override { return sources::gradient().data(); } 16 | } inline gradient_shader_object{ }; 17 | } -------------------------------------------------------------------------------- /render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/gradient/gradient.cpp: -------------------------------------------------------------------------------- 1 | #include "gradient.h" 2 | 3 | namespace ntl::rml::directx9 { 4 | void c_gradient_shader::set_constants(const constants_t& constants) { 5 | std::array, 16> colors{ }; 6 | std::array, 16> stops{ }; 7 | 8 | for(auto [color, stop, pair] : std::views::zip(colors, stops, constants.stops)) { 9 | color = pair.first.cast(); 10 | stop.x = pair.second; 11 | } 12 | 13 | const float num_stops = constants.stops.size(); 14 | const float function = (float)constants.function; 15 | pixel_shader->set_constant(0, &function); 16 | pixel_shader->set_constant(1, &num_stops); 17 | pixel_shader->set_constant(2, constants.p.coordinates.data()); 18 | pixel_shader->set_constant(3, constants.v.coordinates.data()); 19 | pixel_shader->set_constant(4, (float*)colors.data(), 16); 20 | pixel_shader->set_constant(20, (float*)stops.data(), 16); 21 | } 22 | } -------------------------------------------------------------------------------- /render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/gradient/gradient.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "../color/compiled-object.h" 5 | #include "compiled-object.h" 6 | 7 | namespace ntl::rml::directx9 { 8 | class c_gradient_shader : public renderer::i_gradient_shader, public render::directx9::c_shader { 9 | public: 10 | c_gradient_shader() : c_shader(&gradient_shader_object, &color_shader_object) { } 11 | 12 | public: 13 | void set_constants(const constants_t& constants) override; 14 | }; 15 | } -------------------------------------------------------------------------------- /render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/gradient/hlsl/gradient.hlsl: -------------------------------------------------------------------------------- 1 | #define _linear 0 2 | #define _radial 1 3 | #define _conic 2 4 | #define _repeating_linear 3 5 | #define _repeating_radial 4 6 | #define _repeating_conic 5 7 | #define _pi 3.14159265 8 | 9 | struct ps_input_t { 10 | float4 position : POSITION0; 11 | float2 uv : TEXCOORD0; 12 | float4 color : COLOR0; 13 | }; 14 | 15 | float func : register(c0); // one of the above definitions 16 | float num_stops : register(c1); 17 | float2 p : register(c2); // linear: starting point, radial: center, conic: center 18 | float2 v : register(c3); // linear: vector to ending point, radial: 2d curvature (inverse radius), conic: angled unit vector 19 | float4 stop_colors[16] : register(c4); 20 | float4 stop_positions[16] : register(c20); // normalized, 0 -> starting point, 1 -> ending point 21 | 22 | float4 mix_stop_colors(float t) { 23 | float4 color = stop_colors[0]; 24 | 25 | for (int i = 1; i < num_stops; i++) 26 | color = lerp(color, stop_colors[i], smoothstep(stop_positions[i - 1].x, stop_positions[i].x, t)); 27 | 28 | return color; 29 | } 30 | 31 | float mod(float x, float y) { return x - y * floor(x / y); } 32 | 33 | float4 main(ps_input_t input) : COLOR { 34 | float t = 0.0; 35 | 36 | if (func == _linear || func == _repeating_linear) { 37 | float dist_square = dot(v, v); 38 | float2 V = input.uv - p; 39 | t = dot(v, V) / dist_square; 40 | } else if (func == _radial || func == _repeating_radial) { 41 | float2 V = input.uv - p; 42 | t = length(v * V); 43 | } else if (func == _conic || func == _repeating_conic) { 44 | float2x2 R = float2x2(v.x, -v.y, v.y, v.x); 45 | float2 V = mul(R, input.uv - p); 46 | t = 0.5 + atan2(-V.x, V.y) / (2.0 * _pi); 47 | } 48 | 49 | if (func == _repeating_linear || func == _repeating_radial || func == _repeating_conic) { 50 | float t0 = stop_positions[0].x; 51 | float t1 = stop_positions[num_stops - 1].x; 52 | t = t0 + mod(t - t0, t1 - t0); 53 | } 54 | 55 | return input.color * mix_stop_colors(t); 56 | } -------------------------------------------------------------------------------- /render-interfaces/directx9/src/null-rmlui-renderer-directx9/shaders/texture/texture.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "../color/compiled-object.h" 5 | 6 | namespace ntl::rml::directx9 { 7 | class c_texture_shader : public renderer::i_texture_shader, public render::directx9::c_default_shader { 8 | public: 9 | c_texture_shader() : c_default_shader(&render::directx9::texture_shader_object, &color_shader_object) { } 10 | }; 11 | } -------------------------------------------------------------------------------- /render-interfaces/opengl3/null-rmlui-renderer-opengl3.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildThisFileDirectory) 5 | debug 6 | release 7 | 8 | 9 | 10 | 11 | $(NullRmluiRendererOpengl3Root)src;%(AdditionalIncludeDirectories) 12 | 13 | 14 | $(NullRmluiRendererOpengl3Root)build;%(AdditionalLibraryDirectories) 15 | null-rmlui-renderer-opengl3-$(NullRmluiRendererOpengl3Configuration)-$(LibrariesArchitecture).lib;%(AdditionalDependencies) 16 | 17 | 18 | $(NullRmluiRendererOpengl3Root)resources;%(AdditionalIncludeDirectories) 19 | 20 | 21 | -------------------------------------------------------------------------------- /render-interfaces/opengl3/resources/null-rmlui-opengl3-resources.rc: -------------------------------------------------------------------------------- 1 | null-rml:opengl:shaders:color.vert null-rml:opengl:resources "../src/null-rmlui-renderer-opengl3/shaders/color/glsl/color.vert" 2 | 3 | null-rml:opengl:shaders:bliting.frag null-rml:opengl:resources "../src/null-rmlui-renderer-opengl3/shaders/bliting/glsl/bliting.frag" 4 | 5 | null-rml:opengl:shaders:drop-shadow.frag null-rml:opengl:resources "../src/null-rmlui-renderer-opengl3/shaders/drop-shadow/glsl/drop-shadow.frag" 6 | 7 | null-rml:opengl:shaders:color-matrix.frag null-rml:opengl:resources "../src/null-rmlui-renderer-opengl3/shaders/color-matrix/glsl/color-matrix.frag" 8 | null-rml:opengl:shaders:blend-mask.frag null-rml:opengl:resources "../src/null-rmlui-renderer-opengl3/shaders/blend-mask/glsl/blend-mask.frag" 9 | null-rml:opengl:shaders:gradient.frag null-rml:opengl:resources "../src/null-rmlui-renderer-opengl3/shaders/gradient/glsl/gradient.frag" 10 | 11 | null-rml:opengl:shaders:blur.frag null-rml:opengl:resources "../src/null-rmlui-renderer-opengl3/shaders/blur/glsl/blur.frag" 12 | null-rml:opengl:shaders:blur.vert null-rml:opengl:resources "../src/null-rmlui-renderer-opengl3/shaders/blur/glsl/blur.vert" -------------------------------------------------------------------------------- /render-interfaces/opengl3/src/null-rmlui-renderer-opengl3.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "null-rmlui-renderer-opengl3.h" 3 | 4 | #include "null-rmlui-renderer-opengl3/shaders/color/color.h" 5 | #include "null-rmlui-renderer-opengl3/shaders/texture/texture.h" 6 | #include "null-rmlui-renderer-opengl3/shaders/bliting/bliting.h" 7 | #include "null-rmlui-renderer-opengl3/shaders/color-matrix/color-matrix.h" 8 | #include "null-rmlui-renderer-opengl3/shaders/blend-mask/blend-mask.h" 9 | #include "null-rmlui-renderer-opengl3/shaders/gradient/gradient.h" 10 | #include "null-rmlui-renderer-opengl3/shaders/blur/blur.h" 11 | #include "null-rmlui-renderer-opengl3/shaders/drop-shadow/drop-shadow.h" 12 | 13 | namespace ntl::rml::opengl3 { 14 | void c_render::set_secondary_texture(void* texture) { 15 | opengl::active_texture(opengl::e_texture1); 16 | opengl::bind_texture(opengl::e_texture_2d, (std::uint32_t)texture); 17 | opengl::active_texture(opengl::e_texture0); 18 | } 19 | 20 | std::unique_ptr c_render::instance_mesh_pool() { 21 | return std::make_unique(); 22 | } 23 | 24 | void c_render::initialize() { 25 | renderer::color_shader = std::make_unique(); 26 | renderer::texture_shader = std::make_unique(); 27 | renderer::bliting_shader = std::make_unique(); 28 | renderer::color_matrix_shader = std::make_unique(); 29 | renderer::blend_mask_shader = std::make_unique(); 30 | renderer::gradient_shader = std::make_unique(); 31 | renderer::blur_shader = std::make_unique(); 32 | renderer::drop_shadow_shader = std::make_unique(); 33 | i_render_interface::initialize(); 34 | } 35 | } -------------------------------------------------------------------------------- /render-interfaces/opengl3/src/null-rmlui-renderer-opengl3.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "null-rmlui-renderer-opengl3/mesh-pool/mesh-pool.h" 3 | 4 | namespace ntl::rml::opengl3 { 5 | class c_render : public i_render_interface { 6 | public: 7 | void set_secondary_texture(void* texture) override; 8 | std::unique_ptr instance_mesh_pool() override; 9 | 10 | public: 11 | void initialize() override; 12 | }; 13 | } -------------------------------------------------------------------------------- /render-interfaces/opengl3/src/null-rmlui-renderer-opengl3/mesh-pool/mesh-pool.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace ntl::rml::opengl3 { 6 | class c_mesh_pool : public renderer::i_mesh_pool { 7 | public: using i_mesh_pool::i_mesh_pool; 8 | public: 9 | render::opengl3::c_vertex_element position{ }; 10 | render::opengl3::c_vertex_element color{ }; 11 | render::opengl3::c_vertex_element uv{ }; 12 | std::uint32_t vao{ }, vbo{ }, ibo{ }; 13 | 14 | public: 15 | bool create(mesh_t& mesh, Rml::Span& vertex_buffer, Rml::Span& index_buffer) override; 16 | 17 | public: 18 | void create() override; 19 | void destroy() override; 20 | 21 | public: 22 | void compile() override { } 23 | 24 | void use() override; 25 | }; 26 | } -------------------------------------------------------------------------------- /render-interfaces/opengl3/src/null-rmlui-renderer-opengl3/shaders/blend-mask/blend-mask.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "compiled-object.h" 5 | 6 | namespace ntl::rml::opengl3 { 7 | class c_blend_mask_shader : public renderer::i_blend_mask_shader, public render::opengl3::c_shader { 8 | public: 9 | c_blend_mask_shader() : c_shader(&blend_mask_shader_object, &render::opengl3::passthrough_vertex_shader_object) { } 10 | }; 11 | } -------------------------------------------------------------------------------- /render-interfaces/opengl3/src/null-rmlui-renderer-opengl3/shaders/blend-mask/compiled-object.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace ntl::rml::opengl3 { 5 | class c_blend_mask_shader_object : public render::opengl3::c_fragment_shader { 6 | public: 7 | resource_t get_source() override { 8 | return resource_t("null-rml:opengl:shaders:blend-mask.frag", "null-rml:opengl:resources"); 9 | } 10 | } inline blend_mask_shader_object{ }; 11 | } -------------------------------------------------------------------------------- /render-interfaces/opengl3/src/null-rmlui-renderer-opengl3/shaders/blend-mask/glsl/blend-mask.frag: -------------------------------------------------------------------------------- 1 | #version 420 2 | layout(binding = 0) uniform sampler2D texture_sampler; 3 | layout(binding = 1) uniform sampler2D mask_sampler; 4 | 5 | in vec2 frag_uv; 6 | out vec4 out_color; 7 | 8 | void main() { 9 | vec4 texture_color = texture(texture_sampler, frag_uv); 10 | float mask_alpha = texture(mask_sampler, frag_uv).a; 11 | out_color = texture_color * mask_alpha; 12 | } -------------------------------------------------------------------------------- /render-interfaces/opengl3/src/null-rmlui-renderer-opengl3/shaders/bliting/bliting.cpp: -------------------------------------------------------------------------------- 1 | #include "bliting.h" 2 | 3 | namespace ntl::rml::opengl3 { 4 | void c_bliting_shader::create() { 5 | if(!empty()) return; 6 | c_shader::create(); 7 | 8 | uv_min.get_location(program.get(), "uv_min"); 9 | uv_max.get_location(program.get(), "uv_max"); 10 | } 11 | 12 | void c_bliting_shader::use() { 13 | if(empty()) return; 14 | c_shader::use(); 15 | 16 | uv_min.set(); 17 | uv_max.set(); 18 | } 19 | 20 | void c_bliting_shader::set_constants(const constants_t& constants) { 21 | uv_min.value().x = constants.uv_limits.min.x; 22 | uv_min.value().y = 1.f - constants.uv_limits.max.y; 23 | 24 | uv_max.value().x = constants.uv_limits.max.x; 25 | uv_max.value().y = 1.f - constants.uv_limits.min.y; 26 | } 27 | } -------------------------------------------------------------------------------- /render-interfaces/opengl3/src/null-rmlui-renderer-opengl3/shaders/bliting/bliting.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "compiled-object.h" 5 | 6 | namespace ntl::rml::opengl3 { 7 | class c_bliting_shader : public renderer::i_bliting_shader, public render::opengl3::c_shader { 8 | public: 9 | render::opengl3::c_uniform> uv_min{ }; 10 | render::opengl3::c_uniform> uv_max{ }; 11 | 12 | public: 13 | c_bliting_shader() : c_shader(&bliting_shader_object, &render::opengl3::passthrough_vertex_shader_object) { } 14 | 15 | public: 16 | void create() override; 17 | 18 | void use() override; 19 | 20 | public: 21 | void set_constants(const constants_t& constants) override; 22 | }; 23 | } -------------------------------------------------------------------------------- /render-interfaces/opengl3/src/null-rmlui-renderer-opengl3/shaders/bliting/compiled-object.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace ntl::rml::opengl3 { 5 | class c_bliting_shader_object : public render::opengl3::c_fragment_shader { 6 | public: 7 | resource_t get_source() override { 8 | return resource_t("null-rml:opengl:shaders:bliting.frag", "null-rml:opengl:resources"); 9 | } 10 | } inline bliting_shader_object{ }; 11 | } -------------------------------------------------------------------------------- /render-interfaces/opengl3/src/null-rmlui-renderer-opengl3/shaders/bliting/glsl/bliting.frag: -------------------------------------------------------------------------------- 1 | #version 330 2 | uniform sampler2D sampler; 3 | uniform vec2 uv_min; 4 | uniform vec2 uv_max; 5 | 6 | in vec2 frag_uv; 7 | 8 | out vec4 out_color; 9 | 10 | void main() { 11 | out_color = texture(sampler, clamp(frag_uv, uv_min, uv_max)); 12 | } -------------------------------------------------------------------------------- /render-interfaces/opengl3/src/null-rmlui-renderer-opengl3/shaders/blur/blur.cpp: -------------------------------------------------------------------------------- 1 | #include "blur.h" 2 | 3 | namespace ntl::rml::opengl3 { 4 | void c_blur_shader::create() { 5 | if(!empty()) return; 6 | c_shader::create(); 7 | 8 | texel_offset.get_location(program.get(), "texel_offset"); 9 | uv_min.get_location(program.get(), "uv_min"); 10 | uv_max.get_location(program.get(), "uv_max"); 11 | weights.get_location(program.get(), "weights"); 12 | } 13 | 14 | void c_blur_shader::use() { 15 | if(empty()) return; 16 | c_shader::use(); 17 | 18 | texel_offset.set(); 19 | uv_min.set(); 20 | uv_max.set(); 21 | weights.set(); 22 | } 23 | 24 | void c_blur_shader::set_constants(const constants_t& constants) { 25 | texel_offset.value() = constants.texel_offset; 26 | 27 | uv_min.value().x = constants.uv_limits.min.x; 28 | uv_min.value().y = 1.f - constants.uv_limits.max.y; 29 | 30 | uv_max.value().x = constants.uv_limits.max.x; 31 | uv_max.value().y = 1.f - constants.uv_limits.min.y; 32 | 33 | for(auto [weight_dst, weight_src] : std::views::zip(weights.value(), constants.weights)) { 34 | weight_dst = weight_src; 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /render-interfaces/opengl3/src/null-rmlui-renderer-opengl3/shaders/blur/blur.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "compiled-object.h" 5 | 6 | namespace ntl::rml::opengl3 { 7 | class c_blur_shader : public renderer::i_blur_shader, public render::opengl3::c_shader { 8 | public: 9 | render::opengl3::c_uniform> texel_offset{ }; 10 | render::opengl3::c_uniform> weights{ }; 11 | render::opengl3::c_uniform> uv_min{ }; 12 | render::opengl3::c_uniform> uv_max{ }; 13 | 14 | public: 15 | c_blur_shader() : c_shader(&blur_fragment_shader_object, &blur_vertex_shader_object) { } 16 | 17 | public: 18 | void create() override; 19 | 20 | void use() override; 21 | 22 | public: 23 | void set_constants(const constants_t& constants) override; 24 | }; 25 | } -------------------------------------------------------------------------------- /render-interfaces/opengl3/src/null-rmlui-renderer-opengl3/shaders/blur/compiled-object.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace ntl::rml::opengl3 { 5 | class c_blur_fragment_shader_object : public render::opengl3::c_fragment_shader { 6 | public: 7 | resource_t get_source() override { 8 | return resource_t("null-rml:opengl:shaders:blur.frag", "null-rml:opengl:resources"); 9 | } 10 | } inline blur_fragment_shader_object{ }; 11 | 12 | class c_blur_vertex_shader_object : public render::opengl3::c_vertex_shader { 13 | public: 14 | resource_t get_source() override { 15 | return resource_t("null-rml:opengl:shaders:blur.vert", "null-rml:opengl:resources"); 16 | } 17 | } inline blur_vertex_shader_object{ }; 18 | } -------------------------------------------------------------------------------- /render-interfaces/opengl3/src/null-rmlui-renderer-opengl3/shaders/blur/glsl/blur.frag: -------------------------------------------------------------------------------- 1 | #version 330 2 | #define _blur_size 7 3 | #define _num_weights ((_blur_size + 1) / 2) 4 | 5 | uniform sampler2D sampler; 6 | uniform float weights[_num_weights]; 7 | uniform vec2 uv_min; 8 | uniform vec2 uv_max; 9 | 10 | in vec2 frag_uv[_blur_size]; 11 | 12 | out vec4 out_color; 13 | 14 | void main() { 15 | vec4 color = vec4(0.0, 0.0, 0.0, 0.0); 16 | for(int i = 0; i < _blur_size; i++) { 17 | vec2 in_region = step(uv_min, frag_uv[i]) * step(frag_uv[i], uv_max); 18 | color += texture(sampler, frag_uv[i]) * in_region.x * in_region.y * weights[abs(i - _num_weights + 1)]; 19 | } 20 | out_color = color; 21 | } -------------------------------------------------------------------------------- /render-interfaces/opengl3/src/null-rmlui-renderer-opengl3/shaders/blur/glsl/blur.vert: -------------------------------------------------------------------------------- 1 | #version 330 2 | #define _blur_size 7 3 | #define _num_weights ((_blur_size + 1) / 2) 4 | 5 | uniform vec2 texel_offset; 6 | 7 | in vec2 position; 8 | in vec2 uv; 9 | in vec4 color; 10 | 11 | out vec2 frag_uv[_blur_size]; 12 | 13 | void main() { 14 | for(int i = 0; i < _blur_size; i++) 15 | frag_uv[i] = uv - float(i - _num_weights + 1) * texel_offset; 16 | gl_Position = vec4(position, 0.0, 1.0); 17 | } -------------------------------------------------------------------------------- /render-interfaces/opengl3/src/null-rmlui-renderer-opengl3/shaders/color-matrix/color-matrix.cpp: -------------------------------------------------------------------------------- 1 | #include "color-matrix.h" 2 | 3 | namespace ntl::rml::opengl3 { 4 | void c_color_matrix_shader::create() { 5 | if(!empty()) return; 6 | c_shader::create(); 7 | 8 | color_matrix.get_location(program.get(), "color_matrix"); 9 | } 10 | 11 | void c_color_matrix_shader::use() { 12 | if(empty()) return; 13 | c_shader::use(); 14 | 15 | color_matrix.set(); 16 | } 17 | 18 | void c_color_matrix_shader::set_constants(const constants_t& constants) { 19 | color_matrix.value() = constants.color_matrix; 20 | } 21 | } -------------------------------------------------------------------------------- /render-interfaces/opengl3/src/null-rmlui-renderer-opengl3/shaders/color-matrix/color-matrix.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "compiled-object.h" 5 | 6 | namespace ntl::rml::opengl3 { 7 | class c_color_matrix_shader : public renderer::i_color_matrix_shader, public render::opengl3::c_shader { 8 | public: 9 | render::opengl3::c_uniform color_matrix{ }; 10 | 11 | public: 12 | c_color_matrix_shader() : c_shader(&color_matrix_shader_object, &render::opengl3::passthrough_vertex_shader_object) { } 13 | 14 | public: 15 | void create() override; 16 | 17 | void use() override; 18 | 19 | public: 20 | void set_constants(const constants_t& constants) override; 21 | }; 22 | } -------------------------------------------------------------------------------- /render-interfaces/opengl3/src/null-rmlui-renderer-opengl3/shaders/color-matrix/compiled-object.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace ntl::rml::opengl3 { 5 | class c_color_matrix_shader_object : public render::opengl3::c_fragment_shader { 6 | public: 7 | resource_t get_source() override { 8 | return resource_t("null-rml:opengl:shaders:color-matrix.frag", "null-rml:opengl:resources"); 9 | } 10 | } inline color_matrix_shader_object{ }; 11 | } -------------------------------------------------------------------------------- /render-interfaces/opengl3/src/null-rmlui-renderer-opengl3/shaders/color-matrix/glsl/color-matrix.frag: -------------------------------------------------------------------------------- 1 | #version 330 2 | uniform sampler2D sampler; 3 | uniform mat4 color_matrix; 4 | 5 | in vec2 frag_uv; 6 | out vec4 out_color; 7 | 8 | void main() { 9 | // The general case uses a 4x5 color matrix for full rgba transformation, plus a constant term with the last column. 10 | // However, we only consider the case of rgb transformations. Thus, we could in principle use a 3x4 matrix, but we 11 | // keep the alpha row for simplicity. 12 | // In the general case we should do the matrix transformation in non-premultiplied space. However, without alpha 13 | // transformations, we can do it directly in premultiplied space to avoid the extra division and multiplication 14 | // steps. In this space, the constant term needs to be multiplied by the alpha value, instead of unity. 15 | vec4 sampler_color = texture(sampler, frag_uv); 16 | vec3 transformed_color = vec3(color_matrix * sampler_color); 17 | out_color = vec4(transformed_color, sampler_color.a); 18 | } -------------------------------------------------------------------------------- /render-interfaces/opengl3/src/null-rmlui-renderer-opengl3/shaders/color/color.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "compiled-object.h" 5 | 6 | namespace ntl::rml::opengl3 { 7 | class c_color_shader : public renderer::i_color_shader, public render::opengl3::c_default_shader { 8 | public: 9 | c_color_shader() : c_default_shader(&render::opengl3::color_fragment_shader_object, &color_vertex_shader_object) { } 10 | }; 11 | } -------------------------------------------------------------------------------- /render-interfaces/opengl3/src/null-rmlui-renderer-opengl3/shaders/color/compiled-object.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace ntl::rml::opengl3 { 5 | class c_color_vertex_shader_object : public render::opengl3::c_vertex_shader { 6 | public: 7 | resource_t get_source() override { 8 | return resource_t("null-rml:opengl:shaders:color.vert", "null-rml:opengl:resources"); 9 | } 10 | } inline color_vertex_shader_object{ }; 11 | } -------------------------------------------------------------------------------- /render-interfaces/opengl3/src/null-rmlui-renderer-opengl3/shaders/color/glsl/color.vert: -------------------------------------------------------------------------------- 1 | #version 330 2 | uniform vec2 translation; 3 | uniform mat4 matrix; 4 | uniform float depth; 5 | 6 | in vec2 position; 7 | in vec2 uv; 8 | in vec4 color; 9 | 10 | out vec2 frag_uv; 11 | out vec4 frag_color; 12 | 13 | void main() { 14 | frag_uv = uv; 15 | frag_color = color; 16 | gl_Position = matrix * vec4(position + translation, depth, 1.0); 17 | } -------------------------------------------------------------------------------- /render-interfaces/opengl3/src/null-rmlui-renderer-opengl3/shaders/drop-shadow/compiled-object.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace ntl::rml::opengl3 { 5 | class c_drop_shadow_shader_object : public render::opengl3::c_fragment_shader { 6 | public: 7 | resource_t get_source() override { 8 | return resource_t("null-rml:opengl:shaders:drop-shadow.frag", "null-rml:opengl:resources"); 9 | } 10 | } inline drop_shadow_shader_object{ }; 11 | } -------------------------------------------------------------------------------- /render-interfaces/opengl3/src/null-rmlui-renderer-opengl3/shaders/drop-shadow/drop-shadow.cpp: -------------------------------------------------------------------------------- 1 | #include "drop-shadow.h" 2 | 3 | namespace ntl::rml::opengl3 { 4 | void c_drop_shadow_shader::create() { 5 | if(!empty()) return; 6 | c_shader::create(); 7 | 8 | color.get_location(program.get(), "color"); 9 | uv_min.get_location(program.get(), "uv_min"); 10 | uv_max.get_location(program.get(), "uv_max"); 11 | } 12 | 13 | void c_drop_shadow_shader::use() { 14 | if(empty()) return; 15 | c_shader::use(); 16 | 17 | color.set(); 18 | uv_min.set(); 19 | uv_max.set(); 20 | } 21 | 22 | void c_drop_shadow_shader::set_constants(const constants_t& constants) { 23 | color.value() = constants.color; 24 | 25 | uv_min.value().x = constants.uv_limits.min.x; 26 | uv_min.value().y = 1.f - constants.uv_limits.max.y; 27 | 28 | uv_max.value().x = constants.uv_limits.max.x; 29 | uv_max.value().y = 1.f - constants.uv_limits.min.y; 30 | } 31 | } -------------------------------------------------------------------------------- /render-interfaces/opengl3/src/null-rmlui-renderer-opengl3/shaders/drop-shadow/drop-shadow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "compiled-object.h" 5 | 6 | namespace ntl::rml::opengl3 { 7 | class c_drop_shadow_shader : public renderer::i_drop_shadow_shader, public render::opengl3::c_shader { 8 | public: 9 | render::opengl3::c_uniform> color{ }; 10 | render::opengl3::c_uniform> uv_min{ }; 11 | render::opengl3::c_uniform> uv_max{ }; 12 | 13 | public: 14 | c_drop_shadow_shader() : c_shader(&drop_shadow_shader_object, &render::opengl3::passthrough_vertex_shader_object) { } 15 | 16 | public: 17 | void create() override; 18 | 19 | void use() override; 20 | 21 | public: 22 | void set_constants(const constants_t& constants) override; 23 | }; 24 | } -------------------------------------------------------------------------------- /render-interfaces/opengl3/src/null-rmlui-renderer-opengl3/shaders/drop-shadow/glsl/drop-shadow.frag: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | uniform sampler2D sampler; 4 | uniform vec4 color; 5 | uniform vec2 uv_min; 6 | uniform vec2 uv_max; 7 | 8 | in vec2 frag_uv; 9 | 10 | out vec4 out_color; 11 | 12 | void main() { 13 | vec2 in_region = step(uv_min, frag_uv) * step(frag_uv, uv_max); 14 | out_color = texture(sampler, frag_uv).a * in_region.x * in_region.y * color; 15 | } -------------------------------------------------------------------------------- /render-interfaces/opengl3/src/null-rmlui-renderer-opengl3/shaders/gradient/compiled-object.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../color/compiled-object.h" 3 | 4 | namespace ntl::rml::opengl3 { 5 | class c_gradient_shader_object : public render::opengl3::c_fragment_shader { 6 | public: 7 | resource_t get_source() override { 8 | return resource_t("null-rml:opengl:shaders:gradient.frag", "null-rml:opengl:resources"); 9 | } 10 | } inline gradient_shader_object{ }; 11 | } -------------------------------------------------------------------------------- /render-interfaces/opengl3/src/null-rmlui-renderer-opengl3/shaders/gradient/glsl/gradient.frag: -------------------------------------------------------------------------------- 1 | #version 330 2 | #define _linear 0 3 | #define _radial 1 4 | #define _conic 2 5 | #define _repeating_linear 3 6 | #define _repeating_radial 4 7 | #define _repeating_conic 5 8 | #define _pi 3.14159265 9 | 10 | uniform int func; // one of the above definitions 11 | uniform vec2 p; // linear: starting point, radial: center, conic: center 12 | uniform vec2 v; // linear: vector to ending point, radial: 2d curvature (inverse radius), conic: angled unit vector 13 | uniform vec4 stop_colors[16]; 14 | uniform float stop_positions[16]; // normalized, 0 -> starting point, 1 -> ending point 15 | uniform int num_stops; 16 | 17 | in vec2 frag_uv; 18 | in vec4 frag_color; 19 | 20 | out vec4 out_color; 21 | 22 | vec4 mix_stop_colors(float t) { 23 | vec4 color = stop_colors[0]; 24 | 25 | for (int i = 1; i < num_stops; i++) 26 | color = mix(color, stop_colors[i], smoothstep(stop_positions[i-1], stop_positions[i], t)); 27 | 28 | return color; 29 | } 30 | 31 | void main() { 32 | float t = 0.0; 33 | 34 | if(func == _linear || func == _repeating_linear) { 35 | float dist_square = dot(v, v); 36 | vec2 V = frag_uv - p; 37 | t = dot(v, V) / dist_square; 38 | } else if(func == _radial || func == _repeating_radial) { 39 | vec2 V = frag_uv - p; 40 | t = length(v * V); 41 | } else if(func == _conic || func == _repeating_conic) { 42 | mat2 R = mat2(v.x, -v.y, v.y, v.x); 43 | vec2 V = R * (frag_uv - p); 44 | t = 0.5 + atan(-V.x, V.y) / (2.0 * _pi); 45 | } 46 | 47 | if(func == _repeating_linear || func == _repeating_radial || func == _repeating_conic) { 48 | float t0 = stop_positions[0]; 49 | float t1 = stop_positions[num_stops - 1]; 50 | t = t0 + mod(t - t0, t1 - t0); 51 | } 52 | 53 | out_color = frag_color * mix_stop_colors(t); 54 | } -------------------------------------------------------------------------------- /render-interfaces/opengl3/src/null-rmlui-renderer-opengl3/shaders/gradient/gradient.cpp: -------------------------------------------------------------------------------- 1 | #include "gradient.h" 2 | 3 | namespace ntl::rml::opengl3 { 4 | void c_gradient_shader::create() { 5 | if(!empty()) return; 6 | c_default_shader::create(); 7 | 8 | function.get_location(program.get(), "func"); 9 | p.get_location(program.get(), "p"); 10 | v.get_location(program.get(), "v"); 11 | colors.get_location(program.get(), "stop_colors"); 12 | stops.get_location(program.get(), "stop_positions"); 13 | num_stops.get_location(program.get(), "num_stops"); 14 | } 15 | 16 | void c_gradient_shader::use() { 17 | if(empty()) return; 18 | c_default_shader::use(); 19 | 20 | function.set(); 21 | p.set(); 22 | v.set(); 23 | colors.set(); 24 | stops.set(); 25 | num_stops.set(); 26 | } 27 | 28 | void c_gradient_shader::set_constants(const constants_t& constants) { 29 | num_stops.value() = constants.stops.size(); 30 | for(auto [color, stop, pair] : std::views::zip(colors.value(), stops.value(), constants.stops)) { 31 | color = pair.first; 32 | stop = pair.second; 33 | } 34 | 35 | function.value() = (int)constants.function; 36 | p.value() = constants.p; 37 | v.value() = constants.v; 38 | } 39 | } -------------------------------------------------------------------------------- /render-interfaces/opengl3/src/null-rmlui-renderer-opengl3/shaders/gradient/gradient.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "compiled-object.h" 5 | 6 | namespace ntl::rml::opengl3 { 7 | class c_gradient_shader : public renderer::i_gradient_shader, public render::opengl3::c_default_shader { 8 | public: 9 | render::opengl3::c_uniform function{ }, num_stops{ }; 10 | render::opengl3::c_uniform> p{ }, v{ }; 11 | render::opengl3::c_uniform, 16>> colors{ }; 12 | render::opengl3::c_uniform> stops{ }; 13 | 14 | public: 15 | c_gradient_shader() : c_default_shader(&gradient_shader_object, &color_vertex_shader_object) { } 16 | 17 | public: 18 | void create() override; 19 | 20 | void use() override; 21 | 22 | public: 23 | void set_constants(const constants_t& constants) override; 24 | }; 25 | } -------------------------------------------------------------------------------- /render-interfaces/opengl3/src/null-rmlui-renderer-opengl3/shaders/texture/texture.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "../color/compiled-object.h" 5 | #include 6 | 7 | namespace ntl::rml::opengl3 { 8 | class c_texture_shader : public renderer::i_texture_shader, public render::opengl3::c_default_shader { 9 | public: 10 | c_texture_shader() : c_default_shader(&render::opengl3::texture_shader_object, &color_vertex_shader_object) { } 11 | }; 12 | } -------------------------------------------------------------------------------- /src/null-rmlui.cpp: -------------------------------------------------------------------------------- 1 | #include "null-rmlui.h" 2 | 3 | namespace ntl::rml { 4 | void set_default_interfaces(const win::c_window& window) { 5 | file_interface = std::make_unique(); 6 | system_interface = std::make_unique(window); 7 | renderer::c_filter_factory::register_default_instancers(); 8 | } 9 | 10 | void load_system_font() { 11 | Rml::LoadFontFace("{system-fonts}\\Tahoma.ttf", true); 12 | } 13 | 14 | void initialize() { 15 | if(file_interface) Rml::SetFileInterface(file_interface.get()); 16 | else sdk::logger(sdk::e_log_type::error, "file_interface is empty."); 17 | 18 | if(system_interface) Rml::SetSystemInterface(system_interface.get()); 19 | else sdk::logger(sdk::e_log_type::error, "system_interface is empty."); 20 | 21 | if(render_interface) Rml::SetRenderInterface(render_interface.get()); 22 | else sdk::logger(sdk::e_log_type::error, "system_interface is empty."); 23 | 24 | renderer::layers = std::make_unique(); 25 | renderer::layers->initialize(); 26 | render_interface->initialize(); 27 | 28 | if(!Rml::Initialise()) sdk::logger(sdk::e_log_type::error, "Rml::Initialise return false."); 29 | } 30 | 31 | void shutdown() { 32 | Rml::Shutdown(); 33 | 34 | render_interface->shutdown(); 35 | 36 | render_interface.reset(); 37 | system_interface.reset(); 38 | file_interface.reset(); 39 | } 40 | } -------------------------------------------------------------------------------- /src/null-rmlui.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "null-rmlui/rmlui-implementation/backend/backend.h" 3 | #include "null-rmlui/rmlui-implementation/file-interface/file-interface.h" 4 | #include "null-rmlui/rmlui-implementation/system-interface/system-interface.h" 5 | #include "null-rmlui/rmlui-implementation/render-interface/render-interface.h" 6 | #include "null-rmlui/rmlui-implementation/render-interface/post-processing/layers.h" 7 | 8 | #include "null-rmlui/extensions/extensions.h" 9 | 10 | #include "null-rmlui/compatibility/vec4.h" 11 | #include "null-rmlui/compatibility/vec2.h" 12 | #include "null-rmlui/compatibility/color.h" 13 | 14 | namespace ntl::rml { 15 | void set_default_interfaces(const win::c_window& window); 16 | void load_system_font(); 17 | 18 | void initialize(); 19 | void shutdown(); 20 | } -------------------------------------------------------------------------------- /src/null-rmlui/compatibility/color.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include 5 | 6 | template <> 7 | struct ntl::compatibility::data_type_converter_t, Rml::Colourf> { 8 | static inline Rml::Colourf convert(const ntl::sdk::i_color& color) { return { color.r, color.g, color.b, color.a }; } 9 | }; 10 | 11 | template <> 12 | struct ntl::compatibility::data_type_converter_t> { 13 | static inline ntl::sdk::i_color convert(const Rml::Colourf& color) { return { color.red, color.green, color.blue, color.alpha }; } 14 | }; 15 | 16 | template <> 17 | struct ntl::compatibility::data_type_converter_t, Rml::Colourb> { 18 | static inline Rml::Colourb convert(const ntl::sdk::i_color& color) { return { (byte)color.r, (byte)color.g, (byte)color.b, (byte)color.a }; } 19 | }; 20 | 21 | template <> 22 | struct ntl::compatibility::data_type_converter_t> { 23 | static inline ntl::sdk::i_color convert(const Rml::Colourb& color) { return { color.red, color.green, color.blue, color.alpha }; } 24 | }; 25 | 26 | template <> 27 | struct ntl::compatibility::data_type_converter_t, Rml::ColourbPremultiplied> { 28 | static inline Rml::ColourbPremultiplied convert(const ntl::sdk::i_color& color) { return { (byte)color.r, (byte)color.g, (byte)color.b, (byte)color.a }; } 29 | }; 30 | 31 | template <> 32 | struct ntl::compatibility::data_type_converter_t> { 33 | static inline ntl::sdk::i_color convert(const Rml::ColourbPremultiplied& color) { return { color.red, color.green, color.blue, color.alpha }; } 34 | }; -------------------------------------------------------------------------------- /src/null-rmlui/compatibility/rect.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include 5 | 6 | template 7 | struct ntl::compatibility::data_type_converter_t, Rml::Rectangle> { 8 | static inline Rml::Rectangle convert(const rect_t& rect) { return Rml::Rectangle::FromCorners(Rml::Vector2(rect.min.x, rect.min.y), Rml::Vector2(rect.max.x, rect.max.y)); } 9 | }; 10 | 11 | template 12 | struct ntl::compatibility::data_type_converter_t, rect_t> { 13 | static inline rect_t convert(const Rml::Rectangle& rect) { return { rect.p0.x, rect.p0.y, rect.p1.x, rect.p1.y }; } 14 | }; -------------------------------------------------------------------------------- /src/null-rmlui/compatibility/vec2.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include 5 | 6 | template 7 | struct ntl::compatibility::data_type_converter_t, Rml::Vector2> { 8 | static inline Rml::Vector2 convert(const vec2_t& vec) { return { vec.x, vec.y }; } 9 | }; 10 | 11 | template 12 | struct ntl::compatibility::data_type_converter_t, vec2_t> { 13 | static inline vec2_t convert(const Rml::Vector2& vec) { return { vec.x, vec.y }; } 14 | }; -------------------------------------------------------------------------------- /src/null-rmlui/compatibility/vec4.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include 5 | 6 | template 7 | struct ntl::compatibility::data_type_converter_t, Rml::Vector4> { 8 | static inline Rml::Vector4 convert(const vec4_t& vec) { return { vec.x, vec.y, vec.z, vec.w }; } 9 | }; 10 | 11 | template 12 | struct ntl::compatibility::data_type_converter_t, vec4_t> { 13 | static inline vec4_t convert(const Rml::Vector4& vec) { return { vec.x, vec.y, vec.z, vec.w }; } 14 | }; -------------------------------------------------------------------------------- /src/null-rmlui/extensions/colorpicker-element/colorpicker-element.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace ntl::rml::extensions { 5 | //@note: you style the necessary colorpicker yourself, an example will be later 6 | class i_widget_colorpicker : public Rml::EventListener { 7 | protected: 8 | Rml::Element* control_element{ }; 9 | 10 | Rml::Element* canvas{ }, *indicator{ }; //@note: indicator should not be part of DOM 11 | 12 | Rml::Element* preview{ }; 13 | 14 | Rml::Element* hue_slider{ }, *alpha_slider{ }; 15 | Rml::Element* value_input{ }, *copy_button{ }, *paste_button{ }; //@note: these elements are optional, but there is functionality for them, so just create them to use 16 | 17 | bool ignore_alpha{ }; 18 | bool value_dirty{ true }, value_from_input{ }, indicator_dirty{ }; 19 | bool lock_value{ }; 20 | 21 | protected: 22 | virtual void add_events(); 23 | virtual void remove_events(); 24 | 25 | virtual void set_elements_color(const color_t& color) { } //@note: here you update the colors of the elements you need, such as preview, canvas, shoe slider, alpha slider, etc. 26 | 27 | protected: 28 | void on_update(); 29 | void format_elements(); 30 | 31 | void set_elements_value(const std::string& value); 32 | void on_value_change(const std::string& value); 33 | 34 | color_t build_color() const { 35 | const float h = hue_slider->GetAttribute("value", 0.f); 36 | const float s = canvas->GetAttribute("saturation", 0.f); 37 | const float v = canvas->GetAttribute("brightness", 0.f); 38 | const float a = ignore_alpha ? 1.f : alpha_slider->GetAttribute("value", 0.f); 39 | return color_t(hsv_color_t(h, s, v, a)); 40 | } 41 | std::string format_to_hex(const color_t& color) const { return std::format("#{:02X}{:02X}{:02X}{:02X}", color.r, color.g, color.b, color.a); } 42 | 43 | public: 44 | void ProcessEvent(Rml::Event& event) override; 45 | }; 46 | } -------------------------------------------------------------------------------- /src/null-rmlui/extensions/extensions.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "multiselect-element/multiselect-element.h" 3 | #include "colorpicker-element/colorpicker-element.h" 4 | 5 | namespace ntl::rml::extensions { 6 | static void register_all_elements() { 7 | c_element_form_control_multiselect::register_instancer(); 8 | } 9 | 10 | static void register_all() { 11 | register_all_elements(); 12 | } 13 | } -------------------------------------------------------------------------------- /src/null-rmlui/rmlui-implementation/backend/backend.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | #include "../system-interface/system-interface.h" 6 | #include "../render-interface/render-interface.h" 7 | 8 | namespace ntl::rml::backend { 9 | int wnd_proc(Rml::Context* context, HWND window_handle, UINT message, WPARAM w_param, LPARAM l_param); 10 | 11 | std::string convert_to_utf8(std::wstring_view wstr); 12 | std::wstring convert_to_utf16(std::string_view str); 13 | 14 | Rml::Input::KeyIdentifier convert_key(int win32_key_code); 15 | int convert_key(Rml::Input::KeyIdentifier rml_key_code); 16 | int get_key_modifier_state(); 17 | } -------------------------------------------------------------------------------- /src/null-rmlui/rmlui-implementation/file-interface/file-interface.cpp: -------------------------------------------------------------------------------- 1 | #include "file-interface.h" 2 | 3 | namespace ntl::rml { 4 | Rml::FileHandle c_file_interface::Open(const Rml::String& path) { 5 | std::string new_path = path; 6 | if(std::ranges::any_of(file_loaders, std::bind(std::mem_fn(&i_file_loader::create), std::placeholders::_1, std::ref(new_path)))) 7 | return (Rml::FileHandle)i_file_loader::opened_files[new_path].get(); 8 | 9 | sdk::logger(sdk::e_log_type::warning, "couldn't find a suitable loader for '{}'", path); 10 | return Rml::FileHandle{ }; 11 | } 12 | } -------------------------------------------------------------------------------- /src/null-rmlui/rmlui-implementation/file-interface/file-interface.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | #include "loaders/resource-loader.h" 6 | #include "loaders/default-file-loader.h" 7 | 8 | namespace ntl::rml { 9 | class c_file_interface : public Rml::FileInterface { 10 | public: 11 | std::vector file_loaders{ &default_file_loader, &resource_loader }; 12 | 13 | public: 14 | c_file_interface() { } 15 | 16 | public: 17 | Rml::FileHandle Open(const Rml::String& path) override; 18 | void Close(Rml::FileHandle file) override { i_file_loader::opened_files.erase(((i_file_loader::i_file*)file)->path); } 19 | 20 | size_t Read(void* buffer, size_t size, Rml::FileHandle file) override { return ((i_file_loader::i_file*)file)->read(buffer, size); } 21 | bool Seek(Rml::FileHandle file, long offset, int origin) override { return ((i_file_loader::i_file*)file)->seek(offset, origin); } 22 | size_t Tell(Rml::FileHandle file) override { return ((i_file_loader::i_file*)file)->tell(); } 23 | }; inline std::unique_ptr file_interface{ }; 24 | } -------------------------------------------------------------------------------- /src/null-rmlui/rmlui-implementation/file-interface/loaders/file-loader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace ntl::rml { 5 | struct i_file_loader { 6 | public: 7 | struct i_file { 8 | public: 9 | std::string path{ }; 10 | 11 | public: 12 | i_file(std::string_view _path) : path(_path) { } 13 | virtual ~i_file() { } 14 | 15 | public: 16 | virtual void open() = 0; 17 | virtual void close() = 0; 18 | 19 | virtual size_t read(void* buffer, size_t size) = 0; 20 | virtual bool seek(long offset, int origin) = 0; 21 | virtual size_t tell() const = 0; 22 | }; 23 | 24 | public: 25 | static inline std::unordered_map> opened_files{ }; 26 | 27 | public: 28 | virtual bool create(std::string& path) = 0; 29 | }; 30 | } -------------------------------------------------------------------------------- /src/null-rmlui/rmlui-implementation/render-interface/interfaces/shaders/blend-mask.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace ntl::rml::renderer { 5 | class i_blend_mask_shader : public virtual render::backend::i_shader { }; inline std::unique_ptr blend_mask_shader{ }; 6 | } -------------------------------------------------------------------------------- /src/null-rmlui/rmlui-implementation/render-interface/interfaces/shaders/bliting.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace ntl::rml::renderer { 6 | class i_bliting_shader : public virtual render::backend::i_shader { 7 | public: 8 | struct constants_t { 9 | public: 10 | rect_t uv_limits{ }; 11 | 12 | public: 13 | void from_region(const rect_t& region) { uv_limits = (region + rect_t(0.5f, -0.5f)) / (vec2_t)render::shared::viewport; } 14 | }; 15 | 16 | public: 17 | virtual void set_constants(const constants_t& constants) = 0; 18 | }; inline std::unique_ptr bliting_shader{ }; 19 | } -------------------------------------------------------------------------------- /src/null-rmlui/rmlui-implementation/render-interface/interfaces/shaders/blur.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "bliting.h" 3 | 4 | namespace ntl::rml::renderer { 5 | class i_blur_shader : public virtual render::backend::i_shader { 6 | public: 7 | constexpr static int _blur_size = 7; 8 | constexpr static int _num_weights = ((_blur_size + 1) / 2); 9 | 10 | struct constants_t : public i_bliting_shader::constants_t { 11 | public: 12 | vec2_t texel_offset{ }; 13 | std::vector weights{ }; 14 | }; 15 | 16 | public: 17 | virtual void set_constants(const constants_t& constants) = 0; 18 | }; inline std::unique_ptr blur_shader{ }; 19 | } -------------------------------------------------------------------------------- /src/null-rmlui/rmlui-implementation/render-interface/interfaces/shaders/color-matrix.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace ntl::rml::renderer { 5 | class i_color_matrix_shader : public virtual render::backend::i_shader { 6 | public: 7 | struct constants_t { 8 | public: 9 | matrix4x4_t color_matrix{ }; 10 | }; 11 | 12 | public: 13 | virtual void set_constants(const constants_t& constants) = 0; 14 | }; inline std::unique_ptr color_matrix_shader{ }; 15 | } -------------------------------------------------------------------------------- /src/null-rmlui/rmlui-implementation/render-interface/interfaces/shaders/color.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace ntl::rml::renderer { 5 | class i_color_shader : public virtual render::backend::i_shader { }; inline std::unique_ptr color_shader{ }; 6 | } -------------------------------------------------------------------------------- /src/null-rmlui/rmlui-implementation/render-interface/interfaces/shaders/drop-shadow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "bliting.h" 3 | 4 | namespace ntl::rml::renderer { 5 | class i_drop_shadow_shader : public virtual render::backend::i_shader { 6 | public: 7 | struct constants_t : public i_bliting_shader::constants_t { 8 | public: 9 | color_t color{ }; 10 | }; 11 | 12 | public: 13 | virtual void set_constants(const constants_t& constants) = 0; 14 | }; inline std::unique_ptr drop_shadow_shader{ }; 15 | } -------------------------------------------------------------------------------- /src/null-rmlui/rmlui-implementation/render-interface/interfaces/shaders/gradient.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace ntl::rml::renderer { 5 | class i_gradient_shader : public virtual render::backend::i_shader { 6 | public: 7 | enum class e_function { 8 | linear, radial, conic, 9 | repeating_linear, repeating_radial, repeating_conic 10 | }; 11 | 12 | struct constants_t { 13 | public: 14 | e_function function{ }; 15 | vec2_t p{ }, v{ }; 16 | std::vector, float>> stops{ }; 17 | }; 18 | 19 | public: 20 | virtual void set_constants(const constants_t& constants) = 0; 21 | }; inline std::unique_ptr gradient_shader{ }; 22 | } -------------------------------------------------------------------------------- /src/null-rmlui/rmlui-implementation/render-interface/interfaces/shaders/texture.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace ntl::rml::renderer { 5 | class i_texture_shader : public virtual render::backend::i_shader { }; inline std::unique_ptr texture_shader{ }; 6 | } -------------------------------------------------------------------------------- /src/null-rmlui/rmlui-implementation/render-interface/mesh-pool/mesh-pool.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "offsetAllocator.hpp" 5 | 6 | namespace ntl::rml::renderer { 7 | class i_mesh_pool : public render::backend::i_mesh { 8 | public: 9 | static inline std::uint32_t pool_size{ 256 * 1024 }; 10 | 11 | public: 12 | struct mesh_t { 13 | public: 14 | i_mesh_pool* pool{ }; 15 | 16 | OffsetAllocator::Allocation vertex_allocation{ }, index_allocation{ }; 17 | 18 | std::size_t vertex_count{ }, index_count{ }; 19 | std::size_t vertex_offset{ }, index_offset{ }; 20 | }; 21 | 22 | protected: 23 | OffsetAllocator::Allocator vertex_allocator{ pool_size }, index_allocator{ pool_size }; 24 | 25 | public: 26 | virtual bool create(mesh_t& mesh, Rml::Span& vertex_buffer, Rml::Span& index_buffer) { 27 | mesh.vertex_allocation = vertex_allocator.allocate(vertex_buffer.size()); 28 | mesh.index_allocation = index_allocator.allocate(index_buffer.size()); 29 | mesh.vertex_offset = mesh.vertex_allocation.offset; 30 | mesh.vertex_count = vertex_buffer.size(); 31 | mesh.index_offset = mesh.index_allocation.offset; 32 | mesh.index_count = index_buffer.size(); 33 | mesh.pool = this; 34 | 35 | return mesh.vertex_allocation.offset != OffsetAllocator::Allocation::NO_SPACE && mesh.index_allocation.offset != OffsetAllocator::Allocation::NO_SPACE; 36 | } 37 | 38 | virtual void free(mesh_t& mesh) { 39 | vertex_allocator.free(mesh.vertex_allocation); 40 | index_allocator.free(mesh.index_allocation); 41 | } 42 | 43 | public: 44 | void clear_geometry() override { } 45 | }; 46 | } -------------------------------------------------------------------------------- /src/null-rmlui/rmlui-implementation/render-interface/post-processing/filters/blur-filter/blur-filter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "../factory/factory.h" 4 | #include "../../../interfaces/shaders/blur.h" 5 | 6 | namespace ntl::rml::renderer::filters { 7 | class c_blur_filter : public i_filter { 8 | private: 9 | static void calculate_weights(std::vector& weights, float sigma); 10 | 11 | public: 12 | static void make_blur(float sigma, render::backend::i_frame_buffer* src, render::backend::i_frame_buffer* temp); 13 | 14 | public: 15 | float sigma{ }; 16 | 17 | public: 18 | c_blur_filter() { } 19 | c_blur_filter(float _sigma) : sigma(_sigma) { } 20 | 21 | public: 22 | void render() override; 23 | }; 24 | 25 | class c_blur_filter_instancer : public i_filter_instancer { 26 | public: 27 | std::unique_ptr instance_filter(const Rml::Dictionary& parameters) override; 28 | }; 29 | } -------------------------------------------------------------------------------- /src/null-rmlui/rmlui-implementation/render-interface/post-processing/filters/color-matrix-filter/color-matrix-filter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../factory/factory.h" 3 | #include "../../../interfaces/shaders/color-matrix.h" 4 | 5 | namespace ntl::rml::renderer::filters { 6 | class c_color_mask_filter : public i_filter { 7 | public: 8 | i_color_matrix_shader::constants_t constants{ }; 9 | 10 | public: 11 | c_color_mask_filter() { } 12 | c_color_mask_filter(const matrix4x4_t& matrix) : constants(matrix) { } 13 | 14 | public: 15 | void render() override; 16 | }; 17 | 18 | class c_brightness_filter_instancer : public i_filter_instancer { 19 | public: 20 | std::unique_ptr instance_filter(const Rml::Dictionary& parameters) override; 21 | }; 22 | 23 | class c_contrast_filter_instancer : public i_filter_instancer { 24 | public: 25 | std::unique_ptr instance_filter(const Rml::Dictionary& parameters) override; 26 | }; 27 | 28 | class c_invert_filter_instancer : public i_filter_instancer { 29 | public: 30 | std::unique_ptr instance_filter(const Rml::Dictionary& parameters) override; 31 | }; 32 | 33 | class c_grayscale_filter_instancer : public i_filter_instancer { 34 | public: 35 | std::unique_ptr instance_filter(const Rml::Dictionary& parameters) override; 36 | }; 37 | 38 | class c_sepia_filter_instancer : public i_filter_instancer { 39 | public: 40 | std::unique_ptr instance_filter(const Rml::Dictionary& parameters) override; 41 | }; 42 | 43 | class c_hue_rotate_filter_instancer : public i_filter_instancer { 44 | public: 45 | std::unique_ptr instance_filter(const Rml::Dictionary& parameters) override; 46 | }; 47 | 48 | class c_saturate_filter_instancer : public i_filter_instancer { 49 | public: 50 | std::unique_ptr instance_filter(const Rml::Dictionary& parameters) override; 51 | }; 52 | } -------------------------------------------------------------------------------- /src/null-rmlui/rmlui-implementation/render-interface/post-processing/filters/gradient-filter/gradient-shader-filter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../factory/factory.h" 3 | #include "../../../interfaces/shaders/gradient.h" 4 | 5 | namespace ntl::rml::renderer::filters { 6 | class c_gradient_shader_filter : public i_geometry_filter { 7 | public: 8 | static void stops_to_constants(i_gradient_shader::constants_t& constants, const Rml::ColorStopList& stops); 9 | 10 | public: 11 | i_gradient_shader::constants_t constants{ }; 12 | 13 | public: 14 | c_gradient_shader_filter() { } 15 | c_gradient_shader_filter(const i_gradient_shader::constants_t& _constants) : constants(_constants) { } 16 | 17 | public: 18 | void render(Rml::CompiledGeometryHandle geometry_handle, const Rml::Vector2f& translation, Rml::TextureHandle texture) override; 19 | }; 20 | 21 | class c_linear_gradient_shader_filter_instancer : public i_geometry_filter_instancer { 22 | public: 23 | std::unique_ptr instance_filter(const Rml::Dictionary& parameters) override; 24 | }; 25 | 26 | class c_radial_gradient_shader_filter_instancer : public i_geometry_filter_instancer { 27 | public: 28 | std::unique_ptr instance_filter(const Rml::Dictionary& parameters) override; 29 | }; 30 | 31 | class c_conic_gradient_shader_filter_instancer : public i_geometry_filter_instancer { 32 | public: 33 | std::unique_ptr instance_filter(const Rml::Dictionary& parameters) override; 34 | }; 35 | } -------------------------------------------------------------------------------- /src/null-rmlui/rmlui-implementation/render-interface/post-processing/filters/mask-image-filter/mask-image-filter.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../render-interface.h" 2 | #include "../../layers.h" 3 | #include "mask-image-filter.h" 4 | 5 | namespace ntl::rml::renderer::filters { 6 | void c_mask_image_filter::render() { 7 | render::backend::state_pipeline->blends.push(render_interface->blend_state_disabled); 8 | 9 | render_interface->set_secondary_texture(layers->blend_mask()->get_texture()); 10 | render::backend::state_pipeline->shaders.push(blend_mask_shader); 11 | render::backend::state_pipeline->framebuffers.push(layers->secondary()); 12 | render::backend::post_processing->draw_buffer(layers->primary()); 13 | render::backend::state_pipeline->framebuffers.pop(); 14 | render::backend::state_pipeline->shaders.pop(); 15 | 16 | layers->swap_primary_secondary(); 17 | 18 | render::backend::state_pipeline->blends.pop(); 19 | } 20 | 21 | std::unique_ptr c_mask_image_filter_instancer::instance_filter(const Rml::Dictionary& parameters) { 22 | return std::make_unique(); 23 | } 24 | } -------------------------------------------------------------------------------- /src/null-rmlui/rmlui-implementation/render-interface/post-processing/filters/mask-image-filter/mask-image-filter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../factory/factory.h" 3 | #include "../../../interfaces/shaders/blend-mask.h" 4 | 5 | namespace ntl::rml::renderer::filters { 6 | class c_mask_image_filter : public i_filter { 7 | public: 8 | void render() override; 9 | }; 10 | 11 | class c_mask_image_filter_instancer : public i_filter_instancer { 12 | public: 13 | std::unique_ptr instance_filter(const Rml::Dictionary& parameters) override; 14 | }; 15 | } -------------------------------------------------------------------------------- /src/null-rmlui/rmlui-implementation/render-interface/post-processing/filters/passthrough-filter/passthrough-filter.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../render-interface.h" 2 | #include "../../layers.h" 3 | #include "passthrough-filter.h" 4 | 5 | namespace ntl::rml::renderer::filters { 6 | void c_passthrough_filter::render() { 7 | render_interface->blend_state_factor->unlock(); 8 | render_interface->blend_state_factor->factor.set(blend_factor); 9 | render_interface->blend_state_factor->lock(); 10 | render::backend::state_pipeline->blends.push(render_interface->blend_state_factor); 11 | 12 | render::backend::state_pipeline->framebuffers.push(layers->secondary()); 13 | render::backend::post_processing->blit_buffer(layers->primary()); 14 | render::backend::state_pipeline->framebuffers.pop(); 15 | 16 | layers->swap_primary_secondary(); 17 | 18 | render::backend::state_pipeline->blends.pop(); 19 | } 20 | 21 | std::unique_ptr c_opacity_filter_instancer::instance_filter(const Rml::Dictionary& parameters) { 22 | return std::make_unique(Rml::Get(parameters, "value", 1.0f)); 23 | } 24 | } -------------------------------------------------------------------------------- /src/null-rmlui/rmlui-implementation/render-interface/post-processing/filters/passthrough-filter/passthrough-filter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../factory/factory.h" 3 | 4 | namespace ntl::rml::renderer::filters { 5 | class c_passthrough_filter : public i_filter { 6 | public: 7 | float blend_factor{ }; 8 | 9 | public: 10 | c_passthrough_filter() { } 11 | c_passthrough_filter(float _blend_factor) : blend_factor(_blend_factor) { } 12 | 13 | public: 14 | void render() override; 15 | }; 16 | 17 | class c_opacity_filter_instancer : public i_filter_instancer { 18 | public: 19 | std::unique_ptr instance_filter(const Rml::Dictionary& parameters) override; 20 | }; 21 | } -------------------------------------------------------------------------------- /src/null-rmlui/rmlui-implementation/render-interface/post-processing/filters/shadow-filter/shadow-filter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../factory/factory.h" 3 | #include "../../../interfaces/shaders/drop-shadow.h" 4 | 5 | namespace ntl::rml::renderer::filters { 6 | class c_shadow_filter : public i_filter { 7 | public: 8 | float sigma{ }; 9 | color_t color{ }; 10 | vec2_t offset{ }; 11 | 12 | public: 13 | c_shadow_filter() { } 14 | c_shadow_filter(float _sigma, const color_t& _color, const vec2_t& _offset) 15 | : sigma(_sigma), color(_color), offset(_offset) { } 16 | 17 | public: 18 | void render() override; 19 | }; 20 | 21 | class c_shadow_filter_instancer : public i_filter_instancer { 22 | public: 23 | std::unique_ptr instance_filter(const Rml::Dictionary& parameters) override; 24 | }; 25 | } -------------------------------------------------------------------------------- /src/null-rmlui/rmlui-implementation/render-interface/post-processing/layers.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "layers.h" 3 | 4 | namespace ntl::rml::renderer { 5 | void c_layers::initialize() { 6 | for(auto& buffer : post_process) { 7 | buffer = render::backend::factory->instance_frame_buffer(render::shared::viewport, render::backend::e_frame_buffer_type::postprocessing, render::backend::e_frame_buffer_flags::none); 8 | } 9 | } 10 | 11 | Rml::LayerHandle c_layers::push() { 12 | if(involved_layers == (int)layers.size()) { 13 | std::unique_ptr framebuffer = render::backend::factory->instance_frame_buffer(render::shared::viewport, render::backend::e_frame_buffer_type::postprocessing, render::backend::e_frame_buffer_flags::msaa); 14 | framebuffer->create(); 15 | layers.push_back(std::move(framebuffer)); 16 | } 17 | 18 | involved_layers += 1; 19 | return top_layer_handle(); 20 | } 21 | 22 | void c_layers::pop() { 23 | involved_layers -= 1; 24 | } 25 | } -------------------------------------------------------------------------------- /src/null-rmlui/rmlui-implementation/render-interface/post-processing/layers.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace ntl::rml::renderer { 6 | class c_layers { 7 | public: 8 | int involved_layers{ }; 9 | 10 | std::vector> layers{ }; 11 | std::array, 4> post_process{ }; 12 | 13 | public: 14 | void initialize(); 15 | 16 | public: 17 | Rml::LayerHandle push(); 18 | void pop(); 19 | 20 | public: 21 | render::backend::i_frame_buffer* layer_by_handle(Rml::LayerHandle handle) { return layers[handle].get(); } 22 | Rml::LayerHandle top_layer_handle() const { return (Rml::LayerHandle)involved_layers - 1; } 23 | 24 | render::backend::i_frame_buffer* top() { return layer_by_handle(top_layer_handle()); } 25 | render::backend::i_frame_buffer* primary() { return post_process[0].get(); } 26 | render::backend::i_frame_buffer* secondary() { return post_process[1].get(); } 27 | render::backend::i_frame_buffer* tertiary() { return post_process[2].get(); } 28 | render::backend::i_frame_buffer* blend_mask() { return post_process[3].get(); } 29 | 30 | void swap_primary_secondary() { std::swap(post_process[0], post_process[1]); } 31 | 32 | //@note: blit top layer to postprocess primary 33 | void blit_top() { primary()->copy_from(top()); } 34 | }; inline std::unique_ptr layers{ }; 35 | } -------------------------------------------------------------------------------- /src/null-rmlui/rmlui-implementation/system-interface/system-interface.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace ntl::rml { 6 | class c_system_interface : public Rml::SystemInterface { 7 | public: 8 | HWND wnd_handle{ }; 9 | 10 | private: 11 | c_immediate_time_measurement time_measurement{ }; 12 | 13 | std::unordered_map cursors{ 14 | { "arrow", LoadCursor(nullptr, IDC_ARROW) }, 15 | { "move", LoadCursor(nullptr, IDC_SIZEALL) }, 16 | { "pointer", LoadCursor(nullptr, IDC_HAND) }, 17 | { "resize", LoadCursor(nullptr, IDC_SIZENWSE) }, 18 | { "cross", LoadCursor(nullptr, IDC_CROSS) }, 19 | { "text", LoadCursor(nullptr, IDC_IBEAM) }, 20 | { "unavailable", LoadCursor(nullptr, IDC_NO) } 21 | }; 22 | 23 | public: 24 | c_system_interface(const win::c_window& window) : wnd_handle(window.wnd_handle) { time_measurement.begin(); } 25 | 26 | public: 27 | double GetElapsedTime() override { return std::chrono::duration(time_measurement.representation()).count(); } 28 | 29 | void SetMouseCursor(const std::string& cursor_name) override; 30 | 31 | void SetClipboardText(const std::string& text) override; 32 | void GetClipboardText(std::string& text) override; 33 | 34 | void ActivateKeyboard(Rml::Vector2f caret_position, float line_height) override; 35 | 36 | bool LogMessage(Rml::Log::Type log_type, const std::string& message) override; 37 | }; inline std::unique_ptr system_interface{ }; 38 | } --------------------------------------------------------------------------------