feat added working text renderer

This commit is contained in:
2025-07-14 23:44:36 +02:00
parent edc2372c96
commit 2375337bf2
70 changed files with 10533 additions and 262 deletions

Binary file not shown.

View File

@ -2,33 +2,25 @@
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\components\\TextComponent.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|solutionrelative:src\\game\\components\\TextComponent.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\core\\Engine.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|solutionrelative:src\\core\\Engine.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\components\\TextComponent.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|solutionrelative:src\\game\\components\\TextComponent.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\components\\Component.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|solutionrelative:src\\game\\components\\Component.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\core\\Engine.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|solutionrelative:src\\core\\Engine.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\components\\TransformComponent.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|solutionrelative:src\\game\\components\\TransformComponent.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
"AbsoluteMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\games\\systems\\TextRenderer.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|solutionrelative:src\\games\\systems\\TextRenderer.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\components\\Entity.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|solutionrelative:src\\game\\components\\Entity.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
"AbsoluteMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\systems\\Renderer.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|solutionrelative:src\\systems\\Renderer.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\systems\\TextRenderer.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|solutionrelative:src\\game\\systems\\TextRenderer.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
}
],
"DocumentGroupContainers": [
@ -38,116 +30,71 @@
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 1,
"SelectedChildIndex": 4,
"Children": [
{
"$type": "Document",
"DocumentIndex": 5,
"Title": "TransformComponent.hpp",
"DocumentMoniker": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\components\\TransformComponent.hpp",
"RelativeDocumentMoniker": "src\\game\\components\\TransformComponent.hpp",
"ToolTip": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\components\\TransformComponent.hpp",
"RelativeToolTip": "src\\game\\components\\TransformComponent.hpp",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAB8AAAAoAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2025-07-13T20:31:15.964Z"
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "TextComponent.cpp",
"DocumentMoniker": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\components\\TextComponent.cpp",
"RelativeDocumentMoniker": "src\\game\\components\\TextComponent.cpp",
"ToolTip": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\components\\TextComponent.cpp",
"RelativeToolTip": "src\\game\\components\\TextComponent.cpp",
"ViewState": "AgIAAAAAAAAAAAAAAAAAABkAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2025-07-13T20:09:50.139Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 6,
"Title": "Entity.hpp",
"DocumentMoniker": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\components\\Entity.hpp",
"RelativeDocumentMoniker": "src\\game\\components\\Entity.hpp",
"ToolTip": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\components\\Entity.hpp",
"RelativeToolTip": "src\\game\\components\\Entity.hpp",
"ViewState": "AgIAAAwAAAAAAAAAAAAAABoAAAAZAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2025-07-13T19:25:40.407Z"
},
{
"$type": "Document",
"DocumentIndex": 3,
"Title": "Component.hpp",
"DocumentMoniker": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\components\\Component.hpp",
"RelativeDocumentMoniker": "src\\game\\components\\Component.hpp",
"ToolTip": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\components\\Component.hpp",
"RelativeToolTip": "src\\game\\components\\Component.hpp",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAgAAAAZAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2025-07-13T19:24:03.306Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 2,
"Title": "TextComponent.hpp",
"DocumentMoniker": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\components\\TextComponent.hpp",
"RelativeDocumentMoniker": "src\\game\\components\\TextComponent.hpp",
"ToolTip": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\components\\TextComponent.hpp",
"RelativeToolTip": "src\\game\\components\\TextComponent.hpp",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAwAAAAZAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2025-07-13T19:18:06.662Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "Engine.cpp",
"DocumentMoniker": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\core\\Engine.cpp",
"RelativeDocumentMoniker": "src\\core\\Engine.cpp",
"ToolTip": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\core\\Engine.cpp",
"RelativeToolTip": "src\\core\\Engine.cpp",
"ViewState": "AgIAAEsAAAAAAAAAAAAAAFkAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2025-07-13T18:23:56.384Z",
"EditorCaption": ""
}
]
}
]
},
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"FloatingWindowState": {
"Id": "09bdcdd6-978b-49f3-a0e1-d42915841f24",
"Display": 1,
"X": 215,
"Y": 195,
"Width": 1553,
"Height": 721,
"WindowState": 2
},
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 0,
"Children": [
{
"$type": "Document",
"DocumentIndex": 4,
"Title": "Engine.hpp",
"DocumentMoniker": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\core\\Engine.hpp",
"RelativeDocumentMoniker": "src\\core\\Engine.hpp",
"ToolTip": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\core\\Engine.hpp",
"RelativeToolTip": "src\\core\\Engine.hpp",
"ViewState": "AgIAAAAAAAAAAAAAAAAAABAAAAACAAAAAAAAAA==",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2025-07-13T18:21:30.176Z",
"WhenOpened": "2025-07-14T21:38:06.719Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 3,
"Title": "Renderer.cpp",
"DocumentMoniker": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\systems\\Renderer.cpp",
"RelativeDocumentMoniker": "src\\systems\\Renderer.cpp",
"ToolTip": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\systems\\Renderer.cpp",
"RelativeToolTip": "src\\systems\\Renderer.cpp",
"ViewState": "AgIAACQAAAAAAAAAAAAAADcAAAABAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2025-07-14T19:09:41.942Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 4,
"Title": "TextRenderer.hpp",
"DocumentMoniker": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\systems\\TextRenderer.hpp",
"RelativeDocumentMoniker": "src\\game\\systems\\TextRenderer.hpp",
"ToolTip": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\systems\\TextRenderer.hpp",
"RelativeToolTip": "src\\game\\systems\\TextRenderer.hpp",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAwAAACJAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2025-07-14T18:40:34.768Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 2,
"Title": "TextRenderer.cpp",
"DocumentMoniker": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\games\\systems\\TextRenderer.cpp",
"RelativeDocumentMoniker": "src\\games\\systems\\TextRenderer.cpp",
"ToolTip": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\games\\systems\\TextRenderer.cpp",
"RelativeToolTip": "src\\games\\systems\\TextRenderer.cpp",
"ViewState": "AgIAAFoAAAAAAAAAAAAAAIgAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2025-07-14T18:37:30.888Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Engine.cpp",
"DocumentMoniker": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\core\\Engine.cpp",
"RelativeDocumentMoniker": "src\\core\\Engine.cpp",
"ToolTip": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\core\\Engine.cpp",
"RelativeToolTip": "src\\core\\Engine.cpp",
"ViewState": "AgIAADAAAAAAAAAAAAAAAEcAAAAHAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2025-07-14T18:37:05.586Z",
"EditorCaption": ""
}
]

