diff --git a/Learning Vulkan.cpp b/Learning Vulkan.cpp new file mode 100644 index 0000000..555c7c2 --- /dev/null +++ b/Learning Vulkan.cpp @@ -0,0 +1,62 @@ +#define GLFW_INCLUDE_VULKAN +#include + +#include +#include +#include + +const uint32_t WIDTH = 800; +const uint32_t HEIGHT = 600; + +class HelloTriangleApplication { + +private: + GLFWwindow* window; + +public: + void run() { + initWindow(); + initVulkan(); + mainLoop(); + cleanup(); + } + +private: + void initWindow() { + glfwInit(); + + glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API); + glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE); + + window = glfwCreateWindow(WIDTH, HEIGHT, "Vulkan", nullptr, nullptr); + } + void initVulkan() { + + } + + void mainLoop() { + while (!glfwWindowShouldClose(window)) { + glfwPollEvents(); + } + } + + void cleanup() { + glfwDestroyWindow(window); + + glfwTerminate(); + } +}; + +int main() { + HelloTriangleApplication app; + + try { + app.run(); + } + catch (const std::exception& e) { + std::cerr << e.what() << std::endl; + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/Learning Vulkan.sln b/Learning Vulkan.sln new file mode 100644 index 0000000..ab2568d --- /dev/null +++ b/Learning Vulkan.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36310.24 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Learning Vulkan", "Learning Vulkan.vcxproj", "{A5BFFE0E-B935-4E68-959F-57FB9F013812}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A5BFFE0E-B935-4E68-959F-57FB9F013812}.Debug|x64.ActiveCfg = Debug|x64 + {A5BFFE0E-B935-4E68-959F-57FB9F013812}.Debug|x64.Build.0 = Debug|x64 + {A5BFFE0E-B935-4E68-959F-57FB9F013812}.Debug|x86.ActiveCfg = Debug|Win32 + {A5BFFE0E-B935-4E68-959F-57FB9F013812}.Debug|x86.Build.0 = Debug|Win32 + {A5BFFE0E-B935-4E68-959F-57FB9F013812}.Release|x64.ActiveCfg = Release|x64 + {A5BFFE0E-B935-4E68-959F-57FB9F013812}.Release|x64.Build.0 = Release|x64 + {A5BFFE0E-B935-4E68-959F-57FB9F013812}.Release|x86.ActiveCfg = Release|Win32 + {A5BFFE0E-B935-4E68-959F-57FB9F013812}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {3250BA2A-DE1B-4D2E-BE3E-FDF18F61CD89} + EndGlobalSection +EndGlobal diff --git a/Learning Vulkan.vcxproj b/Learning Vulkan.vcxproj new file mode 100644 index 0000000..127cf10 --- /dev/null +++ b/Learning Vulkan.vcxproj @@ -0,0 +1,139 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {a5bffe0e-b935-4e68-959f-57fb9f013812} + LearningVulkan + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + C:\Users\jorda\Development\Libraries\OpenGL\glfw-3.4.bin.WIN64\glfw-3.4.bin.WIN64\include;C:\Users\jorda\Development\Libraries\OpenGL\glm-0.9.9.7\glm\glm;C:\Users\jorda\Development\Libraries\Vulkan\1.4.304.0\Include;%(AdditionalIncludeDirectories) + stdcpp17 + + + Console + true + C:\Users\jorda\Development\Libraries\OpenGL\glfw-3.4.bin.WIN64\glfw-3.4.bin.WIN64\lib-vc2022;C:\Users\jorda\Development\Libraries\Vulkan\1.4.304.0\Lib;%(AdditionalLibraryDirectories) + vulkan-1.lib;glfw3.lib;%(AdditionalDependencies) + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + C:\Users\jorda\Development\Libraries\OpenGL\glfw-3.4.bin.WIN64\glfw-3.4.bin.WIN64\include;C:\Users\jorda\Development\Libraries\OpenGL\glm-0.9.9.7\glm\glm;C:\Users\jorda\Development\Libraries\Vulkan\1.4.304.0\Include;%(AdditionalIncludeDirectories) + stdcpp17 + + + Console + true + C:\Users\jorda\Development\Libraries\OpenGL\glfw-3.4.bin.WIN64\glfw-3.4.bin.WIN64\lib-vc2022;C:\Users\jorda\Development\Libraries\Vulkan\1.4.304.0\Lib;%(AdditionalLibraryDirectories) + vulkan-1.lib;glfw3.lib;%(AdditionalDependencies) + + + + + + + + + \ No newline at end of file diff --git a/Learning Vulkan.vcxproj.filters b/Learning Vulkan.vcxproj.filters new file mode 100644 index 0000000..6cb893e --- /dev/null +++ b/Learning Vulkan.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + \ No newline at end of file diff --git a/Vulkan notes/.obsidian/app.json b/Vulkan notes/.obsidian/app.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/Vulkan notes/.obsidian/app.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/Vulkan notes/.obsidian/appearance.json b/Vulkan notes/.obsidian/appearance.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/Vulkan notes/.obsidian/appearance.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/Vulkan notes/.obsidian/core-plugins.json b/Vulkan notes/.obsidian/core-plugins.json new file mode 100644 index 0000000..639b90d --- /dev/null +++ b/Vulkan notes/.obsidian/core-plugins.json @@ -0,0 +1,33 @@ +{ + "file-explorer": true, + "global-search": true, + "switcher": true, + "graph": true, + "backlink": true, + "canvas": true, + "outgoing-link": true, + "tag-pane": true, + "footnotes": false, + "properties": true, + "page-preview": true, + "daily-notes": true, + "templates": true, + "note-composer": true, + "command-palette": true, + "slash-command": false, + "editor-status": true, + "bookmarks": true, + "markdown-importer": false, + "zk-prefixer": false, + "random-note": false, + "outline": true, + "word-count": true, + "slides": false, + "audio-recorder": false, + "workspaces": false, + "file-recovery": true, + "publish": false, + "sync": true, + "bases": true, + "webviewer": false +} \ No newline at end of file diff --git a/Vulkan notes/.obsidian/graph.json b/Vulkan notes/.obsidian/graph.json new file mode 100644 index 0000000..42a46ec --- /dev/null +++ b/Vulkan notes/.obsidian/graph.json @@ -0,0 +1,22 @@ +{ + "collapse-filter": true, + "search": "", + "showTags": false, + "showAttachments": false, + "hideUnresolved": false, + "showOrphans": true, + "collapse-color-groups": true, + "colorGroups": [], + "collapse-display": true, + "showArrow": false, + "textFadeMultiplier": 0, + "nodeSizeMultiplier": 1, + "lineSizeMultiplier": 1, + "collapse-forces": true, + "centerStrength": 0.518713248970312, + "repelStrength": 10, + "linkStrength": 1, + "linkDistance": 250, + "scale": 1, + "close": true +} \ No newline at end of file diff --git a/Vulkan notes/.obsidian/workspace.json b/Vulkan notes/.obsidian/workspace.json new file mode 100644 index 0000000..6d556c7 --- /dev/null +++ b/Vulkan notes/.obsidian/workspace.json @@ -0,0 +1,191 @@ +{ + "main": { + "id": "52ca57cccf6257ba", + "type": "split", + "children": [ + { + "id": "3199b22f17e52927", + "type": "tabs", + "children": [ + { + "id": "4da918019b38eb09", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "Basics.md", + "mode": "source", + "source": false + }, + "icon": "lucide-file", + "title": "Basics" + } + } + ] + } + ], + "direction": "vertical" + }, + "left": { + "id": "215be0d5395d6bdc", + "type": "split", + "children": [ + { + "id": "78733b117f4d8796", + "type": "tabs", + "children": [ + { + "id": "2ea4c14eb2f2b592", + "type": "leaf", + "state": { + "type": "file-explorer", + "state": { + "sortOrder": "alphabetical", + "autoReveal": false + }, + "icon": "lucide-folder-closed", + "title": "Files" + } + }, + { + "id": "7a0784e2841fb54e", + "type": "leaf", + "state": { + "type": "search", + "state": { + "query": "", + "matchingCase": false, + "explainSearch": false, + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical" + }, + "icon": "lucide-search", + "title": "Search" + } + }, + { + "id": "bb0dcd0910086440", + "type": "leaf", + "state": { + "type": "bookmarks", + "state": {}, + "icon": "lucide-bookmark", + "title": "Bookmarks" + } + } + ] + } + ], + "direction": "horizontal", + "width": 300 + }, + "right": { + "id": "d8d44ecf8249ffa7", + "type": "split", + "children": [ + { + "id": "74129a8e76ba0e2c", + "type": "tabs", + "children": [ + { + "id": "72346fffe6fc9402", + "type": "leaf", + "state": { + "type": "backlink", + "state": { + "file": "Basics.md", + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical", + "showSearch": false, + "searchQuery": "", + "backlinkCollapsed": false, + "unlinkedCollapsed": true + }, + "icon": "links-coming-in", + "title": "Backlinks for Basics" + } + }, + { + "id": "65e2eda22f707e1d", + "type": "leaf", + "state": { + "type": "outgoing-link", + "state": { + "file": "Basics.md", + "linksCollapsed": false, + "unlinkedCollapsed": true + }, + "icon": "links-going-out", + "title": "Outgoing links from Basics" + } + }, + { + "id": "db4efa00f76686d8", + "type": "leaf", + "state": { + "type": "tag", + "state": { + "sortOrder": "frequency", + "useHierarchy": true, + "showSearch": false, + "searchQuery": "" + }, + "icon": "lucide-tags", + "title": "Tags" + } + }, + { + "id": "e6c157daa152715f", + "type": "leaf", + "state": { + "type": "all-properties", + "state": { + "sortOrder": "frequency", + "showSearch": false, + "searchQuery": "" + }, + "icon": "lucide-archive", + "title": "All properties" + } + }, + { + "id": "64a7b5799118e618", + "type": "leaf", + "state": { + "type": "outline", + "state": { + "file": "Basics.md", + "followCursor": false, + "showSearch": false, + "searchQuery": "" + }, + "icon": "lucide-list", + "title": "Outline of Basics" + } + } + ] + } + ], + "direction": "horizontal", + "width": 300, + "collapsed": true + }, + "left-ribbon": { + "hiddenItems": { + "switcher:Open quick switcher": false, + "graph:Open graph view": false, + "canvas:Create new canvas": false, + "daily-notes:Open today's daily note": false, + "templates:Insert template": false, + "command-palette:Open command palette": false, + "bases:Create new base": false + } + }, + "active": "4da918019b38eb09", + "lastOpenFiles": [ + "Basics.md", + "Welcome.md" + ] +} \ No newline at end of file diff --git a/Vulkan notes/Basics.md b/Vulkan notes/Basics.md new file mode 100644 index 0000000..d944403 --- /dev/null +++ b/Vulkan notes/Basics.md @@ -0,0 +1,6 @@ +`After following this tutorial, you could implement automatic resource management by writing C++ classes that acquire Vulkan objects in their constructor and release them in their destructor, or by providing a custom deleter to either std::unique_ptr or std::shared_ptr, depending on your ownership requirements. RAII is the recommended model for larger Vulkan programs, but for learning purposes it's always good to know what's going on behind the scenes.` + +- Vulkan objects are created directly with `vkCreateXXX` +- Vulkan objects are allocated with `vkAllocateXXX` +- `vkDestroyXXX` and `vkFreeXXX` to destroy objects +- diff --git a/Vulkan notes/Welcome.md b/Vulkan notes/Welcome.md new file mode 100644 index 0000000..f9bca28 --- /dev/null +++ b/Vulkan notes/Welcome.md @@ -0,0 +1,5 @@ +This is your new *vault*. + +Make a note of something, [[create a link]], or try [the Importer](https://help.obsidian.md/Plugins/Importer)! + +When you're ready, delete this note and make the vault your own. \ No newline at end of file