Rewdew

Members
  • Content count

    312
  • Joined

  • Last visited

Community Reputation

349 Neutral

About Rewdew

  • Rank
    Member
  1. Unity Plugin Architecture

    Well simply link the plugin with the application: a .exe and a .dll are almost the same, you can export elements from a .exe just like you would export them from a dll. An alternative - which is usually favored - is to have the application elements as interfaces as well, and the application implementing them. Technically your interface is more an abstract class than a reference since you have that virtual destructor. Also you might want to make that get_name const and return by reference or get passed a string reference.
  2. scripting or game dll

    DLL: Pros - more performance - can do lower level stuff that might be difficult to expose via scripting - can add stuff that was never meant to be in your engine Cons - more complex for developers - more annoying to test (have to compile each time) Scripting: Pros - language generally simpler - if your dom/api/whatever is designed well, it's usually simpler than doing the same with a DLL Cons - performance (which might not matter, depending on what your script does) - trickier to "protect" (reversing and such) Of course nothing prevents you from having both...
  3. Hm now that you mention it, last time I checked was in 2001 or something heheh, guess I'll verify next time before answering :-)
  4. 2 Console Questions

    Quote:Original post by Ned_K 1. Can I get unicode support for apps running in console mode?Simplest will be to use WriteConsole instead of wprintf/wcoutQuote:2. Can I add a background picture to a console (by hook or by crook) or would I need to write an emulator if I wanted that functionality?Doubt it but might work
  5. Not necessarily but I've never met an implementation that doesn't do it. So true that doesn't mean it'll always be the case but I find it much more readable :-) + usually people need a trick to prevent memory from being released, not the other way around (like doing a resize(0) instead of a clear, but yes that's also specific to an implementation).
  6. Putting it all together

    How about getting the DirectX SDK and looking at the tutorials (first is a black screen, then a white triangle, then a colored triangle, etc, if I remember properly)...
  7. unsigned int * path = 0; // initialize it, always, no excuse, ALWAYS. delete [] path; // works fine, cause you initialized it, thanks for initializing path = new int[100]; delete [] path; // works fine, you allocated it... path = 0; // set it back to 0 so you know it's free delete [] path; // works fine again, it's 0, not some address you freed beforeSo basically, initialize it, get rid of that resetPath and set it to 0 when deleted. Of course you could just use: std::vector<int> path;But since you say it's a path, it'd make more sense if it was char, in which case you'd just use:std::string path;
  8. Hm how exactly is it harder to change the text when you encoded it that way?
  9. dll problem

    Quote:Original post by Fire Lancer (ie by having d3d9 code in the exe it will fail if d3d9 is not installed on the computer, even if the user want to use the openGL graphics)Just LoadLibrary d3d9.dll ;-)
  10. dll problem

    Just use a static library then?
  11. dll problem

    You can do something like (too lazy to pass the right arguments) GetCurrentDirectory( oldcwd, sizeof oldcwd ); SetCurrentDirectory( where_the_dll_is ); LoadLibrary(); SetCurrentDirectory( oldcwd );Why don't you want the DLL to be in the same directory as the .exe?
  12. dll problem

    What is your question/problem exactly?
  13. C++, headers

    Or "a header contains anything that you want to include in your source files" :-) It's just a convenient thing to avoid copy pasting code in 5 billions places. So they don't get compiled, only source files (.cpp) are. As you get used to C++ you'll see headers generally contain declarations and source files definitions... (except for templates, but that'll be for next year ;-))
  14. Pass a predicate? edit: also iterators normally aren't passed by reference, and are just passed as a template argument type, + you need a const version for the container... and if you really want it to be optimal, you'll probably have to specialize your code for all the common containers