View File

@ -3,32 +3,24 @@
"WorkspaceRootPath": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\components\\TextComponent.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|solutionrelative:src\\game\\components\\TextComponent.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
"AbsoluteMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\core\\Engine.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|solutionrelative:src\\core\\Engine.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\core\\Engine.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|solutionrelative:src\\core\\Engine.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\core\\Engine.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|solutionrelative:src\\core\\Engine.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
"AbsoluteMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\games\\systems\\TextRenderer.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|solutionrelative:src\\games\\systems\\TextRenderer.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\components\\TextComponent.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|solutionrelative:src\\game\\components\\TextComponent.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
"AbsoluteMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\systems\\Renderer.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|solutionrelative:src\\systems\\Renderer.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\components\\Component.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|solutionrelative:src\\game\\components\\Component.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\components\\TransformComponent.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|solutionrelative:src\\game\\components\\TransformComponent.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\components\\Entity.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|solutionrelative:src\\game\\components\\Entity.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
"AbsoluteMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\systems\\TextRenderer.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{5653811A-38D1-4D9D-9446-A417E8557584}|ShadowCrestGameEngine.vcxproj|solutionrelative:src\\game\\systems\\TextRenderer.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
}
],
"DocumentGroupContainers": [
@ -38,101 +30,7 @@
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 1,
"Children": [
{
"$type": "Document",
"DocumentIndex": 5,
"Title": "TransformComponent.hpp",
"DocumentMoniker": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\components\\TransformComponent.hpp",
"RelativeDocumentMoniker": "src\\game\\components\\TransformComponent.hpp",
"ToolTip": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\components\\TransformComponent.hpp",
"RelativeToolTip": "src\\game\\components\\TransformComponent.hpp",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAB8AAAAoAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2025-07-13T20:31:15.964Z"
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "TextComponent.cpp",
"DocumentMoniker": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\components\\TextComponent.cpp",
"RelativeDocumentMoniker": "src\\game\\components\\TextComponent.cpp",
"ToolTip": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\components\\TextComponent.cpp",
"RelativeToolTip": "src\\game\\components\\TextComponent.cpp",
"ViewState": "AgIAAAAAAAAAAAAAAAAAABIAAAA5AAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2025-07-13T20:09:50.139Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 6,
"Title": "Entity.hpp",
"DocumentMoniker": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\components\\Entity.hpp",
"RelativeDocumentMoniker": "src\\game\\components\\Entity.hpp",
"ToolTip": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\components\\Entity.hpp",
"RelativeToolTip": "src\\game\\components\\Entity.hpp",
"ViewState": "AgIAAAwAAAAAAAAAAAAAABoAAAAZAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2025-07-13T19:25:40.407Z"
},
{
"$type": "Document",
"DocumentIndex": 4,
"Title": "Component.hpp",
"DocumentMoniker": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\components\\Component.hpp",
"RelativeDocumentMoniker": "src\\game\\components\\Component.hpp",
"ToolTip": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\components\\Component.hpp",
"RelativeToolTip": "src\\game\\components\\Component.hpp",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAgAAAAZAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2025-07-13T19:24:03.306Z"
},
{
"$type": "Document",
"DocumentIndex": 3,
"Title": "TextComponent.hpp",
"DocumentMoniker": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\components\\TextComponent.hpp",
"RelativeDocumentMoniker": "src\\game\\components\\TextComponent.hpp",
"ToolTip": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\components\\TextComponent.hpp",
"RelativeToolTip": "src\\game\\components\\TextComponent.hpp",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAwAAAAZAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2025-07-13T19:18:06.662Z"
},
{
"$type": "Document",
"DocumentIndex": 2,
"Title": "Engine.cpp",
"DocumentMoniker": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\core\\Engine.cpp",
"RelativeDocumentMoniker": "src\\core\\Engine.cpp",
"ToolTip": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\core\\Engine.cpp",
"RelativeToolTip": "src\\core\\Engine.cpp",
"ViewState": "AgIAAEsAAAAAAAAAAAAAAFkAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2025-07-13T18:23:56.384Z"
}
]
}
]
},
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"FloatingWindowState": {
"Id": "09bdcdd6-978b-49f3-a0e1-d42915841f24",
"Display": 1,
"X": 215,
"Y": 195,
"Width": 1553,
"Height": 721,
"WindowState": 2
},
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 0,
"SelectedChildIndex": 4,
"Children": [
{
"$type": "Document",
@ -142,9 +40,61 @@
"RelativeDocumentMoniker": "src\\core\\Engine.hpp",
"ToolTip": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\core\\Engine.hpp",
"RelativeToolTip": "src\\core\\Engine.hpp",
"ViewState": "AgIAAAAAAAAAAAAAAAAAABAAAAACAAAAAAAAAA==",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2025-07-13T18:21:30.176Z",
"WhenOpened": "2025-07-14T21:38:06.719Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 3,
"Title": "Renderer.cpp",
"DocumentMoniker": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\systems\\Renderer.cpp",
"RelativeDocumentMoniker": "src\\systems\\Renderer.cpp",
"ToolTip": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\systems\\Renderer.cpp",
"RelativeToolTip": "src\\systems\\Renderer.cpp",
"ViewState": "AgIAACQAAAAAAAAAAAAAADcAAAABAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2025-07-14T19:09:41.942Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 4,
"Title": "TextRenderer.hpp",
"DocumentMoniker": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\systems\\TextRenderer.hpp",
"RelativeDocumentMoniker": "src\\game\\systems\\TextRenderer.hpp",
"ToolTip": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\game\\systems\\TextRenderer.hpp",
"RelativeToolTip": "src\\game\\systems\\TextRenderer.hpp",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAwAAACJAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2025-07-14T18:40:34.768Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 2,
"Title": "TextRenderer.cpp",
"DocumentMoniker": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\games\\systems\\TextRenderer.cpp",
"RelativeDocumentMoniker": "src\\games\\systems\\TextRenderer.cpp",
"ToolTip": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\games\\systems\\TextRenderer.cpp",
"RelativeToolTip": "src\\games\\systems\\TextRenderer.cpp",
"ViewState": "AgIAAFoAAAAAAAAAAAAAAIgAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2025-07-14T18:37:30.888Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Engine.cpp",
"DocumentMoniker": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\core\\Engine.cpp",
"RelativeDocumentMoniker": "src\\core\\Engine.cpp",
"ToolTip": "C:\\Users\\steev\\Desktop\\ShadowCrestGameEngine\\src\\core\\Engine.cpp",
"RelativeToolTip": "src\\core\\Engine.cpp",
"ViewState": "AgIAADAAAAAAAAAAAAAAAEIAAAADAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2025-07-14T18:37:05.586Z",
"EditorCaption": ""
}
]

