This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
#include <queue> | |
#include <thread> | |
#include <mutex> | |
#include <condition_variable> | |
#include <future> | |
#include <functional> | |
class ThreadPool | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main(){SDL_Init(SDL_INIT_VIDEO); | |
void*window=SDL_CreateWindow("Hello Triangle", 800, 600, SDL_WINDOW_VULKAN),*instanceExtensions,*instanceExtensionCount=new uint32_t,*queueFamily=new uint32_t,*imageIndex=new uint32_t,*count=new uint32_t,*queueFamilies,*formats,*images,*instance,*surface,*physicalDevice,*device,*queue,*swapchain,*renderPass,*pipelineLayout,*pipeline,*fence,*imageView,*framebuffer,*cmdPool,*cmd,*event=new SDL_Event; | |
(const char*const*&)instanceExtensions=SDL_Vulkan_GetInstanceExtensions((uint32_t*)instanceExtensionCount); | |
vkCreateInstance(new VkInstanceCreateInfo{.sType=VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,.pApplicationInfo=new VkApplicationInfo{.sType=VK_STRUCTURE_TYPE_APPLICATION_INFO,.apiVersion=VK_API_VERSION_1_3,},.enabledExtensionCount=*(uint32_t*)instanceExtensionCount,.ppEnabledExtensionNames=(const char**)instanceExtensions,},nullptr,(VkInstance*)&instance); | |
SDL_Vulkan_CreateSurface((SDL_Window*)window, (VkInstance)instance,nullptr,(VkSurfaceKHR*)&surface); | |
vkEnumeratePhysicalDev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-------------------------------------------------------------------------------- | |
-- Graphics | |
-------------------------------------------------------------------------------- | |
Vulkan | |
**** TL;DR - Getting Started **** | |
1) VK Tutorial: https://vulkan-tutorial.com/ | |
2) Sync blog post: http://themaister.net/blog/2019/08/14/yet-another-blog-explaining-vulkan-synchronization/ | |
3) VK Lecture Series: https://www.youtube.com/watch?v=tLwbj9qys18&list=PLmIqTlJ6KsE1Jx5HV4sd2jOe3V1KMHHgn | |
4) VK Guide: https://vkguide.dev/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <GLFW/glfw3.h> | |
#include <glad/gl.h> | |
int main() | |
{ | |
glfwInit(); | |
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); | |
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); | |
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); | |
auto window = glfwCreateWindow(800, 600, "Test", nullptr, nullptr); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ImGuiBackend | |
{ | |
ImGuiContext* imguiCtx = {}; | |
ImGuiContext* lastImguiCtx = {}; | |
Context* ctx = {}; | |
VkRenderPass renderPass = {}; | |
std::vector<VkFramebuffer> framebuffers; | |
VkDescriptorPool descriptorPool = {}; | |
VkSwapchainKHR lastSwapchain = {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vulkan/vulkan.h> | |
#include <GLFW/glfw3.h> | |
#include <glslang/Public/ShaderLang.h> | |
#include <glslang/Public/ResourceLimits.h> | |
#include <glslang/SPIRV/GlslangToSpv.h> | |
#include <array> | |
#include <iostream> | |
#include <vector> | |
template<class T> T* Temp(T&& v) { return &v; } | |
template<typename Container, typename Fn, typename ... Args> |