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