fix some build errors or something
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "Gryphn/gryphn.h"
|
||||
#include <iostream>
|
||||
#include "stdlib.h"
|
||||
#include "glfw/include/GLFW/glfw3.h"
|
||||
|
||||
#define CONCAT_IMPL(a, b) a##b
|
||||
#define CONCAT(a, b) CONCAT_IMPL(a, b)
|
||||
@@ -11,6 +12,7 @@
|
||||
<< ": " << CONCAT(res, __LINE__) << "\n"; \
|
||||
}
|
||||
|
||||
GLFWwindow* window;
|
||||
gnVersion version = gnCreateVersion(1, 0, 0);
|
||||
gnInstance instance;
|
||||
gnDevice device;
|
||||
@@ -61,13 +63,28 @@ void createDevice() {
|
||||
}
|
||||
|
||||
int main() {
|
||||
if (!glfwInit()) {
|
||||
std::cout << "Failed to init GLFW\n";
|
||||
return -1;
|
||||
}
|
||||
|
||||
window = glfwCreateWindow(640, 360, "Chemistry Rendering App", nullptr, nullptr);
|
||||
if (!window) {
|
||||
std::cerr << "Failed to create window\n";
|
||||
return -1;
|
||||
}
|
||||
|
||||
try {
|
||||
createInstance();
|
||||
createDevice();
|
||||
while (!glfwWindowShouldClose(window)) {
|
||||
glfwPollEvents();
|
||||
}
|
||||
} catch (const std::exception& e) {
|
||||
std::cerr << "Caught Exception: " << e.what() << "\n";
|
||||
return 0;
|
||||
}
|
||||
glfwDestroyWindow(window);
|
||||
gnDestroyDevice(&device);
|
||||
gnDestroyInstance(&instance);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user