Binary file not shown.

View File

@ -1,6 +1,11 @@
C:\Users\steev\Desktop\ShadowCrestGameEngine\src\core\Engine.cpp;C:\Users\steev\Desktop\ShadowCrestGameEngine\ShadowCr.5653811a\x64\Debug\Engine.obj
C:\Users\steev\Desktop\ShadowCrestGameEngine\src\core\Logger.cpp;C:\Users\steev\Desktop\ShadowCrestGameEngine\ShadowCr.5653811a\x64\Debug\Logger.obj
C:\Users\steev\Desktop\ShadowCrestGameEngine\src\core\WindowManager.cpp;C:\Users\steev\Desktop\ShadowCrestGameEngine\ShadowCr.5653811a\x64\Debug\WindowManager.obj
C:\Users\steev\Desktop\ShadowCrestGameEngine\src\games\systems\TextRenderer.cpp;C:\Users\steev\Desktop\ShadowCrestGameEngine\ShadowCr.5653811a\x64\Debug\TextRenderer.obj
C:\Users\steev\Desktop\ShadowCrestGameEngine\src\game\components\TextComponent.cpp;C:\Users\steev\Desktop\ShadowCrestGameEngine\ShadowCr.5653811a\x64\Debug\TextComponent.obj
C:\Users\steev\Desktop\ShadowCrestGameEngine\src\game\systems\FontManager.cpp;C:\Users\steev\Desktop\ShadowCrestGameEngine\ShadowCr.5653811a\x64\Debug\FontManager.obj
C:\Users\steev\Desktop\ShadowCrestGameEngine\src\game\systems\FontManager.hpp;C:\Users\steev\Desktop\ShadowCrestGameEngine\ShadowCr.5653811a\x64\Debug\FontManager.obj
C:\Users\steev\Desktop\ShadowCrestGameEngine\src\game\systems\TextRenderer.hpp;C:\Users\steev\Desktop\ShadowCrestGameEngine\ShadowCr.5653811a\x64\Debug\TextRenderer.obj
C:\Users\steev\Desktop\ShadowCrestGameEngine\src\main.cpp;C:\Users\steev\Desktop\ShadowCrestGameEngine\ShadowCr.5653811a\x64\Debug\main.obj
C:\Users\steev\Desktop\ShadowCrestGameEngine\src\systems\Renderer.cpp;C:\Users\steev\Desktop\ShadowCrestGameEngine\ShadowCr.5653811a\x64\Debug\Renderer.obj
C:\Users\steev\Desktop\ShadowCrestGameEngine\src\systems\Renderer.hpp;C:\Users\steev\Desktop\ShadowCrestGameEngine\ShadowCr.5653811a\x64\Debug\Renderer.obj

