Pointers 语法错误:缺少'';在'之前*';创建用户定义的抽象类的指针对象时
我正在尝试为我定义的类“FeralScene”创建指针对象 但我一直遇到这样的错误“语法错误:在“*”之前缺少“;” 我不知道我的代码有什么问题。。。斯蒙能帮我一下吗Pointers 语法错误:缺少'';在'之前*';创建用户定义的抽象类的指针对象时,pointers,directx,syntax-error,abstract-class,Pointers,Directx,Syntax Error,Abstract Class,我正在尝试为我定义的类“FeralScene”创建指针对象 但我一直遇到这样的错误“语法错误:在“*”之前缺少“;” 我不知道我的代码有什么问题。。。斯蒙能帮我一下吗 /*********************************************************************** 2D Engine Header File File Name: FeralFramework File Desc: Header to the Main Framework fi
/***********************************************************************
2D Engine Header File
File Name: FeralFramework
File Desc: Header to the Main Framework file
************************************************************************/
#ifndef FERALFRAMEWORK_H
#define FERALFRAMEWORK_H
#pragma once
#include<Windows.h>
#include<d3d9.h>
#include<d3dx9.h>
#include<string>
#include <dinput.h>
#include"FeralScene.h"
#include"GraphicDevice.h"
#include "Stdinc.h"
LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);
class FeralFramework
{
public:
LPDIRECTINPUT8 inputDevice;
LPDIRECT3DDEVICE9 Device;
HWND WindowHandler;
HINSTANCE Instance;
FeralScene *CurrentScene,*PrevScene; // error occurs here
GraphicDevice graphicDevice;
static HWND StaticWindowHandle;
static IDirect3DDevice9 *GraphDevice;
int ScreenHeight;
int ScreenWidth;
bool IsFullScreen;
bool WindowCreation();
bool InitDirectx();
void MessageLoop();
void SetLighting();
void UpdateDrawLoopCallFunction();
void InitFrameWork();
void Render();
void initializeDirectInput();
//void Camera(int mx, int my);
void SceneSwitcher(FeralScene *SCENETOSWITCHTO);
// the FeralScene identifier error occurs here
FeralFramework();
FeralFramework(HINSTANCE Instance,int ScreenHeight,int ScreenWidth ,bool IsFullScreen,FeralScene *SentSceneObject );
// the FeralScene identifier error occurs here
FeralFramework(HINSTANCE Instance,FeralScene *SentSceneObject);
// the FeralScene identifier error occurs here
};
inline LRESULT CALLBACK WndProc(HWND WindowHandler,UINT Msg,WPARAM wparam,LPARAM lparam)
{
switch(Msg)
{
case WM_DESTROY:
PostQuitMessage(0);
return true;
default:
return DefWindowProc(WindowHandler,Msg,wparam,lparam);
}
}
#endif
我错过了什么?如有任何帮助,将不胜感激:(
这是FeralScene的代码
/***********************************************************************
2D Engine Header File
File Name: FeralScene
File Desc: Header to the FeralScene file
************************************************************************/
#pragma once
#include<d3dx9.h>
#pragma once
#include<Windows.h>
#include<d3d9.h>
#include<d3dx9.h>
#include"GraphicDevice.h"
#include "FeralFramework.h"
//#include "Vector.h"
class FeralScene
{
public:
HWND WindowHandler;
IDirect3DDevice9 *Device;
int BackBufferHeight;
int BackBufferWidth;
bool IsFullScreen,HasLoadedResources,HasUnloadedResources;
virtual void Initialize(FeralScene *SentSceneObject) =0;
virtual void Load(GraphicDevice graphicDevice) =0;
virtual void Update(GraphicDevice graphicDevice) =0;
virtual void Draw(GraphicDevice graphicDevice) =0;
virtual void Unload() =0;
virtual void Lighting()=0;
virtual void LoadAnim()=0;
virtual void UnloadAnim()=0;
};
/***********************************************************************
二维引擎头文件
文件名:FeralScene
filedesc:FeralScene文件的头文件
************************************************************************/
#布拉格语一次
#包括
#布拉格语一次
#包括
#包括
#包括
#包括“GraphicDevice.h”
#包括“FeralFramework.h”
//#包括“Vector.h”
蕨类
{
公众:
窗口处理器;
IDirect3DDevice9*设备;
int BackBufferHeight;
int BackBufferWidth;
bool是全屏的,有加载的资源,有未加载的资源;
虚拟空初始化(FeralScene*SentSceneObject)=0;
虚拟空隙荷载(GraphicDevice)=0;
虚拟无效更新(GraphicDevice-GraphicDevice)=0;
虚拟虚空绘制(GraphicDevice GraphicDevice)=0;
虚空卸载()=0;
虚拟虚空照明()=0;
虚拟void LoadAnim()=0;
虚拟void UnloadAnim()=0;
};
您在feralscene.h中包含FeralFrameWork.h,但它还不知道feralscene.h。您可以在FeralFrameWork.h中实现正向减速。此外,我建议在feralscene.h中使用适当的宏,以避免多次减速
由于您在标头中使用指针类型,因此向前删除将解决此问题
// this should be before the class FeralFramework
class FeralScene;
你能把费拉尔森的代码粘贴到我的描述中吗兄弟…:(有什么想法吗?:(谢谢兄弟:D:D你的建议帮我解决了这个问题:D:D碰撞!)
// this should be before the class FeralFramework
class FeralScene;