diff --git a/.gitignore b/.gitignore index 0d6d5f8..e149c95 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ thirdparty/* *.ilk *.spv *.lib +/CppProperties.json diff --git a/include/basalt_context.h b/include/basalt_context.h deleted file mode 100644 index c79f49f..0000000 --- a/include/basalt_context.h +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once -#include - -namespace basalt -{ - class Context - { - - }; -} \ No newline at end of file diff --git a/src/basalt_context.cpp b/src/basalt_context.cpp deleted file mode 100644 index 28d4bb2..0000000 --- a/src/basalt_context.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "basalt_context.h" -#include "stdio.h" - -void test() -{ - printf("Hello, world!\n"); -} \ No newline at end of file diff --git a/src/basalt_window.cpp b/src/basalt_window.cpp deleted file mode 100644 index d5a17ea..0000000 --- a/src/basalt_window.cpp +++ /dev/null @@ -1,70 +0,0 @@ -#include "basalt_window.h" - -basalt::Window::Window(Window&& other) noexcept -{ - this->window = other.window; - this->window_title = other.window_title; - this->height = other.height; - this->width = other.width; - other.height = 0; - other.width = 0; - other.window = nullptr; - other.window_title = nullptr; -} - -basalt::Window& basalt::Window::operator=(Window&& other) noexcept -{ - this->~Window(); - this->window = other.window; - this->window_title = other.window_title; - this->height = other.height; - this->width = other.width; - other.height = 0; - other.width = 0; - other.window = nullptr; - other.window_title = nullptr; - return *this; -} - -basalt::Window::Window(uint16_t width, uint16_t height, const char* title) : - width(width), height(height), window_title(title) -{ - glfwInit(); - glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API); - glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE); - glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE); - this->window = glfwCreateWindow(width, height, title, nullptr, nullptr); -} - -basalt::Window::~Window(void) noexcept -{ - glfwDestroyWindow(this->window); -} - -void basalt::Window::swap(Window& other) -{ - { - uint16_t tmp = this->height; - this->height = other.height; - other.height = tmp; - tmp = this->width; - this->width = other.width; - other.width = tmp; - } - { - void* tmp_ptr = this->window; - this->window = other.window; - other.window = static_cast(tmp_ptr); - tmp_ptr = const_cast(this->window_title); - this->window_title = other.window_title; - other.window_title = static_cast(tmp_ptr); - } -} - -basalt::Window::operator GLFWwindow* (void) const noexcept -{ return this->window; } - -const bool basalt::Window::should_close(void) const noexcept -{ - return glfwWindowShouldClose(this->window); -}