Mark Sibly

Forum Replies Created

Viewing 15 posts - 961 through 975 (of 1,431 total)
  • Author
    Posts
  • in reply to: Making Rnd more random. #5320

    Mark Sibly
    Keymaster

    I think there may be something a bit weird going on with Rnd, will take a look today.

    in reply to: possible to turn bbGCNode * into class decl #5319

    Mark Sibly
    Keymaster

    What are you trying to achieve though? There may be an easier way to do it without reflection, or it could be done on the monkey2 side etc…

    in reply to: possible to turn bbGCNode * into class decl #5284

    Mark Sibly
    Keymaster

    What the hell are you trying to do?!?

    in reply to: HelloChipMunk_Universe #5258

    Mark Sibly
    Keymaster

    Welcome to mx2!

    Were you having some problems with hello-world?

    in reply to: Fuzzy DrawLine() in mojo if thickness > 1 #5255

    Mark Sibly
    Keymaster

    This is just an (incomplete) attempt to make thick lines look a bit nicer. Ultimately, I’d like to store line params in texcoords and let the shader do this but we;re not there yet, ditto with points, ie: it’s WIP.

    Max glLineWidth differs on different graphics cards, so can’t be used reliably so mojo draws an ‘oriented’ rect if width>1. I could add an ‘AnitaliasedLiesEnabled’ property, but I’d rather wait until shaders can deal with this.

    There is no FSAA yet but it will happen.

    in reply to: canvas.Scale() Bug or bad practice? #5253

    Mark Sibly
    Keymaster

    Nice bug! Potential fix pushed to develop branch.

    in reply to: Tutorial using the GC with C++ objects #5250

    Mark Sibly
    Keymaster

    if I try to extend MXRectangle (in MX2 code) (so I can add extra code to some of the methods) its asking for the default constructor of MXRectangle ?

    This is just normal OO behaviour. You can either added a default ctor to MXRectangle, or use Super.New(…) in dervided class ctors.

    in reply to: Tutorial using the GC with C++ objects #5227

    Mark Sibly
    Keymaster

    Very nice, however one important issue that I should have picked up on earlier…

    MXRectangle should be declared as a class not a struct, eg:

    The problem with using a Struct Ptr is that GC does not track pointers – only class references (which, yes, are really pointers in C++, but you know what I mean…) – so assigning a ptr to a variable will NOT keep an object alive.

    This in fact makes things easier though, as there is no need to use a factory method or bbGCNew() on the C++ side (you still can but you need to be a bit careful – more on this later) and there’s no need to have ‘Ptr’ everywhere in the mx2 code since it’s a real mx2 object.

    Sorry about not making that clear earlier, I wasn’t look at all the code!

    in reply to: how to get an extern class that extends bbObject and not void? #5222

    Mark Sibly
    Keymaster

    In this case, there is no need for a dtor as it’s a NOP and bbObject already declares a virtual dtor.

    But you can add dtor code if you want. There is no need/way to call super.dtor as c++ already does this for you automatically after your dtor executes.

    in reply to: Multitouch support? #5221

    Mark Sibly
    Keymaster

    Coming soon!

    in reply to: Macos keys handling #5220

    Mark Sibly
    Keymaster

    Yep, Modifier.Menu is Modifier.Control on all targets except for Mac where it’s Modifier.Gui.

    in reply to: extending a C++ class with GC ? #5219

    Mark Sibly
    Keymaster

    but you could always call the factory place the pointer in a field of a GC’d class that you *then* return from the wrapper… :-/ !

    Yes, and this is what I thought you were thinking of in the first place re: bullet. But I like this abuse of multiple inheritance much more (in fact, the litehtml modules uses this approach) – separate wrapper objects get messy as you need to foward ALL methods and allowing users to override virtual methods is tricky.

    in reply to: extending a C++ class with GC ? #5216

    Mark Sibly
    Keymaster

    Try this to create the rectangle:

    This is mx2’s special ‘new’ to create GC aware objects – it must be used with classes that extend bbObject.

    This makes this approach unsuitable for libraries that use ‘factory’ methods to produce objects, but it should work for bullet?

    in reply to: doccing memory access violation #5213

    Mark Sibly
    Keymaster

    Can you email me the module?

    in reply to: extending a C++ class with GC ? #5212

    Mark Sibly
    Keymaster

    Close!

    The problem is with the ‘disambiguation’ bit in RectangleMX’s ctor – your code actually creates a temporary Rectangle on the stack that is immediately destroy when RectangleMX’s ctor exits.

    To call a super class ctor from a ctor you need to use this special syntax:

Viewing 15 posts - 961 through 975 (of 1,431 total)