init
This commit is contained in:
commit
444f800536
122 changed files with 17137 additions and 0 deletions
7
Chapter04/04_CubeMap/CMakeLists.txt
Normal file
7
Chapter04/04_CubeMap/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
cmake_minimum_required(VERSION 3.19)
|
||||
project(Chapter04)
|
||||
include(../../CMake/CommonMacros.txt)
|
||||
SETUP_APP(Ch04_04_CubeMap "Chapter 04")
|
||||
|
||||
target_include_directories(Ch04_04_CubeMap PUBLIC ${CMAKE_SOURCE_DIR})
|
||||
target_link_libraries(Ch04_04_CubeMap SharedUtils)
|
||||
30
Chapter04/04_CubeMap/src/main.cpp
Normal file
30
Chapter04/04_CubeMap/src/main.cpp
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#include "GLFW/glfw3.h"
|
||||
#include "LVK.h"
|
||||
#include "minilog/minilog.h"
|
||||
#include <memory>
|
||||
#include <shared/HelpersGLFW.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
minilog::initialize(nullptr, {.threadNames = false});
|
||||
|
||||
int width = 1280;
|
||||
int height = 720;
|
||||
|
||||
GLFWwindow *window = lvk::initWindow("Ch04_04: CubeMap", width, height);
|
||||
std::unique_ptr<lvk::IContext> ctx =
|
||||
lvk::createVulkanContextWithSwapchain(window, width, height, {});
|
||||
|
||||
while (!glfwWindowShouldClose(window)) {
|
||||
glfwPollEvents();
|
||||
glfwGetFramebufferSize(window, &width, &height);
|
||||
if (!width || !height)
|
||||
continue;
|
||||
lvk::ICommandBuffer &buf = ctx->acquireCommandBuffer();
|
||||
ctx->submit(buf, ctx->getCurrentSwapchainTexture());
|
||||
}
|
||||
|
||||
ctx.reset();
|
||||
glfwDestroyWindow(window);
|
||||
glfwTerminate();
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue