42 lines
806 B
C++
42 lines
806 B
C++
#include"VK.h"
|
|
#include"VKInstance.h"
|
|
#include"VKSurface.h"
|
|
#include"VKDevice.h"
|
|
#include"VKCommandBuffer.h"
|
|
#include"Window.h"
|
|
|
|
using namespace hgl;
|
|
using namespace hgl::graph;
|
|
|
|
int main(int,char **)
|
|
{
|
|
Window *win=CreateRenderWindow(OS_TEXT("VulkanTest"));
|
|
|
|
win->Create(1280,720);
|
|
|
|
vulkan::Instance inst(U8_TEXT("VulkanTest"),win);
|
|
|
|
if(!inst.Init())
|
|
{
|
|
delete win;
|
|
return(-1);
|
|
}
|
|
|
|
vulkan::Surface *surface = inst.CreateSurface();
|
|
|
|
const ObjectList<vulkan::PhysicalDevice> &device_list=inst.GetDeviceList();
|
|
|
|
vulkan::PhysicalDevice *pd=device_list[0];
|
|
|
|
vulkan::Device *dev=pd->CreateGraphicsDevice();
|
|
|
|
vulkan::CommandBuffer *cmd_buf=dev->CreateCommandBuffer();
|
|
|
|
delete surface;
|
|
delete cmd_buf;
|
|
delete dev;
|
|
delete win;
|
|
|
|
return 0;
|
|
}
|