Jump to content
  • Advertisement

Archived

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

Tona

Viewport and Camera

This topic is 5991 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

I have a question about viewports and cameras. I have a CWindow class and a CCamera class: the first one to manage viewports and the second for cameras, of course.. Now, in a poroject I can have more windows (rarely) and more cameras (often): I can''t find a good solution to releate these two classes together; pratically when I do things like to change the resolution, to resize a window and so on, it''s better I set these properties in CWindow (something like Window.Resize(x, y)), and when I change things like perspective, fov, clipping planes, etc.. I set the CCamera class. So CCamera must always know the size of the viewport, and If i want to maintain these two classes separated, every time I resize a window I should set both classes separately: Window.Resize(x, y); Camera.SetViewport(x, y); ... and this is orrible So I should create some releations between these two classes so when I update the viewport automatically every camera knows the new dimensions. I don''t think that''s a good idea to let the camera update the window, because these are two different entities, but at the same time, let the window update the camera has no sense, because the window is an object of the system and the camera deals with the graphic engine... I hope the problem is clear and I''d like to know how this problem is generally solved. Thanks.

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!