SFML community forums

Help => General => Topic started by: e_barroga on July 25, 2010, 12:02:34 pm

Title: Decoupled Engine Architecture
Post by: e_barroga on July 25, 2010, 12:02:34 pm
I am trying to develop an engine with a very decoupled architecture. This way, in the future I can easily replace the graphics component, input component, audio component, etc. easily.

The problem is that SFML's graphics and input seem to be closely coupled together.

Any ideas?
Title: Re: Decoupled Engine Architecture
Post by: Nexus on July 25, 2010, 01:24:07 pm
Quote from: "e_barroga"
The problem is that SFML's graphics and input seem to be closely coupled together.
Could you explain that in detail? I don't see why events/realtime input or graphics depend on each other.

Do you have an example?
Title: Decoupled Engine Architecture
Post by: Laurent on July 25, 2010, 01:36:00 pm
Quote
The problem is that SFML's graphics and input seem to be closely coupled together

No they are not ;)

Input is coupled with windows, which is perfectly normal because SFML provides window-based inputs, not global ones (ie. if you press a key, only the current focused window will receive the event).

I don't think it's a problem to separate graphics and input (well, windowing stuff) with SFML.
Title: Decoupled Engine Architecture
Post by: Recruit0 on July 26, 2010, 10:56:47 pm
I'm developing cpGUI and I haven't had any problems encapsulating media functionality (SFML).