View File

@ -1 +0,0 @@
<EFBFBD><EFBFBD>

View File

@ -1 +0,0 @@
<EFBFBD><EFBFBD>

View File

@ -1 +0,0 @@
<EFBFBD><EFBFBD>

View File

@ -1,2 +1,2 @@
^C:\USERS\STEEV\DESKTOP\SHADOWCRESTGAMEENGINE\SHADOWCR.5653811A\X64\DEBUG\ENGINE.OBJ|C:\USERS\STEEV\DESKTOP\SHADOWCRESTGAMEENGINE\SHADOWCR.5653811A\X64\DEBUG\LOGGER.OBJ|C:\USERS\STEEV\DESKTOP\SHADOWCRESTGAMEENGINE\SHADOWCR.5653811A\X64\DEBUG\MAIN.OBJ|C:\USERS\STEEV\DESKTOP\SHADOWCRESTGAMEENGINE\SHADOWCR.5653811A\X64\DEBUG\RENDERER.OBJ|C:\USERS\STEEV\DESKTOP\SHADOWCRESTGAMEENGINE\SHADOWCR.5653811A\X64\DEBUG\RENDERER.OBJ|C:\USERS\STEEV\DESKTOP\SHADOWCRESTGAMEENGINE\SHADOWCR.5653811A\X64\DEBUG\WINDOWMANAGER.OBJ
^C:\USERS\STEEV\DESKTOP\SHADOWCRESTGAMEENGINE\SHADOWCR.5653811A\X64\DEBUG\ENGINE.OBJ|C:\USERS\STEEV\DESKTOP\SHADOWCRESTGAMEENGINE\SHADOWCR.5653811A\X64\DEBUG\FONTMANAGER.OBJ|C:\USERS\STEEV\DESKTOP\SHADOWCRESTGAMEENGINE\SHADOWCR.5653811A\X64\DEBUG\FONTMANAGER.OBJ|C:\USERS\STEEV\DESKTOP\SHADOWCRESTGAMEENGINE\SHADOWCR.5653811A\X64\DEBUG\LOGGER.OBJ|C:\USERS\STEEV\DESKTOP\SHADOWCRESTGAMEENGINE\SHADOWCR.5653811A\X64\DEBUG\MAIN.OBJ|C:\USERS\STEEV\DESKTOP\SHADOWCRESTGAMEENGINE\SHADOWCR.5653811A\X64\DEBUG\RENDERER.OBJ|C:\USERS\STEEV\DESKTOP\SHADOWCRESTGAMEENGINE\SHADOWCR.5653811A\X64\DEBUG\RENDERER.OBJ|C:\USERS\STEEV\DESKTOP\SHADOWCRESTGAMEENGINE\SHADOWCR.5653811A\X64\DEBUG\TEXTCOMPONENT.OBJ|C:\USERS\STEEV\DESKTOP\SHADOWCRESTGAMEENGINE\SHADOWCR.5653811A\X64\DEBUG\TEXTRENDERER.OBJ|C:\USERS\STEEV\DESKTOP\SHADOWCRESTGAMEENGINE\SHADOWCR.5653811A\X64\DEBUG\TEXTRENDERER.OBJ|C:\USERS\STEEV\DESKTOP\SHADOWCRESTGAMEENGINE\SHADOWCR.5653811A\X64\DEBUG\WINDOWMANAGER.OBJ
C:\Users\steev\Desktop\ShadowCrestGameEngine\ShadowCr.5653811a\x64\Debug\ShadowCrestGameEngine.ilk

