GGym's Practice Notes

DirectX Setup / stdafx.h 구성하기 본문

DirectX

DirectX Setup / stdafx.h 구성하기

GGym_ 2020. 8. 12. 01:22

1. DirectX SDK 설치

https://www.microsoft.com/en-us/download/details.aspx?id=6812

 

DirectX SDK - (June 2010)

Download the complete DirectX SDK, which contains the DirectX Runtime and all DirectX software required to create DirectX compliant applications.

www.microsoft.com

S1023에러시 참조 https://support.microsoft.com/en-ca/help/2728613/s1023-error-when-you-install-the-directx-sdk-june-2010

 

https://support.microsoft.com/en-ca/help/2728613/s1023-error-when-you-install-the-directx-sdk-june-2010

Cookies are disabled Please enable cookies and refresh the page

support.microsoft.com

 

2. 프로젝트 생성 후 SDK 경로로 사용자 매크로 등록 (폴더 include, lib/x86)

3. VC++디렉터리에 등록한 매크로 라이브러리 추가

4. 미리 컴파일된 헤더파일 작성

#pragma once
// Window
#include <Windows.h>
#include <assert.h>

// STL
#include <string>
#include <vector>
#include <bitset>
#include <list>
#include <map>
#include <functional>
#include <mutex>

using namespace std;

// DirectX Library
#include <d3d11.h>
#include <D3DX11.h>
#include <D3DX10.h>
#include <D3DX10math.h>
#include <d3dx11effect.h>
#include <d3dcompiler.h>

#pragma comment(lib, "d3d11.lib")
#pragma comment(lib, "d3dx11.lib")
#pragma comment(lib, "d3dx10.lib")
#pragma comment(lib, "Effects11d.lib")
#pragma comment(lib, "d3dcompiler.lib")

// ImGui
#include <imgui.h>
#include <imguiDx11.h>
#pragma comment(lib, "imgui.lib")

// FrameWork

// Macro
#define SAFE_DELETE(p) { if(p) {delete(p); (p) = NULL;}}
#define SAFE_DELETE_ARRAY(p) { if(p) {delete[] (p); (p) = NULL;}}
#define SAFE_RELEASE(p) { if(p) {(p)->Release(); (p) = NULL;}}

typedef D3DXVECTOR3 Vector3;
typedef D3DXVECTOR2 Vector2;
typedef D3DXMATRIX Matrix;
typedef D3DXCOLOR Color;
typedef D3DXQUATERNION Quaternion;

// Extern Global
extern UINT Width;
extern UINT Height;

extern HWND Hwnd;
extern wstring Title;

// DXGI(DirectX Graphic Infrastructure) 그래픽스에 관련한 기초적인 기능 제공
// SwapChain 버퍼 포인터가 서로 교체되면서 화면을 구성
extern IDXGISwapChain* SwapChain;

// PC 자원 생성, CPU와 RAM의 영역 기능, 지원 점검과 자원 할당
extern ID3D11Device* Device;

// 실제 도화지 RTV -> HDC 의 역할
extern ID3D11RenderTargetView* RTV;
extern ID3D11Device* Device;