• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

111 Neutral

About victorsouza

  • Rank
  1. 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:   _HAS_ITERATOR_DEBUGGING=0 _SECURE_SCL=0   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!   Cheers
  2. C++ Engine Layout

    Well, interesting insights! [quote name='Hodgman' timestamp='1355837622' post='5012034'] The problem with class Engine or class Module (e.g. Renderer or Physics or Audio) is that those classes have waayyy too many responsibilities, so much so that you're not really using "OO" design any more. [/quote] Hmm.. but as far as my interests go, I don't really want to make an 100% pure theoretically correct OO design so my teacher would give me a trophy. For me OO is a Tool that makes it easier to write and maintain complex systems. Maybe it's time for some experiments, I'll try to break the dependencies to a bare minimum as suggested by L. Spiro. But there are some "Modules" that virtually every class/module should have access, for instance, I have a class called Config that reads configurations from a LUA file. Almost all other module uses it, so now my solution is to pass it a reference in the constructor, witch seems right now. A friend suggested a Singleton but I think that this is completely misplaced. Another matter of global access is a Log file that I have. I managed it to get fully static, but I don't know if that`s a good idea either, but I definitely don't want to pass it around always...
  3. 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!
  • Advertisement