Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
SpinnerX authored Oct 8, 2024
2 parents 9a34229 + 8c21a5a commit a4e8f98
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
12 changes: 8 additions & 4 deletions engine3d/Core/Window.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@ namespace engine3d{
* @param IWidnowSpecified is what the user defines as their window.
* @note TODO --- Probably would have this be in helper_functions.h as this is an exposed to the API that uses may used to get the right API.
*/
/* template<typename UWindowSpecified, typename IWindowSpecified> */
/* static UWindowSpecified* As(IWindowSpecified){ */
/* return static_cast<UWindowSpecified *>(GetCurrentWindowAPI()); */
/* } */

VkSurfaceKHR& GetVkSurface();
GLFWwindow* GetNativeWindow();

template<typename UWindowSpecified, typename IWindowSpecified>
static UWindowSpecified* As(IWindowSpecified){
return static_cast<UWindowSpecified *>(GetCurrentWindowAPI());
}

bool IsActive() const;

Expand Down
9 changes: 3 additions & 6 deletions src/engine3d/Core/internal/VulkanCpp/Vulkan.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "EngineLogger.h"
#include <Core/internal/VulkanCpp/Vulkan.h>
#include <cstdio>

#include <vulkan/vulkan_core.h>
#include <vector>
#include <stdexcept>
Expand Down Expand Up @@ -43,8 +44,6 @@ namespace engine3d::vk{
static VkInstance g_Instance;

void Vulkan::InitializeVulkanCore(){
/* std::print("Initialization at {}",__FUNCTION__); */
printf("Initialization at InitializeVulkanCore()!!!!\n");
//! @note to initialize vulkan we need to first specify our application properties.
//! @note Initialize vulkan's instance information for instantiation.
VkApplicationInfo appInfo = {
Expand Down Expand Up @@ -72,10 +71,7 @@ namespace engine3d::vk{

VkResult res = vkCreateInstance(&createInfo, nullptr, &g_Instance);
if(res != VK_SUCCESS){
/* ConsoleLogError("vkCreateInstance errored message ===> {}", res); */
printf("%i\n", res);
printf("%s\n", res);
throw std::runtime_error("vkCreateInstance errored message ===> {}");
throw std::runtime_error("vkCreateInstance errored message ===> ");
}

if(g_Instance == VK_NULL_HANDLE){
Expand All @@ -94,4 +90,5 @@ namespace engine3d::vk{
}
return g_Instance;
}

};

0 comments on commit a4e8f98

Please sign in to comment.