Thread: DirectX Dilemma

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    87

    DirectX Dilemma

    I keep get an annoying error, now its probably really easy to solve but its late and I can't think.


    d:\hardball\projectfiles\hardball\hardball.h(29) : error C2143: syntax error : missing ';' before '*'
    d:\hardball\projectfiles\hardball\hardball.h(29) : error C2501: 'CPanel' : missing storage-class or type specifiers
    d:\hardball\projectfiles\hardball\hardball.h(29) : error C2501: 'm_pPanel1' : missing storage-class or type specifiers


    Which points to this section of code

    Code:
    #ifndef HARDBALL_H
    #define HARDBALL_H
    
    #include "window.h"
    #include "direct3d.h"
    #include "panel.h"
    
    #define SafeRelease(pInterface) if(pInterface != NULL) {pInterface->Release(); pInterface=NULL;}
    #define SafeDelete(pObject) if(pObject != NULL) {delete pObject; pObject=NULL;}
    
    class CHardball
    {
      public:
    	  CHardball();
    	  virtual ~CHardball();
    	  bool Init(CDirect3D* pD3DWindow,CWindow* pWindow,HINSTANCE hInstance);
    	  CDirect3D* getD3D();
    	  CWindow* getWindow();
    	  void GameLoop();
      protected:	  
    	  bool InitGame();
    	  bool InitD3D();
    	  void RenderText();
    	  void Render2D();
    	  void Render();
    	  void Setup2DCamera();
    	  CWindow* pWindow;
    	  CDirect3D* pD3D;
    	  CPanel* m_pPanel1;     //Here it is
    	  DWORD m_dwFrames;
    	  DWORD m_dwStartTime;
    	  DWORD m_dwEndTime;
    	  DWORD m_dwTotalPolygons;	
    };
    
    #endif
    I don't understand since I am including panel.h where CPanel is defined, CPanel looks like this

    Code:
    #ifndef PANEL_H
    #define PANEL_H
    
    #include "direct3d.h"
    #include "hardball.h"
    #include "window.h"
    
    #define PANEL_D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1)
    
    class CPanel
    {
      public:
    	  CPanel(LPDIRECT3DDEVICE8 pD3DDevice, int nWidth, int nHeight, int nScreenWidth,
    		      int nScreenHeight, DWORD dwColour = -1);
    	  virtual ~CPanel();
    	  bool setTexture(const char *szTextureFilePath, DWORD dwKeyColour = 0);
    	  DWORD Render();
    	  void moveTo(int x,int y);
      protected:
    	  bool createVertices();
    	  bool updateVertices();
    	  LPDIRECT3DDEVICE8 m_pD3DDevice;
    	  LPDIRECT3DVERTEXBUFFER8 m_pVertexBuffer;
    	  LPDIRECT3DTEXTURE8 m_pTexture;
    	  int iWidth;
    	  int iHeight;
    	  int iScreenWidth;
    	  int iScreenHeight;
    	  DWORD dwColour;
    	  struct PANEL_CUSTOMVERTEX
    	  {
    		float x, y, z;		//Position of vertex
    		DWORD colour;		//Colour of vertex
    		float u, v;			//Texture coordinates
    	  };
    };
    
    #endif
    [suttle hint]
    I've included the zipped project files should anyone be kind enough to take a look.[/suttle hint]
    PuterPaul.co.uk - Portfolio site

  2. #2
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    Try putting an identifier before you use that class. At the top of your Panel file, right above the class definition just add

    class CPanel;

    Hope that helps.

    Edit: In the hardball header file that is.
    "...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problems with my DirectX program
    By fighter92 in forum Game Programming
    Replies: 1
    Last Post: 01-23-2007, 06:28 PM
  2. Isometric Tile Engine using DirectX
    By Wraithan in forum Game Programming
    Replies: 3
    Last Post: 07-17-2006, 12:16 PM
  3. DirectSound header issues
    By dxfoo in forum C++ Programming
    Replies: 0
    Last Post: 03-19-2006, 07:16 PM
  4. DirectX - Starting Guide?
    By Zeusbwr in forum Game Programming
    Replies: 13
    Last Post: 11-25-2004, 12:49 AM
  5. Directx SDK Documentation
    By Zoalord in forum Game Programming
    Replies: 4
    Last Post: 05-08-2003, 06:07 AM