Advertisement Jump to content


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


Viewport and Camera

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

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!