Jump to content

Furbolg

Members
  • Posts

    243
  • Joined

  • Last visited

Posts posted by Furbolg

  1. Good explanation, didnt know/realized that AddHook is the real problem.

     

    Of course using void* is a bad thing, because void* can be anything. But there are exceptions for example if you know what void* represents, then it shouldnt be a problem to cast it ( beginthread etc. ):

  2. You can try the code i posted first... does OSX uses gcc ? Maybe you can update your compiler ?

     

    No it looks like a incompatibility .... c++ isnt that much standardized as i would wish (Visual C++ 6 anyone ? wink.png).

  3. Sorry josh but this statement is wrong and (void*) is a c cast, the code above is cleaner.

     

    Passing data as void* and cast it back is valid and sometimes you dont have a choice, for example most winapi functions do it this way (beginthread, getwindowlong ...).

     

    // Edit: your example compiles fine at my solution (picture attached)

     

     

    this is what i got in my CPP file

     

    
    
    void Coll(Entity* entity0)//, Entity* entity1, float* position, float* normal, float speed)
    {
    
    }
    
    
    this->Full->AddHook(Entity::UpdatePhysicsHook, Coll);
    

     

    i switched to the update physics hook to emulate what is in the linked thread and still getting the fallowing error

     

    "cannot initialize a paramater of type 'void *' with an lvalue of type 'void (Leadwerks::Entity *)'

     

    // Edit2:

     

    Oh sorry.. OSX... didnt see that sad.png

     

    But (void*) is still a bad choice wink.png

    post-2196-0-20256600-1364832544_thumb.png

  4. The problem is if you write " *it->MyMethod() " (example to show the problem) then c++ will try to use " * " (asterisk) on MyMethod but you want it on " it ", so you have to write (*it) to deferencing the iterator.

     

     

    // Edit: to clarify

     

    you could write something like this

     

    Mycallback = &(*it)->GetMethodToCallBack();

  5. Good tutorial Aggror!

     

    Because the "move ambiguous" error ... i could bet this is because std::move.

     

    // edit:

     

    Yes ... look at "Leadwerks.h" at line 166... thats why "using namespace" is a bad idea.

     

    You can solve this problem by writing ::move in your App::Start method.

  6. If LoadMap could return an Entity (like in LE2) or had an second parameter with an entity list (std::vector, entity* ...) that would be really handy.

     

    I dont like these C Callbacks and try to avoid them but sometimes you dont have a choice (WinAPI MessageHandler, LoadMap etc.).

  7. Oh you will, because

     

    class mytest
    {
    public:
     mytest() : someint(0), somefloat(0.0f)
     {
       calcsome();
     }
    private:
     int someint;
     float somefloat;
     void calcsome()
     {
     }
    }
    
    int main()
    {
     mytest* test = new test();
     // or
     mytest test2();
    }
    

     

    is much better then somethind like

    int someint;
    float somefloat;
    void calcsome()
    {
    }
    
    void xyz_init(int a, float B)
    {
    someint = a;
    somefloat = b;
    calcsome();
    }
    
    int main()
    {
     xyz_init(0, 0.0f);
    }
    

  8. Please dont make the mistake and equal c with c++, c++ is based on c but has some major improvement (new(constructor)/delete(destructor), templates, classes (private/public/proctected, inheritance, virtual)..... etc.)

     

    When you mastered c, c++ isnt that hard but there are differences (malloc/realloc/free vs new/delete ... dont to mention stl).

  9. @BES :

    That's what scares me about LE3 laugh.png

    I hope we will see OPTIMISATION in top priorities.

     

    Well it's a beta, and it's hard to define in hat state should be a beta also.

     

    Before optimizing, josh should implement all thats necessary and check if it works. You know "premature optimization is root of all evil".

  10. Guys we should wait till Josh get the 3.0 version ready for launch.

     

    As you can see here, it is possible to talk with Josh (if its civil and not flaming).

    We got Josh to think about the price, so chances we are getting Leadwerks 3D cheaper are given. Josh officially promised to add free terrain (in the meantime anyone could use Meshterrain and Splattershader, this community will share this really fast i guess).

     

    Im also not happy with the actual situation (Unity: free, UDK Source Licensee (for hobby/indie) 99$ etc... you know the competetors) but i think we have to give Josh a chance to react.

     

    Later on we can still left but i hope we dont reach this point.

  11. He asked if its possible to programm Le3D with C# not if you like it.... please... i hope you know the difference.

     

    I personally prefer c++ for my gaming project but i also use Delphi/C# for Desktop Applications and PHP/Java for Webbased Development.

  12. C++ is the way to go. C++ is much easier and faster than C#. C# is just horrible and should never be used, it's as bad as Objective-C or Java.

    C# / Java have their place, if YOU dont like it, its okay but dont tell others what they have to like.

     

    Besides it's much more fun to code in C++ than in Lua, so why code in something which is not fun?

    Again, YOU think its more fun not everybody.

     

     

     

    @Noyart: Le3D comes with C++ and Blitzmax API (if i remember correct). I guess Roland or someone else will create a C# port after a while.

×
×
  • Create New...