나는 이러한 헤더 실행하려고 :구문 오류 : 누락; 전 *
#pragma once
#include "Direct3D.h"
class Triangle
{
public:
Triangle();
~Triangle();
bool Initialize(ID3D11Device*);
void Shutdown();
ID3D11Buffer* g_pVertexBuffer;
ID3D11Buffer* g_pIndexBuffer;
UINT g_indexCount;
};
Direct3D.h
#pragma once
//Library Linker
#pragma comment(lib, "d3d11.lib")
#pragma comment(lib, "dxgi.lib")
//Includes
#include <d3d11.h>
//My Includes
#include "SimpleShaderRessource.h"
class Direct3D
{
public:
Direct3D();
~Direct3D();
bool Initialize(HWND);
bool Run();
void Shutdown();
private:
public:
private:
ID3D11Device* g_pDevice;
ID3D11DeviceContext* g_pDeviceContext;
IDXGISwapChain* g_pSwapChain;
ID3D11RenderTargetView* g_pRenderTargetView;
SimpleShaderRessource* g_pSimpleShader;
};
SimpleShaderResource.h
#pragma once
//My Includes
#include "Direct3D.h"
//Library Inludes
#include "CGE_Lib.h"
//Models
#include "Triangle.h"
struct SimpleShaderVertex
{
CGE::Vector3D position;
//CGE::Color color;
};
class SimpleShaderResource
{
public:
SimpleShaderResource();
~SimpleShaderResource();
bool Initialize(ID3D11Device*, ID3D11DeviceContext*, HWND, WCHAR*, WCHAR*);
bool Render();
void Shutdown();
private:
void OutputShaderErrorMessage(ID3DBlob*, HWND, WCHAR*);
public:
ID3D11InputLayout* g_pLayout;
Triangle* g_pModel;
};
Triangle.h을
을
내가 VS2015에서 이러한 오류 가지고 :
C2143 syntax error: missing ';' before '*' simpleshaderresource.h 34
C4430 missing type specifier - int assumed. Note: C++ does not support default-int simpleshaderresource.h 34
C2238 unexpected token(s) preceding ';' simpleshaderresource.h 34
C2143 syntax error: missing ';' before '*' direct3d.h 34
C4430 missing type specifier - int assumed. Note: C++ does not support default-int direct3d.h 34
C2238 unexpected token(s) preceding ';' direct3d.h 34
을하지만 그 구문 오류에서 온해야 어디서 볼 수 없습니다. #pragma once
은 순환 포함을 방지해야하므로 잘못되었습니다.
질문 본문을 빗나게하십시오 – Trix