001. Windows Environment Vulkan Learning notes Starter

Source: Internet
Author: User

Background: As the company needs to use C + + to reconstruct existing projects, I have been engaged in the nearly 6 years of C # Discovery needs to fast to C + +, but read too much to learn the content can not remember, so intends to start writing something from Vulkan.

Why choose Vulkan instead of OpenGL or something? 1, because personal feeling Vulkan will replace OpenGL in the next few years, will be good for their future development 2, because itself is to learn C + + No need to tangle this thing is the current hot.

Ready to write what: 1, to achieve some simple model loading texture mapping, light reflection, such as 2, simple engine, skeletal animation and so on.

Progress:

First, the environment

required material, VULKANSDK,GLFW,GLM

1. Download the installation vulkansdk, download the Windows version

2. Download GLFW Download Win32 Place the State Library Glfw3.lib, Glfw3dll.lib, and dynamic library Glfw3.dll into the corresponding directory of VULKANSDK in Third-party installation directory respectively.

3. VULKANSDK currently contains GLM in Third-part | The Include directory. If you need the latest version, you can download GML

These template files in the SDK directory are copied to the VS2017 template directory, for example, otherwise the template will not appear when it is created.

To create a new test program from the Vulkan template, note that after the new project is created, Vulkan vs template automatically creates a program based on the SDL window, where you can remove or replace the test code below.

Create a new test C + + file and add the following test code.

#define Glfw_include_vulkan#include <GLFW/glfw3.h> #define Glm_force_radians#define glm_force_depth_zero_to_ One#include <glm/vec4.hpp> #include <glm/mat4x4.hpp> #include <iostream>int main () {    glfwinit () ;    Glfwwindowhint (Glfw_client_api, GLFW_NO_API);    glfwwindow* window = Glfwcreatewindow ("Vulkan window", nullptr, nullptr);    uint32_t extensioncount = 0;    Vkenumerateinstanceextensionproperties (nullptr, &extensioncount, nullptr);    Std::cout << extensioncount << "extensions supported" << Std::endl;    GLM::MAT4 Matrix;    GLM::VEC4 Vec;    Auto test = Matrix * VEC;    while (!glfwwindowshouldclose (window)) {        glfwpollevents ();    }    Glfwdestroywindow (window);    Glfwterminate ();    return 0;}

You will encounter compilation error GLFW, and now add a specific library reference.

Run the program again, congratulations you can see the first Vulkan program running up.

001. Windows Environment Vulkan Learning notes Starter

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.