Archived

This topic is now archived and is closed to further replies.

Jacob84

Derivation & friend classes on multiple files

Recommended Posts

Jacob84    122
Hello! I''m making a little effort in order to clarify my base OpenGL software (Just a software that can load textures, represent 3D Studio max files...). I have created a CWindow class, wich makes all the work registering, creating and showing the window (FullScreen, window, color depth). Now I would like to use other class (Let''s name it COpenGL). I have thought that it could be a good oportunity of learning derivation (I hope is derivation like it''s called in english :D). I have been studing the theory, but I have a practical problem (The same if I try declaring friend the OpenGL class). This is the struct of the code Tester.cpp (Main here) CWindow.cpp CWindow.h COpenGL.cpp COpenGL.h Obviously, the COpenGL class must access to the info declared protected in the CWindow class. The CWindow object has been declared "global" like that: CWindow * Window; The problem is, that in the COpenGL.h & .cpp compiler doesn''t ''know'' vars that are members of CWindow. Is there a method in order to COpenGL can see CWindow avoiding multiple declaration problems??? I''m a lot confused...and I don''t know if I had explained correctly. Thanks just for reading, Jacob.

Share this post


Link to post
Share on other sites