Error in class def, Type Name Expected

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Myth
Posts: 81
Joined: Wed Apr 13, 2005 5:48 pm

Error in class def, Type Name Expected

Post by Myth »

Code: Select all

//! Renderer for normal maps
class CD3D8NormalMapRenderer : public CD3D8ShaderMaterialRenderer, IShaderConstantSetCallBack

Code: Select all

[C++ Error] CD3D8NormalMapRenderer.h(24): E2303 Type name expected
I use Borland C++ Builder.
And I get this error when trying to compile irrlicht 0.9 with directx.
I can compile it withouth dx though.
But when trying to compile irrlicht 0.10 hell breaks lose :evil:
So if anyone got that to work then please tell me how-to.

How must I put the typename in there?

Thanks,
- Myth
JOIN MY (100mbs 2x 3GHZ CPU) IRRLICHT FORUMS
http://irrlicht.halo4you.com/forums/
For all your programming quesitons and irrlicht ones!.

My fan site: http://www.halo-center.com
after-life
Posts: 69
Joined: Wed Mar 30, 2005 8:16 am
Location: Keerbergen, Belgium

Post by after-life »

use:

void IShaderConstantSetCallBack

or whatever variable it is going to return
Myth
Posts: 81
Joined: Wed Apr 13, 2005 5:48 pm

Post by Myth »

It's still gives the error, and ads identifier expected error.

CD3D8ShaderMaterialRenderer.h

Code: Select all

#include <d3d8.h>
#include <D3dx8core.h>

#pragma comment (lib, "d3dx8.lib")

#include "IMaterialRenderer.h"
#include "S3DVertex.h"

namespace irr
{
namespace video  
{

class IVideoDriver;
class IShaderConstantSetCallBack;
class IMaterialRenderer;

//! Class for using vertex and pixel shaders with D3D9
class CD3D8ShaderMaterialRenderer : public IMaterialRenderer
{
public:

	//! Public constructor
	CD3D8ShaderMaterialRenderer(IDirect3DDevice8* d3ddev, video::IVideoDriver* driver, 
		s32& outMaterialTypeNr, const c8* vertexShaderProgram, const c8* pixelShaderProgram,
		IShaderConstantSetCallBack* callback, IMaterialRenderer* baseMaterial);

	//! Destructor
	~CD3D8ShaderMaterialRenderer();

	virtual void OnSetMaterial(video::SMaterial& material, const video::SMaterial& lastMaterial,
		bool resetAllRenderstates, video::IMaterialRendererServices* services);

	virtual void OnUnsetMaterial();

	virtual bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype);

	//! Returns if the material is transparent.
	virtual bool isTransparent();

protected:

	//! constructor only for use by derived classes who want to
	//! create a fall back material for example.
	CD3D8ShaderMaterialRenderer(IDirect3DDevice8* d3ddev,
								video::IVideoDriver* driver, 
								IShaderConstantSetCallBack* callback,
								IMaterialRenderer* baseMaterial);

	void init(s32& outMaterialTypeNr, const c8* vertexShaderProgram, const c8* pixelShaderProgram,
		E_VERTEX_TYPE type);
	bool createPixelShader(const c8* pxsh);
	bool createVertexShader(const char* vtxsh, E_VERTEX_TYPE type);

	IDirect3DDevice8* pID3DDevice;
	video::IVideoDriver* Driver;
	IShaderConstantSetCallBack* CallBack;
	IMaterialRenderer* BaseMaterial;

	DWORD VertexShader;
	DWORD OldVertexShader;
	DWORD PixelShader;
};


} // end namespace video
} // end namespace irr



and

Code: Select all

#include <d3d8.h>

#include "CD3D8ShaderMaterialRenderer.h"
#include "IShaderConstantSetCallBack.h"

namespace irr
{
namespace video  
{

//! Renderer for normal maps
class CD3D8NormalMapRenderer : public CD3D8ShaderMaterialRenderer, IShaderConstantSetCallBack
{
public:

	CD3D8NormalMapRenderer(
		IDirect3DDevice8* d3ddev, video::IVideoDriver* driver, 
		s32& outMaterialTypeNr, IMaterialRenderer* baseMaterial);
	~CD3D8NormalMapRenderer();

	//! Called by the engine when the vertex and/or pixel shader constants for an
	//! material renderer should be set.
	virtual void OnSetConstants(IMaterialRendererServices* services);

	bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype);

private:

	//! stores if this shader compiled the shaders and is 
	//! allowed to delete them again. D3D8 lacks reference counting
	//! support for shaders.						
	bool CompiledShaders; 

};

} // end namespace video
} // end namespace irr
JOIN MY (100mbs 2x 3GHZ CPU) IRRLICHT FORUMS
http://irrlicht.halo4you.com/forums/
For all your programming quesitons and irrlicht ones!.

My fan site: http://www.halo-center.com
Post Reply