commit b27d4b8514f7ea0aa5ecc3c2a43dda073210f71b Author: Kbz-8 Date: Wed Mar 1 15:52:45 2023 +0100 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..33cc21d --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.o +*.swp +*.swx diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8d5a6a0 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) 2023 kbz_8 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..eb090b5 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# KVF + +KVF (kbz_8 vulkan framework) is a lightweight single-header Vulkan framework written in C99 to simplify the creation of Vulkan applications. diff --git a/kvf.h b/kvf.h new file mode 100644 index 0000000..f781028 --- /dev/null +++ b/kvf.h @@ -0,0 +1,72 @@ +/** + * MIT License + * + * Copyright (c) 2023 kbz_8 + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * + * Do this: + * #define KVF_IMPLEMENTATION + * before you include this file in *one* C or C++ file to create the implementation. + * + * // i.e. it should look like this: + * #include ... + * #include ... + * #include ... + * #define KVF_IMPLEMENTATION + * #include "kvf.h" + * + * You can #define KVF_ASSERT(x) before the #include to avoid using assert.h. + * And #define KVF_MALLOC, KVF_REALLOC, and KVF_FREE to avoid using malloc, realloc, free. + * + * If you are using Volk or any other meta loader you must define KVF_IMPL_VK_NO_PROTOTYPES + * before including this file to avoid conflicts with Vulkan prototypes. + */ + +#ifndef KBZ_8_VULKAN_FRAMEWORK_H +#define KBZ_8_VULKAN_FRAMEWORK_H + +#ifndef KVF_IMPL_VK_NO_PROTOTYPES + #include +#endif // KVF_IMPL_VK_NO_PROTOTYPES + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct +{ + bool enableValidationLayers; +} KvfInstanceDesc; + +VkInstance kvfCreateInstance(KvfInstanceDesc description); + +#ifdef __cplusplus +} +#endif + +#ifdef KVF_IMPLEMENTATION + +#endif // KVF_IMPLEMENTATION + +#endif // KBZ_8_VULKAN_FRAMEWORK_H