CONGE-2 BUG with windows
This commit is contained in:
parent
f64bb01ab2
commit
b253c08bf8
@ -31,6 +31,6 @@ target_link_libraries(${PROJECT_NAME} SDL2::SDL2 glm::glm Vulkan::Vulkan)
|
||||
|
||||
target_precompile_headers(
|
||||
${PROJECT_NAME}
|
||||
PUBLIC
|
||||
PRIVATE
|
||||
src/ConjureEngine/PCH.h
|
||||
)
|
||||
@ -20,6 +20,9 @@
|
||||
// VULKAN
|
||||
#include "vulkan/vulkan.h"
|
||||
#include "vulkan/vulkan_core.h"
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include "vulkan/vulkan_metal.h"
|
||||
#elifdef __WINDOWS__
|
||||
#include "vulkan/vulkan_win32.h"
|
||||
#endif
|
||||
@ -4,10 +4,6 @@
|
||||
|
||||
#include "VulkanContext.h"
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define VK_USE_PLATFORM_METAL_EXT
|
||||
#endif
|
||||
|
||||
namespace ConjureEngine {
|
||||
VulkanContext::VulkanContext(SDL_Window* window, const VkApplicationInfo& appInfo) {
|
||||
// LOAD THE EXTENSIONS
|
||||
|
||||
@ -35,4 +35,13 @@ namespace ConjureEngine {
|
||||
SDL_Log("Cleaned up with errors: %s", SDL_GetError());
|
||||
}
|
||||
|
||||
const SDL_Window* Window::GetWindow() const
|
||||
{
|
||||
return m_window;
|
||||
}
|
||||
|
||||
const VulkanContext * Window::GetVulkanContext() const
|
||||
{
|
||||
return m_vulkanContext;
|
||||
}
|
||||
} // ConjureEngine
|
||||
@ -7,7 +7,8 @@
|
||||
#include "PCH.h"
|
||||
#include "VulkanContext.h"
|
||||
|
||||
namespace ConjureEngine {
|
||||
namespace ConjureEngine
|
||||
{
|
||||
struct WindowInfo {
|
||||
std::string title;
|
||||
int x;
|
||||
@ -16,18 +17,20 @@ namespace ConjureEngine {
|
||||
int height;
|
||||
};
|
||||
|
||||
class Window {
|
||||
public:
|
||||
explicit Window(const WindowInfo& windowInfo);
|
||||
~Window();
|
||||
class Window {
|
||||
public:
|
||||
explicit Window(const WindowInfo &windowInfo);
|
||||
|
||||
const std::shared_ptr<SDL_Window>& GetWindow() const;
|
||||
const std::shared_ptr<VulkanContext>& GetVulkanContext() const;
|
||||
private:
|
||||
public:
|
||||
private:
|
||||
SDL_Window* m_window;
|
||||
VulkanContext* m_vulkanContext;
|
||||
};
|
||||
~Window();
|
||||
|
||||
} // ConjureEngine
|
||||
const SDL_Window *GetWindow() const;
|
||||
|
||||
const VulkanContext *GetVulkanContext() const;
|
||||
|
||||
private:
|
||||
public:
|
||||
private:
|
||||
SDL_Window *m_window;
|
||||
VulkanContext *m_vulkanContext;
|
||||
};
|
||||
} // ConjureEngine
|
||||
|
||||
@ -5,10 +5,14 @@ set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
add_executable(${PROJECT_NAME} src/main.cpp
|
||||
src/Demo1.cpp
|
||||
src/Demo1.h)
|
||||
src/Demo1.h
|
||||
)
|
||||
|
||||
target_link_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/ConjureEngine)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS} ConjureEngine)
|
||||
find_package(SDL2 REQUIRED)
|
||||
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE include)
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/ConjureEngine/src)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} SDL2::SDL2 ConjureEngine)
|
||||
@ -5,13 +5,20 @@
|
||||
#include "Demo1.h"
|
||||
#include "ConjureEngine/ConjureEngine.h"
|
||||
|
||||
namespace Demo1 {
|
||||
Demo1::Demo1(): ConjureEngine::Application(
|
||||
static ConjureEngine::ApplicationInfo appInfo = ConjureEngine::ApplicationInfo{
|
||||
{
|
||||
{"Demo1", 0, 0, 1920, 1080}
|
||||
ConjureEngine::WindowInfo{
|
||||
"Demo1",
|
||||
0,
|
||||
0,
|
||||
1920,
|
||||
1080
|
||||
}
|
||||
}
|
||||
) {
|
||||
}
|
||||
};
|
||||
|
||||
namespace Demo1 {
|
||||
Demo1::Demo1(): ConjureEngine::Application(appInfo) {}
|
||||
|
||||
|
||||
int Demo1::Run() const {
|
||||
@ -35,8 +42,6 @@ namespace Demo1 {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Demo1::Tick(double deltaTime) const {
|
||||
|
||||
}
|
||||
void Demo1::Tick(double deltaTime) const {}
|
||||
|
||||
} // Demo1
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
//
|
||||
///
|
||||
// Created by Jimmy Tremblay-bernier on 2024-11-22.
|
||||
//
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
#include "ConjureEngine/ConjureEngine.h"
|
||||
#include "Demo1.h"
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
Demo1::Demo1 app;
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
const Demo1::Demo1 app;
|
||||
|
||||
return app.Run();
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user