2024-08-25 11:29:09 -06:00
|
|
|
#define GLFW_INCLUDE_VULKAN
|
|
|
|
|
#include <GLFW/glfw3.h>
|
|
|
|
|
|
|
|
|
|
#include <vulkan/vulkan.h>
|
|
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
#include <stdexcept>
|
|
|
|
|
#include <cstdlib>
|
|
|
|
|
|
|
|
|
|
class HelloTriangleApplication {
|
|
|
|
|
public:
|
|
|
|
|
void run() {
|
2024-08-25 15:42:07 -06:00
|
|
|
initVulkan();
|
2024-08-25 11:29:09 -06:00
|
|
|
initWindow();
|
|
|
|
|
mainLoop();
|
|
|
|
|
cleanup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void initWindow() {
|
|
|
|
|
glfwInit();
|
|
|
|
|
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
|
|
|
|
|
glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE);
|
|
|
|
|
GLFWwindow* window;
|
|
|
|
|
window = glfwCreateWindow(800, 600, "Vulkan", nullptr, nullptr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void initVulkan() {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void mainLoop() {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void cleanup() {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
|
HelloTriangleApplication app;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
app.run();
|
|
|
|
|
} catch (const std::exception& e) {
|
|
|
|
|
std::cerr << e.what() << std::endl;
|
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-25 15:42:07 -06:00
|
|
|
std::cout << "Success!!!\n";
|
2024-08-25 11:29:09 -06:00
|
|
|
return EXIT_SUCCESS;
|
|
|
|
|
}
|