nono , u dont understand thats not what im trying to do, i will post the real code now:
thats how the CGDisplay looks like:
#ifndef __CGDISPLAY_H#define __CGDISPLAY_H#include "General.h"#include "CGSurface.h" /* THATS THE PROBLEM */class CGDisplay { friend class CGSurface; friend class CG4pPolygon; private: // ddraw stuff LPDIRECTDRAW7 lp_ddraw_obj; LPDIRECTDRAWSURFACE7 lp_primary; LPDIRECTDRAWSURFACE7 lp_back; DDSCAPS2 ddscaps2; DDSURFACEDESC2 ddsd2; DDBLTFX ddbltfx; // d3d stuff LPDIRECT3D7 lp_d3d_obj; LPDIRECT3DDEVICE7 lp_d3d_device; D3DVIEWPORT7 d3d_viewport; // screen size & bpp int X; int Y; int bpp; LPDIRECTDRAW7 GetDDrawObj(void); LPDIRECTDRAWSURFACE7 GetBackBuffer(void); LPDIRECT3D7 GetD3dObj(void); LPDIRECT3DDEVICE7 GetD3dDevice(void); public: CGDisplay(); ~CGDisplay(); HRESULT ClearD3dDevice(D3DCOLOR color); HRESULT BeginScene(void); HRESULT EndScene(void); HRESULT InitDisplay(int SWidth,int SHeight,int BPP,HWND hWnd); HRESULT Clear(DWORD color); HRESULT WriteText(int x,int y,COLORREF tcolor,COLORREF bgcolor,char *text); HRESULT Flip(void); HRESULT Restore(void); void EnableAlphaBlending(void); void DisableAlphaBlending(void); void EnableBLinearFiltering(void); void DisableBLinearFiltering(void); void EnableTextureColorKey(void); void DisableTextureColorKey(void); int GetScreenWidth(void); int GetScreenHeight(void); int GetBpp(void); HRESULT SetRenderTexture(LPCGSurface lp_texture);};typedef CGDisplay *LPCGDisplay;#endif[/source]and thats how the CGSurface looks like:[source]#ifndef __CGSURFACE_H#define __CGSURFACE_H#include "General.h"#include "CGDisplay.h"#include "ddutil.h"class CGSurface { friend class CG4pPolygon; private: LPDIRECTDRAWSURFACE7 lp_surface; DDSURFACEDESC2 ddsd2; D3DDEVICEDESC7 device_desc; DDBLTFX ddbltfx; HBITMAP hbm; int surface_width; int surface_height; char *bitmap_name; LPDIRECTDRAWSURFACE7 GetSurface(void); public: CGSurface(); ~CGSurface(); BOOL b_d3d_tex; HRESULT CreateSurface(LPCGDisplay lp_display,int width,int height,bool video_mem); HRESULT CreateSurface(LPCGDisplay lp_display,int width,int height); HRESULT LoadBitmap(char *filename); HRESULT BltFast(LPCGDisplay lp_display,int x,int y,bool colorkey); HRESULT SetTransColorKey(COLORREF color); HRESULT Clear(DWORD color); HRESULT Restore(void); int GetHeight(void); int GetWidth(void);};typedef CGSurface *LPCGSurface;#endif
u see when im adding the ' #include "CGSurface.h" ' , then im geting the errors , im not trying to define a pointer to CGSurface in the CGDisplay class , im just want CGDisplay class to recornize the CGSurface class
*************************
"Everything you know is wrong" - Bono
*************************
- Goblineye Entertainment
Edited by - xeno on October 8, 2000 6:31:32 AM