abakobo

Forum Replies Created

Viewing 15 posts - 391 through 405 (of 455 total)
  • Author
    Posts
  • in reply to: A Few Questions About: libc #5562

    abakobo
    Participant

    indeed…

    There is the FromCString for that purpose..?

    [/crayon]

    But the argument of get env is wrong:
    Function getenv:char_t Ptr( name:@cstring )

    So “USER” has to be converted to a cstring (don’t know what the @ means!)
    from the docs:
    monkey:monkey.types.String.ToCString
    Method ToCString:Void( buf:Void Ptr, bufSize:Int )
    Converts the string to a CString.

    If there is enough room in the memory buffer, a null terminating ‘0’ is appended to the CString.
    Parameters
    buf Memory buffer to write the CString to.
    bufSize Size of the memory buffer in bytes.

    in reply to: A Few Questions About: libc #5559

    abakobo
    Participant

    Mark just added String.FromChars a few days ago. It’s in the develop branch on github. I suppose it’s for that purpose..

    https://github.com/blitz-research/monkey2/commit/b2976c674ad445a321b8f9c9c175c4025336b664

    in reply to: DrawLine+Scale: thickness bug.. #5393

    abakobo
    Participant

    Great! Thanks.
    I use them for 2d physics debug draw so perfection is not mandatory! A bit of consistency when scaling is a good point, I hope it’s not slowing down the process..

    in reply to: need help solving a logic problem. #5326

    abakobo
    Participant

    Structs goes on the stack and classes on the heap… So structs are theoretically faster.. if you’ll use your vects in very iterative process it will slowdown your app. In some very hungry loops it’s even interresting to use x and y with no structs at all!

    in reply to: need help solving a logic problem. #5324

    abakobo
    Participant

    here is some working example with starting and ending point, so if you invert the handles to arc will flip.
    May be you don’t want it to flip when the angle is small. EDIT: If so just invert start and end when the switch occurs. Won’t work “just” like that…
    You should have used Vec2f instead of redefine a vec2. Monkey is full of little gentle things like that..

    [/crayon]
    in reply to: extending a C++ class with GC ? #5224

    abakobo
    Participant

    Could you post the entire rectangle example codes? I have difficulties with the gcnew in cpp side and how it becomes a simple new in mx2. (Or you can’t ‘new’ it in mx2?)
    Thx

    in reply to: anyway to get the GC to delete a c++ object pointer ? #5159

    abakobo
    Participant

    There is at least this way but I suppose it’s not possible in every case..
    http://monkey2.monkey-x.com/forums/topic/how-to-get-an-extern-class-that-extend-bbobject-and-not-void/

    in reply to: Class destructor #5137

    abakobo
    Participant

    some mx2 objects are not Garbage Collected, like Image for example.
    You have to use .Discard() to destruct them

    Dunno if it works with GC objects but you can force the GC to clean memory with GCCollect()

    Edit: oops looks you are looking for a onDelete callback, so this answer is probably not relevant..

    in reply to: c++ constructors #5136

    abakobo
    Participant

    I think you have nothing to do to get them working.. (here tested working example with box2d c++ wrap)

    in c++ .h:

    [/crayon]

    in monkey 2 extern section:

    [/crayon]

    If I understand your question..

    in reply to: const pointers #5026

    abakobo
    Participant

    Here some working code (with an int). But you probably already get it.. or may be this is not relevant at all but I wanted to play with the ‘cast’ solution for const ptr. And this is nothing official, so could be deprecated? Never saw it in the docs..

    .monkey2

    [/crayon]

    facto_c.h:

    [/crayon]
    in reply to: 3d rendering #5022

    abakobo
    Participant

    Great!
    Happy that mx2 extern capabilities are pleasing some people! For me it’s the main new feature compared to mx1.
    Looking forward to see your repos!

    in reply to: anyone interested in 3d dynamics (physics) #5013

    abakobo
    Participant

    In case you didn’t had the occasion to pass ode includes in c2cmx2, here is a pass. Didn’t tested anything. Just passed it. The imports are not complete (some *.h would need to be added at least)
    The attached zip contain the c2mx2 log and the json.
    I’ll have a look at your glfw stuff.
    It’s the latest ode dev version.. If you want me to pass another don’t hesitate to ask..

    Attachments:
    1. ode_c2mx2_pass.zip
    in reply to: anyone interested in 3d dynamics (physics) #4977

    abakobo
    Participant

    I am! But have experience with 3D gfx with Matlab only, so very far from GL stuff that look very complex to me (one of the reasons I like mx). For me it would require a basical 3D gfx capable module before attacking 3D physics.
    I can pass C code trough c2mx2 as I have all os types on my PC.
    Seeing how fast your get things running I think your programming skills are way over mine. But I probably can help.

    in reply to: const pointers #4976

    abakobo
    Participant

    Defining extern with ‘const something’ is very limited. It can lead to some mess if you don’t use for functions arguments only. Because the transpiler will just copy the defined name and ‘const something’ is more than just the name on The C side. Mark has manualy made some glue code for these situation. For example for the chipmunk debugdraw drawpoly callback function that have a ‘const ptr’ as argument.
    I had also a similar problem with pure virtual methods for the box2d wrap but I chose to remove the const in the cpp code because box2d is solid enough not to need the const barrier imo. So if you may remove ‘const’ from the C code, it’s probably the fastest way.
    It’s one of the difficulties with c to mx2. The only one I encoutered for now.

    in reply to: would $1 patreon be insulting? #4973

    abakobo
    Participant

    I had the intention to switch to a yearly donate equivalent to 12 monthly patreon (starting in january). If it’s not a good idea please tell..

Viewing 15 posts - 391 through 405 (of 455 total)