ErhanK Posted April 8, 2018 Share Posted April 8, 2018 Hello, I created a C++ project and I have "Game" class and "Player" class..App class is creating game class.Game class is creating Player class and player class is creating camera etc.. How i can access or reference context or window class in the player class? For example : i want to call window->GetMousePosition() in the player class. Quote Link to comment Share on other sites More sharing options...
Solution SpiderPig Posted April 8, 2018 Solution Share Posted April 8, 2018 Hi, you can call Window::GetCurrent () and Context:: GetCurrent(). To access the camera in all classes however, I create a global variable that each class can access. 2 Quote Link to comment Share on other sites More sharing options...
ErhanK Posted April 8, 2018 Author Share Posted April 8, 2018 It's working thank you Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted April 8, 2018 Share Posted April 8, 2018 your welcome Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.