Binary file not shown.

Binary file not shown.

View File

@ -132,12 +132,17 @@
<ClCompile Include="src\core\Engine.cpp" />
<ClCompile Include="src\core\Logger.cpp" />
<ClCompile Include="src\core\WindowManager.cpp" />
<ClCompile Include="src\games\systems\TextRenderer.cpp" />
<ClCompile Include="src\game\components\TextComponent.cpp" />
<ClCompile Include="src\game\systems\FontManager.cpp" />
<ClCompile Include="src\game\systems\FontManager.hpp" />
<ClCompile Include="src\game\systems\TextRenderer.hpp" />
<ClCompile Include="src\main.cpp" />
<ClCompile Include="src\systems\Renderer.cpp" />
<ClCompile Include="src\systems\Renderer.hpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="libs\stb_truetype.h" />
<ClInclude Include="src\core\Engine.hpp" />
<ClInclude Include="src\core\Logger.hpp" />
<ClInclude Include="src\core\WindowManager.hpp" />

View File

@ -63,6 +63,18 @@
<ClCompile Include="src\game\components\TextComponent.cpp">
<Filter>Quelldateien\game\components</Filter>
</ClCompile>
<ClCompile Include="src\game\systems\FontManager.hpp">
<Filter>Headerdateien\systems</Filter>
</ClCompile>
<ClCompile Include="src\game\systems\FontManager.cpp">
<Filter>Quelldateien\systems</Filter>
</ClCompile>
<ClCompile Include="src\game\systems\TextRenderer.hpp">
<Filter>Headerdateien\systems</Filter>
</ClCompile>
<ClCompile Include="src\games\systems\TextRenderer.cpp">
<Filter>Quelldateien\systems</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\core\Engine.hpp">
@ -86,5 +98,8 @@
<ClInclude Include="src\game\components\TransformComponent.hpp">
<Filter>Headerdateien\game\components</Filter>
</ClInclude>
<ClInclude Include="libs\stb_truetype.h">
<Filter>Headerdateien\systems</Filter>
</ClInclude>
</ItemGroup>
</Project>

