Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 17 Dec 2012
Offline Last Active Dec 25 2012 10:06 PM

Topics I've Started


24 December 2012 - 01:38 AM

Hello Citizens!


Well, I'm having trouble with _SECURE_SCL configurations.


I'm using Visual Studio 2012 and have a C++ project with SFML 2.0 and Assimp.


Assimp says that I should have these flags set, which I did:



Wich is great because I don't want this stuff getting my code slow. But then I have to recompile SFML with these flags, so KernelBase.dll stop yelling access violations exceptions. But I, already set these:
add_definitions( -D_SECURE_SCL=0 )
add_definitions( -D_HASITERATOR_DEBUGGING=0 )
In the CMakeLists.txt and verified their existence in the VS Solution, but the error persists. It start yelling when I create an window.
Could it be a problem in an SFML depedency? So I should recompile ALL the dependencies of ALL libraries that I use recursively?
Am I forgetting something?


I've read in an old thread that I could use #pragma detect_mismatch to pop some link errors when mismatch occurs, but I'm not sure where to put it.


Any help and insight is appreciated!



C++ Engine Layout

17 December 2012 - 11:04 PM

Hello citizens!

I'm finally writing an simple Engine in C++ to get practice in Computer Graphics, but anyway, my concern now is the Design of the Engine itself.
At first, I thought a simple design: an Engine baseclass that the Game class would derive. The Engine class would have an bunch of pointer to other modules, such as Configs, Logs, Graphics, Files, Managers and all sort of things. Then, the Game class would derive access to it.
The problems comes when Modules have to interact with other Modules. The solution seems to give each module a reference to the Engine in the constructor, but then, I have cyclic dependency.

[source lang="cpp"]// Engine.hpp#include "Module.hpp"class Module;#include "OtherModule.hpp"class OtherModule;class Engine{public: Module *module; OtherModule *othermodule; ...};// Module.hpp#include "Engine.hpp"class Engine;class Module{private: Engine *engine;public: Module(Engine *eng) { engine = eng; // Now can play with engine->othermodule }};[/source]

To get the desired effect, I have to do forward declarations, witch don't seems good (elegant), with all the Modules.

To make it simple, I want some layout ideas... how do you design your engines?
How do you make many subsystems interact? without please making tons of Singletons.
Ideas please!