Jump to content
  • Advertisement


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


Derivation & friend classes on multiple files

This topic is 5398 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!