發表文章

目前顯示的是 9月, 2019的文章

C++ DirectX Draw Triangle

圖片
C++ DirectX Draw Triangle 1.Download Microsoft DirectX SDK (June 2010) Install it 2.  main.cpp // include the basic windows header files and the Direct3D header files #define UNICODE #include <windows.h> #include <windowsx.h> #include <d3d11.h> #include "G:\SDK\Microsoft DirectX SDK (June 2010)\Include\D3DX10.h" #include "G:\SDK\Microsoft DirectX SDK (June 2010)\Include\D3DX11.h" // include the Direct3D Library file #pragma comment (lib, "d3d11.lib") #pragma comment (lib, "G:\\SDK\\Microsoft DirectX SDK (June 2010)\\Lib\\x86\\d3dx11.lib") #pragma comment (lib, "G:\\SDK\\Microsoft DirectX SDK (June 2010)\\Lib\\x86\\d3dx10.lib") // define the screen resolution #define SCREEN_WIDTH  800 #define SCREEN_HEIGHT 600 // global declarations IDXGISwapChain *swapchain;             // the pointer to the swap chain interface ID3D11Device *dev;                     // the pointer to our Direct3D device in