Advertisement Jump to content
Sign in to follow this  
Gasimzada

Is RenderWindow a part of the Graphics?

This topic is 1874 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 had this question for a while, but I was too unmotivated to ever finish a game. Now, I have progressed a lot and I have come to a point where its important for me to know. Now I have Window System, Input System, and Graphics System separate (I am using SFML btw). It has become very hard to have the relationship between Window System and Graphics System separately. So, I want to know if I'm doing something wrong or they should be merged for efficiency.

Share this post


Link to post
Share on other sites
Advertisement

It's really just glue-code between two systems. You'll always have that kind of thing.

 

Arguably it belongs in neither system: It's application code, whereas your systems are library code.

 

Imagine if you packaged up your windowing system into a library to be used in non-gfx projects, you wouldn't want to carry RenderWindow and all the dependent graphics system stuff with it. The same can be said of your graphics system, it can exist completely oblivious to the concept of windows.

 

All that said, you do often see the two lumped together. They are both concerned with the presentation of data after-all.

 

Food for thought: Windows (or their event loops rather) are usually also responsible for gathering input. So they will also tie in with the input-system. Does that mean you have a separate InputWindow? If so do you manage to achieve rendering and input on the same window? Perhaps you have a RenderAndInputWindow for that?

 

Offhand I would probably just have a GameWindow in application code (or high-level utility library), which ties together the windowing, rendering, input-handling and game-loop processing.

 

 

Share this post


Link to post
Share on other sites

Thank you for the info! The way I deal with it now, is that the graphics system only holds the "graphics context" of the window system, and since I am using SFML for my window system, I keep a window handle in the input system to be able to receive poll requests out of it. 

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net 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!