implemented vulkan instance creation
This commit is contained in:
parent
84ee267b5d
commit
89edee7249
11 changed files with 208 additions and 10 deletions
41
vk/platform.c
Normal file
41
vk/platform.c
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#define RGFW_VULKAN
|
||||
#define RGFW_IMPLEMENTATION
|
||||
#include "../rgfw.h"
|
||||
#include <vulkan/vulkan.h>
|
||||
#include "../core/log.h"
|
||||
|
||||
#ifdef PLATFORM_MACOS
|
||||
#include <vulkan/vulkan_macos.h>
|
||||
#include <vulkan/vulkan_metal.h>
|
||||
#endif
|
||||
|
||||
#include "../rendering/renderer.h"
|
||||
|
||||
/*
|
||||
* This function is the entrypoint for the whole
|
||||
* game. Its role is to initialize Vulkan, create
|
||||
* the renderer and start the game loop.
|
||||
*/
|
||||
int platform_run(i32 argc, u8 **argv)
|
||||
{
|
||||
(void) argc;
|
||||
(void) argv;
|
||||
|
||||
log_info("Using Vulkan as rendering backend.\n");
|
||||
|
||||
RGFW_window* win = RGFW_createWindow("topaz", 0, 0, 800, 600, RGFW_windowCenter | RGFW_windowNoResize | RGFW_windowHide);
|
||||
RGFW_window_show(win);
|
||||
RGFW_window_setExitKey(win, RGFW_escape);
|
||||
|
||||
struct renderer_context *context = renderer_context_init();
|
||||
|
||||
while (RGFW_window_shouldClose(win) == RGFW_FALSE) {
|
||||
RGFW_event event;
|
||||
while (RGFW_window_checkEvent(win, &event));
|
||||
}
|
||||
|
||||
RGFW_window_close(win);
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue