codehunter13

Members
  • Content count

    74
  • Joined

  • Last visited

Community Reputation

122 Neutral

About codehunter13

  • Rank
    Member
  1. Singleton vs member variable

    Hi, Normally i don't like singleton. But for my logger i also use a singleton. My log class is able to log to different outputters. This way you can have one log class that logs to different files,console,... greets,
  2. multiple buffers are not faster because switching from one buffer to another is an expensive operation, certainly when using dynamic buffers. My engine creates a big dynamic vb for the terrain. Each frame the buffer is sequentially filled with the visible terrain chunks. When the buffer is full, the engine clears the buffer and starts filling it from the beginning. For other (static) objects, my engine creates a buffer of an optimal size for the videocard. I think this is 4 mb but i'm not sure about this. it depends probably on the videocard. When 4Mb is not enough the engine just creates an extra buffer of 4 Mb. greets
  3. worst error message EVER

    i'm working in a call center and just got someone with the message: cannot find motherboard when she boots the pc
  4. worst error message EVER

    i'm working in a call center and just got someone with the message: cannot find motherboard when she boots the pc
  5. Difference between C and C++

    c is a procedural language and c++ object oriented
  6. Multiple light Solutions ....

    What is the shader version you are compiling the shader to?
  7. Multiple light Solutions ....

    you don't need multiple passes. Collect the x nearst lights. Pass them to a shader and do the calculations inside the shader. you can use branching inside the shader , so the shader can handle a different number of lights hope this helps greets
  8. Octree Help

    give each node in the octree a list with all dynamic objects. Check in which node the player is(can be done very fast in an octree) and do a collision test on all the dynamic objects in the list. Now, you will have some problems when the player is on the edge of a node. A solutions to this is to do the collision test also on all dynamic objects in the surrounding nodes. hope this helps a little greetz
  9. Hi, I have a base class for my managers like this: template <class tHandle,class tResource,class tFactoryHashType, class tHashType> class cMgrHashed { public: typedef typename std::hash_map<tHashType,tHandle>::iterator cResIt; inline cResIt getFirst () {return resMap.begin();} inline cResIt getLast () {return resMap.end();} //... private: typedef std::hash_map<tHashType,tHandle> cResMap; cResMap resMap; } Then i have a mgr for my vertexbuffers like this: #include "GRaVertexBuffer.h" class cVbMgr : public VA::HBRM::cMgrHashed<cVbHndl,aVertexBuffer,std::string,std::string> { public: void Foo(); }; void cVbMgr::Foo() { for(cVbIt it = getFirst();it!=getLast();++it) { } } cVbIt is declared as following: typedef VA::HBRM::cMgrHashed<cVbHndl,aVertexBuffer,std::string,std::string>::cResIt cVbIt; This gives me the following error on cVbIt in the for lus: p:\Programmatie\C++\MyLibs\Renderer\GRcVbMgr.cpp(160): error C2440: 'initializing' : cannot convert from 'VA::HBRM::cMgrHashed<tHandle,tResource,tFactoryHashType,tHashType>::cResIt' to 'std::list<_Ty,_Ax>::iterator' with [ tHandle=GR::cVbHndl, tResource=VA::HBRM::tResource, tFactoryHashType=VA::HBRM::tFactoryHashType, tHashType=VA::HBRM::tHashType ] and [ _Ty=stdext::_Hmap_traits<std::string,GR::cVbHndl,stdext::hash_compare<std::string,std::less<std::string>>,std::allocator<std::pair<const std::string,GR::cVbHndl>>,false>::value_type, _Ax=stdext::_Hmap_traits<std::string,GR::cVbHndl,stdext::hash_compare<std::string,std::less<std::string>>,std::allocator<std::pair<const std::string,GR::cVbHndl>>,false>::allocator_type ] Why does he want to convert my hashmap iterator to a list iterator??? greets
  10. boos signals error

    It works when i place the function void msgReply() {} outside the class and use cMsgDispatcher::getSingletonPtr()->hookFunctToMsg("msg1",&msgReply); But i need to place the msgReply in classes.
  11. hi all, i'm writing a message system and i use boost::signals but i get an error within the boost library. In my msgDispatcher, i have this: typedef typename boost::signal<void () > cSignal; bool hookFunctToMsg(std::string msgId, const cSignal::slot_type& func); In a test class "cTestController1" i have the function: void msgReply() {} In the same class i do: cMsgDispatcher::getSingletonPtr()->hookFunctToMsg("msg1",&cTestController1::msgReply); The call hookFunctToMsg gives the following error in the boost library: error C2664:'voidboost::function0<R,Allocator>::assign_to<Functor> (FunctionPtr,boost::detail::function::function_ptr_tag) : cannot convert parameter 2 from 'boost::detail::function::member_ptr_tag' to 'boost::detail::function::function_ptr_tag' does someone knows a solution to this? thx in advance
  12. Serialize arrays

    i know i can use another container but boost does it with an array.
  13. Serialize arrays

    Hi all, i'm writing a serialize system for my engine. If i want to seialize something,i've just to write: Serializer << objToSerialize; if i look at the boost serialize library i see they can serialize an array with the same call (Serializer << array;) i also wants this but how can i get the size of the array? thx in advance
  14. std string problem

    no it's not due to the debugger because i can see it works when str is empty
  15. std string problem

    yes that work as long as the string is empty when calling this function.If str is not empty when calling the function and i do the assignement, str = ???.