Thread: DirectX Dilemma

  1. #1
    Registered User
    Join Date
    Mar 2002

    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

    #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
    	  virtual ~CHardball();
    	  bool Init(CDirect3D* pD3DWindow,CWindow* pWindow,HINSTANCE hInstance);
    	  CDirect3D* getD3D();
    	  CWindow* getWindow();
    	  void GameLoop();
    	  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;	
    I don't understand since I am including panel.h where CPanel is defined, CPanel looks like this

    #ifndef PANEL_H
    #define PANEL_H
    #include "direct3d.h"
    #include "hardball.h"
    #include "window.h"
    class CPanel
    	  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);
    	  bool createVertices();
    	  bool updateVertices();
    	  LPDIRECT3DDEVICE8 m_pD3DDevice;
    	  LPDIRECT3DVERTEXBUFFER8 m_pVertexBuffer;
    	  LPDIRECT3DTEXTURE8 m_pTexture;
    	  int iWidth;
    	  int iHeight;
    	  int iScreenWidth;
    	  int iScreenHeight;
    	  DWORD dwColour;
    		float x, y, z;		//Position of vertex
    		DWORD colour;		//Colour of vertex
    		float u, v;			//Texture coordinates
    [suttle hint]
    I've included the zipped project files should anyone be kind enough to take a look.[/suttle hint] - Portfolio site

  2. #2
    Registered User
    Join Date
    Apr 2002
    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