new structure complete

This commit is contained in:
Jorijn van der Graaf 2025-11-16 18:52:52 +01:00
commit e7d0bc8f8e
69 changed files with 141 additions and 2733 deletions

View file

@ -24,9 +24,5 @@ for(uint32_t x = 0; x < 1280; x++) {
## How to Run
```bash
crafter-build -c example -r
crafter-build build executable -r
```
## Relevant documentation
[WindowWaylandWayland](https://crafter-graphics.docs.catcrafts.net/classCrafter_1_1WindowWaylandWayland.html)

View file

@ -1,42 +1,19 @@
/*
Crafter®.Graphics
Copyright (C) 2025 Catcrafts®
Catcrafts.net
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3.0 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <cstdint>
#include <iostream>
import Crafter.Graphics;
import std;
using namespace Crafter;
int main() {
WindowWaylandWayland window("HelloWindow", 1280, 720);
// for(uint32_t x = 0; x < 1280; x++) {
// for(uint32_t y = 0; y < 720; y++) {
// window.framebuffer[x*720+y].r = 255;
// window.framebuffer[x*720+y].g = 0;
// window.framebuffer[x*720+y].b = 0;
// window.framebuffer[x*720+y].a = 255;
// }
// }
for(uint32_t x = 0; x < 1280; x++) {
for(uint32_t y = 0; y < 720; y++) {
window.framebuffer[x*720+y].r = 255;
window.framebuffer[x*720+y].g = 0;
window.framebuffer[x*720+y].b = 0;
window.framebuffer[x*720+y].a = 255;
}
}
//Semi transparant version:
// for(uint32_t x = 0; x < 1280; x++) {
// for(uint32_t y = 0; y < 720; y++) {

View file

@ -2,19 +2,12 @@
"name": "crafter-graphics",
"configurations": [
{
"name": "example",
"standard": "c++26",
"source_files": ["main"],
"module_files": [],
"build_dir": "build",
"output_dir": "bin",
"type":"executable",
"libs": [],
"flags": ["-Wno-uninitialized"],
"name": "executable",
"implementations": ["main"],
"dependencies": [
{
"path":"../../project.json",
"configuration":"lib-debug"
"configuration":"lib-wayland"
}
]
}

View file

@ -40,10 +40,5 @@ EventListener<char> anyKeyListener(&window.onAnyKeyDown, [](char key){
## How to Run
```bash
crafter-build -c example -r
```
## Relevant documentation
[Window](https://crafter-graphics.docs.catcrafts.net/classCrafter_1_1Window.html)
crafter-build build executable -r
```

View file

@ -1,29 +1,6 @@
/*
Crafter®.Graphics
Copyright (C) 2025 Catcrafts®
Catcrafts.net
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3.0 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <iostream>
#include <format>
import Crafter.Graphics;
//Needed for events
import Crafter.Event;
import std;
using namespace Crafter;
int main() {

View file

@ -2,19 +2,12 @@
"name": "crafter-graphics",
"configurations": [
{
"name": "example",
"standard": "c++26",
"source_files": ["main"],
"module_files": [],
"build_dir": "build",
"output_dir": "bin",
"type":"executable",
"libs": [],
"flags": ["-Wno-uninitialized"],
"name": "executable",
"implementations": ["main"],
"dependencies": [
{
"path":"../../project.json",
"configuration":"lib-debug"
"configuration":"lib-wayland"
}
]
}

View file

@ -28,9 +28,5 @@ UiElement& element = window.elements.emplace_back(
## How to Run
```bash
crafter-build -c example -r
```
## Relevant documentation
[UiElement](https://crafter-graphics.docs.catcrafts.net/classCrafter_1_1UiElement.html)
crafter-build build executable -r
```

View file

@ -1,28 +1,6 @@
/*
Crafter®.Graphics
Copyright (C) 2025 Catcrafts®
Catcrafts.net
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3.0 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <cstdint>
#include <iostream>
import Crafter.Event;
import Crafter.Graphics;
import std;
using namespace Crafter;
int main() {

View file

@ -2,19 +2,12 @@
"name": "crafter-graphics",
"configurations": [
{
"name": "example",
"standard": "c++26",
"source_files": ["main"],
"module_files": [],
"build_dir": "build",
"output_dir": "bin",
"type":"executable",
"libs": [],
"flags": ["-Wno-uninitialized"],
"name": "executable",
"implementations": ["main"],
"dependencies": [
{
"path":"../../project.json",
"configuration":"lib-debug"
"configuration":"lib-wayland"
}
]
}

View file

@ -18,10 +18,5 @@ window.StartSync();
## How to Run
```bash
crafter-build -c example -r
```
## Relevant documentation
[WindowWaylandWayland](https://crafter-graphics.docs.catcrafts.net/classCrafter_1_1WindowWaylandWayland.html)
crafter-build build executable -r
```

View file

@ -1,24 +1,5 @@
/*
Crafter®.Graphics
Copyright (C) 2025 Catcrafts®
Catcrafts.net
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3.0 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
import Crafter.Graphics;
import std;
using namespace Crafter;
int main() {

View file

@ -2,19 +2,12 @@
"name": "crafter-graphics",
"configurations": [
{
"name": "example",
"standard": "c++26",
"source_files": ["main"],
"module_files": [],
"build_dir": "build",
"output_dir": "bin",
"type":"executable",
"libs": [],
"flags": ["-Wno-uninitialized"],
"name": "executable",
"implementations": ["main"],
"dependencies": [
{
"path":"../../project.json",
"configuration":"lib-debug"
"configuration":"lib-wayland"
}
]
}

View file

@ -5,7 +5,7 @@ Here you'll find a variety of demos to help you learn and experiment with the fe
## Getting Started
To run any example, navigate into its folder and use the following command:
```bash
crafter-build -c example -r
crafter-build build executable -r
```
## Hello Series

View file

@ -19,9 +19,5 @@ camera.Update();
## How to Run
```bash
crafter-build -c example -r
```
## Relevant documentation
[Camera](https://crafter-graphics.docs.catcrafts.net/classCrafter_1_1Mesh.html)
crafter-build build executable -r
```

View file

@ -1,27 +1,5 @@
/*
Crafter®.Graphics
Copyright (C) 2025 Catcrafts®
Catcrafts.net
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3.0 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <cstring>
#include <vulkan/vulkan.h>
//required for the camera matrix.
import Crafter.Math;
import Crafter.Event;
import Crafter.Graphics;

View file

@ -28,10 +28,5 @@ class CustomShader {
## How to Run
```bash
crafter-build -c example -r
crafter-build build executable -r
```
## Relevant documentation
[DescriptorSet](https://crafter-graphics.docs.catcrafts.net/classCrafter_1_1DescriptorSet.html)
[VulkanShader](https://crafter-graphics.docs.catcrafts.net/classCrafter_1_1VulkanShader.html)

View file

@ -1,31 +1,11 @@
/*
Crafter®.Graphics
Copyright (C) 2025 Catcrafts®
Catcrafts.net
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3.0 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "../../lib/VulkanInitializers.hpp"
#include <cstring>
#include <vector>
#include <vulkan/vulkan.h>
//required for the camera matrix.
import Crafter.Math;
import Crafter.Event;
import std;
import Crafter.Graphics;
using namespace Crafter;
@ -44,7 +24,7 @@ class CustomShader {
Initialze our buffer as shader visible storage buffer with the size of the colors vector.
*/
CustomShader(const std::vector<Vector<float, 4>>& colors) : colors(VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, colors.size()) {
memcpy(this->colors.value, colors.data(), colors.size()*sizeof(Vector<float, 4>));
std::memcpy(this->colors.value, colors.data(), colors.size()*sizeof(Vector<float, 4>));
}
void WriteDescriptors(VkDescriptorSet set) {
/*

View file

@ -21,14 +21,5 @@ EventListener<VkCommandBuffer> listener(&window.onDraw, [&descriptors, &meshShad
## How to Run
```bash
crafter-build -c example -r
```
## Relevant documentation
[DescriptorSet](https://crafter-graphics.docs.catcrafts.net/classCrafter_1_1DescriptorSet.html)
[Mesh](https://crafter-graphics.docs.catcrafts.net/classCrafter_1_1Mesh.html)
[MeshShader](https://crafter-graphics.docs.catcrafts.net/classCrafter_1_1MeshShader.html)
[VulkanShader](https://crafter-graphics.docs.catcrafts.net/classCrafter_1_1VulkanShader.html)
[VulkanPipeline](https://crafter-graphics.docs.catcrafts.net/classCrafter_1_1VulkanPipeline.html)
[WindowWaylandVulkan](https://crafter-graphics.docs.catcrafts.net/classCrafter_1_1WindowWaylandVulkan.html)
crafter-build build executable -r
```

View file

@ -1,23 +1,3 @@
/*
Crafter®.Graphics
Copyright (C) 2025 Catcrafts®
Catcrafts.net
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3.0 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <vulkan/vulkan.h>
import Crafter.Event;

View file

@ -21,11 +21,5 @@ window.StartSync();
## How to Run
```bash
crafter-build -c example -r
```
## Relevant documentation
[VulkanDevice](https://crafter-graphics.docs.catcrafts.net/classCrafter_1_1VulkanDevice.html)
[WindowWaylandVulkan](https://crafter-graphics.docs.catcrafts.net/classCrafter_1_1WindowWaylandVulkan.html)
crafter-build build executable -r
```

View file

@ -1,23 +1,3 @@
/*
Crafter®.Graphics
Copyright (C) 2025 Catcrafts®
Catcrafts.net
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3.0 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <vulkan/vulkan.h>
import Crafter.Graphics;