Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

144 Neutral

About stodge

  • Rank
    Advanced Member
  1. stodge

    very BEST audio software?

    Define "best"? I bought Fruityloops as it fits my needs; cheap, full featured, soundfont support, fairly easy to use out of the box but with many features I'll probably never use. So FL is the best for me.
  2. Thanks for your comments. I changed my ObjectFactory singleton from: static ObjectFactory mSingleton to static ObjectFactory* mSingleton and for some reason it works now with a shared library. Weird! Thanks again
  3. 1) I can create the static factory instance upon program initialisation if my library is a static library, but it seg faults in ObjectFactory::AddFactory: mFactories.insert(make_pair(name, factory)); Where mFactories is just: typedef std::map<std::string, IObjectFactory*> mFactories; I can query the size of the map at this point but I just can't insert into it. 2) If I create the library as a shared library, the static factory instance isn't created on program initialisation.
  4. Sorry if my question was confusing. In this example, if I declare a variable of Clock: Clock clock; in my code, the static Clock factory is created, as I see the debug output: "Creating factory for object Clock" If I don't declare a variable of Clock as above, the static Clock factory isn't created and can't be used. So if I'm doing something fundamentally wrong, how should I automatically create factories in this manner? THanks
  5. Sorry the formatting is screwed up - let me see if I can fix it. Not sure if I can describe this properly, but here goes. I have the following C++ macros; #define HB_DEFINE_FACTORY(x) class x##Factory: public ObjectFactory { public: x##Factory() { std::cout << "Creating factory for object " << #x << std::endl; ObjectFactory::GetSingleton().AddFactory(#x, this); }; virtual ~x##Factory() { std::cout << "Deleting factory for object " << #x << std::endl; }; virtual Object* CreateObject(const std::string& name) { return new x(); }; private: static x##Factory mFactory; }; #define HB_IMPLEMENT_FACTORY(x) x##Factory x##Factory::mFactory; There are used like this: class Clock: public SessionObject, public ICallable { public: HB_DECLARE_CLASS(Clock, SessionObject); Clock(); virtual ~Clock(); virtual void SerializeTo(DataStream& stream); virtual void SerializeFrom(DataStream& stream); virtual void SerializeUpdateTo(DataStream& stream); virtual void SerializeUpdateFrom(DataStream& stream); virtual void UpdateTime(ParameterListType ¶ms); virtual void Dump(); virtual std::string ToString(); protected: Timestamp mTimestamp; Timer* mTimer; }; HB_DEFINE_FACTORY(Clock); #include "Clock.h" HB_IMPLEMENT_CLASS(Clock); HB_IMPLEMENT_FACTORY(Clock); Clock::Clock(): mTimestamp() { } The problem is that I want to create a static instance of each factory, which is created at runtime without intervention by the user. This way the developer can create an instance of an object using the object factory class just by passing in the object type. The problem is that the static factory instance for say the Clock class is only created if I declare a Class object in my program. Why is that? Is there any way to guarantee the static instance is created? Sorry for the bum description of my problem but I'm not sure how else to explain it! Thanks [Edited by - stodge on December 17, 2006 7:52:29 PM]
  6. stodge

    The ultimate game engine

    OGRE3D - Proven rendering engine Irrlicht - unproven rendering engine with some features of a game engine (incomplete GUI, input) Torque - proven game engine Until people understand the difference between engines, this type of argument is pointless. If you want to compare apples and oranges, go to your local supermarket. ;)
  7. This is just a simple test so all packets are less than 20bytes. Some good things to think about- thanks.
  8. A quick UDP question when using select(). I have select() working for when bytes are received on a socket. I can happily pass them off to a Connection class, which processes the packets, parses the command and data etc.. However, when sending to a server on localhost, I'm losing lots of packets. Say I send 1000 unreliable packets from the client, the server only receives say 25%. The PC is an AMD 64 of some variety (can't remember) and there's nothing else of any interest going on at the time. CPU usage is low. When using UDP, do you: 1) use select() to tell you when a socket is ready for writing and then only send UDP packets when this occurs? 2) write packets as fast as you can to the socket, and let your reliable layer sort things out? 3) do something else I haven't considered? Thanks
  9. Well spotted: in winbase.h there's: #define GetCurrentTime GetTickCount Doh! Thanks
  10. I'm getting the following error when compiling my library in CodeBlocks on Windows: <source>error class Habitat::Utils::Timestamp has no member GetTickCount.</source> The compiler is complaining about this code: <source>mTimestamp.GetCurrentTime();</source> So I don't know why it's giving me this error - of course it doesn't have a member GetTickCount as I didn't put one in! I presume it's confusing my Timestamp class with another one it's compiling in, but I don't know why. I've put it into the Habitat::Utils namespace to avoid conflicts, but it still won't compile. Any thoughts? Thanks
  11. I'm not afraid to admit I use Singletons as facades. I guess the Singleton vs. no Singleton war will rage just as long as the GNOME vs KDE war.
  12. stodge

    Catmother Enigne Help

    I haven't used catmother engine, but there's something wrong with your build. Search Google or Gamedev for that particular error text. You should get many hits.
  13. class ISceneNode { virtual std::vector<IRenderable*> getRenderables(); }; How does this sound? I don't think a scene node should care about a Render method, becasue to a scene node that doesn't make sense. At least to me. Disclaimer - I'm no scene expert!
  14. stodge

    TCP / UDP advice

    "TCP looks sexy in that I don't have to spend time implementing guaranteed transfer," If you're using the Torque Network LIbrary (TNL?) then you don't need to implement guaranteed transfer, as it's already supported. You could use TNL's UDP support for any type of connection, as it provides reliable UDP. With TNL you could possibly use one socket for talking to many different other machines? I'm not sure from memory if this is supported. I'm not sure what your problem is?
  15. stodge

    mmo question

    It's not about telling people to not create MMPOGs. It's about telling people who are obviously not capable of searching Google or the forums, learning to program or reading documentation that they shouldn't try to create an MMPOG. My 0.0000002c.
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!