5079
libs/stb_truetype.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -2,6 +2,8 @@
#include "WindowManager.hpp"
#include "../systems/Renderer.hpp"
#include "../game/components/TextComponent.hpp"
#include "../game/systems/FontManager.hpp"
#include "../game/systems/TextRenderer.hpp"
#include <iostream>
#include <SDL3/SDL.h>
#include <SDL3_ttf/SDL_ttf.h>
@ -9,6 +11,8 @@
bool running = true;
WindowManager *wm = nullptr;
Renderer renderer;
FontManager fontManager;
TextRenderer textRenderer(nullptr, nullptr); // Initial mit nullptr
bool Engine::Init() {
if (!SDL_Init(SDL_INIT_VIDEO)) {
@ -16,11 +20,6 @@ bool Engine::Init() {
return false;
}
if (!TTF_Init()) {
std::cerr << "TTF_Init: failed" << SDL_GetError() << "\n";
return false;
}
wm = new WindowManager();
if (!wm->InitWindow("ShadowCrest", 800, 600)) {
@ -31,6 +30,14 @@ bool Engine::Init() {
if (!renderer.Init(wm->GetWindow())) return false;
// Font laden
if (!fontManager.LoadFont("Roboto", "Assets/fonts/Roboto-Bold.ttf")) {
std::cerr << "Font konnte nicht geladen werden\n";
return false;
}
// TextRenderer mit g<>ltigem Renderer + FontManager initialisieren
textRenderer = TextRenderer(renderer.GetSDLRenderer(), &fontManager);
return true;
}
@ -49,12 +56,18 @@ void Engine::Run() {
renderer.Clear();
// game logic here
TextComponent* text = new TextComponent(
"Hallo Welt", "assets/fonts/Roboto.ttf", 24, SDL_Color{ 255, 255, 255, 255 }
);
text->Init(renderer.GetSDLRenderer());
// Beispieltext rendern
int w, h;
SDL_Color white = { 255, 255, 255, 255 };
SDL_Texture* tex = textRenderer.RenderText("Roboto", std::to_string(GetFPS()), 24, white, w, h);
if (tex) {
renderer.DrawTexture(tex, 0, 0, w, h);
SDL_DestroyTexture(tex); // Wichtig: Texture freigeben!
}
renderer.Present();
SDL_Delay(15);
}
}

View File

@ -0,0 +1,32 @@
#include "FontManager.hpp"
#include <fstream>
#define STB_TRUETYPE_IMPLEMENTATION
#include "stb_truetype.h"
#include <iostream>
#include <direct.h>
bool FontManager::LoadFont(const std::string& id, const std::string& path) {
std::ifstream file(path, std::ios::binary);
if (!file) {
std::cerr << "Font file not found at path: " << path << "\n";
return false;
}
std::vector<unsigned char> buffer((std::istreambuf_iterator<char>(file)), {});
stbtt_fontinfo font;
if (!stbtt_InitFont(&font, buffer.data(), 0)) return false;
fontBuffers[id] = std::move(buffer);
fonts[id] = font;
char cwd[1024];
_getcwd(cwd, sizeof(cwd));
std::cout << "Current working directory: " << cwd << "\n";
return true;
}
stbtt_fontinfo* FontManager::GetFont(const std::string& id) {
if (fonts.find(id) == fonts.end()) return nullptr;
return &fonts[id];
}

View File

@ -0,0 +1,15 @@
#pragma once
#include <string>
#include <unordered_map>
#include <vector>
#include "stb_truetype.h"
class FontManager {
public:
bool LoadFont(const std::string& id, const std::string& path);
stbtt_fontinfo* GetFont(const std::string& id);
private:
std::unordered_map<std::string, std::vector<unsigned char>> fontBuffers;
std::unordered_map<std::string, stbtt_fontinfo> fonts;
};

View File

@ -0,0 +1,18 @@
#pragma once
#include "FontManager.hpp"
#include <SDL3/SDL.h>
#include <string>
/*
By Utilizing the existing Renderer this class creates and renders text to the screen
*/
class TextRenderer {
public:
TextRenderer(SDL_Renderer* renderer, FontManager* fontMgr);
SDL_Texture* RenderText(const std::string& fontID, const std::string& text, int fontSize, SDL_Color color, int& outWidth, int& outHeight);
private:
SDL_Renderer* renderer;
FontManager* fontManager;
};

View File

@ -0,0 +1,136 @@
#include "../../game/systems/TextRenderer.hpp"
#include "../../game/systems/FontManager.hpp"
#include <SDL3/SDL.h>
// Konstruktor: speichert Renderer und FontManager
TextRenderer::TextRenderer(SDL_Renderer* renderer, FontManager* fontMgr)
: renderer(renderer), fontManager(fontMgr) {
}
// Rendert einen kompletten Text-String in eine SDL_Texture
SDL_Texture* TextRenderer::RenderText(const std::string& fontID, const std::string& text, int fontSize, SDL_Color color, int& outWidth, int& outHeight) {
// get font
stbtt_fontinfo* font = fontManager->GetFont(fontID);
if (!font) {
SDL_Log("Font not found!");
return nullptr;
}
// calculate scal for font
float scale = stbtt_ScaleForPixelHeight(font, (float)fontSize);
// calculate vertical metrics for font
int ascent;
int descent;
int lineGap;
stbtt_GetFontVMetrics(font, &ascent, &descent, &lineGap);
int baseLine = int(ascent * scale);
// calculate sizes
int height = int((ascent - descent + lineGap) * scale);
int width = 0;
// get offset and advancedWith for each character and sum the width up
for (char c : text) {
int advancedWidth;
stbtt_GetCodepointHMetrics(font, c, &advancedWidth, nullptr);
width += int(advancedWidth * scale);
}
if (width <= 0 || height <= 0) {
SDL_Log("Invalid text size");
return nullptr;
}
outWidth = width;
outHeight = height;
// allocate RGBA 8Bit bitmap buffer for whole string
std::vector<Uint32> pixels(width * height, 0);
int xCursor = 0;
// get boundingbox
// bounding box is required in order to make a bitmap for a glyph (character)
for (char c : text) {
int ax, lsb;
stbtt_GetCodepointHMetrics(font, c, &ax, &lsb);
int x0, y0, x1, y1;
stbtt_GetCodepointBitmapBox(font, c, scale, scale, &x0, &y0, &x1, &y1);
// create bitmap
// get the actual boundingbox size of the glyph
int glyphW = x1 - x0;
int glyphH = y1 - y0;
if (glyphW <= 0 || glyphH <= 0) {
continue;
}
// defines the bitmap for a single glyph
// allocate memory for the glyphs bitmap buffer
std::vector<unsigned char> glyphBitmap(glyphW * glyphH);
// render glyph into the bitmap buffer
stbtt_MakeCodepointBitmap(font, glyphBitmap.data(), glyphW, glyphH, glyphW, scale, scale, c);
int dstX = xCursor + x0;
int dstY = baseLine + y0;
// iterate glyph bitmap buffer and allocate it to the pixel bitmap buffer
for (int y = 0; y < glyphH; y++) {
for (int x = 0; x < glyphW; x++) {
// position of the set pixel
int gx = dstX + x;
int gy = dstY + y;
if (gx < 0 || gx >= width || gy < 0 || gy >= height) continue;
// calculate alpha (opacity) by calculating y position * the glyphs width + x position
Uint8 alpha = glyphBitmap[y * glyphW + x];
// generate 32bit RGBA color value
/**
* sets color at the correct
* 24-32 red
* 16-24 green
* 8-16 blue
* 0-8 alpha
*/
Uint32 rgba = (color.r << 24) | (color.g << 16) | (color.b << 8) | alpha;
// assign rgba value to pixel at the big bitmap buffer
pixels[gy * width + gx] = rgba;
}
}
xCursor += int(ax * scale);
}
// create SDL3 Texture which can be rendered by the SDL Renderer
SDL_Texture* texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_STATIC, width, height);
if (!texture) {
SDL_Log("Failed to create texture: %s", SDL_GetError());
return nullptr;
}
if (width <= 0 || height <= 0 || pixels.empty()) {
SDL_Log("Invalid texture dimensions or pixel buffer is empty");
return nullptr;
}
// moves texture from CPU buffer to GPU Buffer
int pitch = width * sizeof(Uint32); // Anzahl Bytes pro Zeile
if (!SDL_UpdateTexture(texture, nullptr, pixels.data(), pitch)) {
SDL_Log("Failed to update texture: %s", SDL_GetError());
SDL_DestroyTexture(texture);
return nullptr;
}
return texture;
}

View File

@ -48,12 +48,6 @@ void Renderer::DrawRect(int x, int y, int w, int h, SDL_Color color) {
SDL_RenderFillRect(renderer, &rect); // SDL3 nutzt FRect
}
SDL_Texture* Renderer::DrawText(const char* message, const char* fontFile, int fontSize, SDL_Color color) {
return nullptr;
}
void Renderer::DrawTexture(SDL_Texture* texture, int x, int y, int w, int h) {
SDL_FRect dst = { static_cast<float>(x), static_cast<float>(y),

View File

@ -9,7 +9,6 @@ public:
void Shutdown();
void DrawRect(int x, int y, int w, int h, SDL_Color color);
SDL_Texture* DrawText(const char* message, const char* fontFile, int fontSize, SDL_Color color);
void DrawTexture(SDL_Texture* texture, int x, int y, int w, int h);
SDL_Renderer* GetSDLRenderer() const { return renderer; }

5079
src/systems/stb_truetype.h Normal file

File diff suppressed because it is too large Load Diff

BIN
x64/Debug/Roboto-Bold.ttf Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.