abakobo

Forum Replies Created

Viewing 15 posts - 181 through 195 (of 455 total)
  • Author
    Posts
  • in reply to: Faster way to read in pixels? #12357

    abakobo
    Participant

    OriginalVersion = 20ms
    OriginalVersion = 20000μs
    AbakoboVersion = 18ms
    AbakoboVersion = 18022μs

    Mmm! Direct pointer usage was not a great gain (but still a gain ? or just cache work? ;). It was the key to speed in a Julia set fractal generator..
    Not using Canvas operation was the major key for shure!

    Note that Image and Pixmap (extends Ressource) are not GCed so you you have to .Discard() them before replacing/loosing them or you’ll leak memory. But as the are not GCed Mark won’t tell it’s not safe to point to them!?

    in reply to: Compiling Monkey2 on Linux terminal troubles #12356

    abakobo
    Participant

    I have to install these to get it to work on linux Mint

    in reply to: Faster way to read in pixels? #12330

    abakobo
    Participant

    I would start to try with someting like that (not tested) (might create problems with lighnting and image shaders..?):

    But I would also try to work with pixmaps until the last moment and as few canvas work as possible (using PastePixmap at the end can be usefull sometimes). I think it is generally faster but i’m not shure about that (and what about lighnint and shaders integrity). Not faster for drawing plain bitmaps/inmages to the target render/mojocanvas I guess…

    If you can, try to use an array of Pixmaps instead of array of Images and then use pointer to read/write directly in the memory (like in the example) without using methods (even functions ?) when you are in an intensive loop spot. Reading/Writing pix per pix can be intense.
    There’s also a shader approach as an option (more technical but might use GPU’s parallel computing ability, with pure mx2 you have no (parallel)multi-threading).

    in reply to: Finally succumbing to the lure of the Monkey (2) #12312

    abakobo
    Participant

    Welcome!

    about the physics engine, chipmunk is included in mx2. And there is a tutorial for it! :https://github.com/peterigz/Monkey2Tutorials

    I started to work on Box2D and should continue (and finish it) this end of December.
    https://github.com/abakobo/Box2D

    in reply to: how to deal with extern cpp's string #12188

    abakobo
    Participant

    I finaly decided to go with std::copy so I keep the memory allocated by mx2 and don’t have to worry about GC/memory stuffs.
    It’s passing a fixed size char_t array and then transforms it to string when back to mx2. It the way I felt the safest (with my knowledge;)

    the aim was to deal with the error message..

    cpp side

    mx2 side

    in reply to: how to deal with extern cpp's string #12177

    abakobo
    Participant

    there’s the std::string.c_str() method that returns a char array, i’ll go with thar cpp side..

    in reply to: Site problem with the character ` #12147

    abakobo
    Participant

    Maybe using a backslash before your char will skip is markdown code.

    in reply to: Some notes about Pixmap #12146

    abakobo
    Participant

    Can’t reproduce the artifacts I had at a time. All working good now! (not using alpha)

    in reply to: Some notes about Pixmap #12108

    abakobo
    Participant

    I’ve had problems saving the pixmap to png too. I think it uses some png compression by default thus artifacts. It’s probably just a flag under the hood though.

    in reply to: Playing with first class functions #12078

    abakobo
    Participant

    Gandalf of Sophisticated Basic Compiler Design.

    I found a new name that would fit fine with google search!

    MOINOBA (MOnkey Is NOt BAsic) (erm just joking …)

    in reply to: Playing with first class functions #12077

    abakobo
    Participant

    and passing by reference could be useful in some designs!

    in reply to: Playing with first class functions #12076

    abakobo
    Participant

    Here’s is some (more) discovery of undocumented behaviour..

    Is it expected behaviour?

    in reply to: String question? #11946

    abakobo
    Participant

    Not sure what is your problem here but you can have a lot CR or LF or CRLF in a single string.

    Do you mean the string does not contain any ~n(LF #10) or ~r(CR #13) any more? i.e. when you print it, the line return are not there anymore? Do you mean “into Monkey I get ALL then lines in one line“?

    When I load a string with LoadString I then have to split it in lines to process it with some line per line logic.

    in reply to: Weird List error #11938

    abakobo
    Participant

    It’s not really weird. It’s first class functions. If you forget the brackets you’ll pass the function itself not it’s result. But it’s true it’s a bit surprising the first time.

    in reply to: Monkey2 conversion #11888

    abakobo
    Participant

    I’m not sure to understand what you’re looking for but may be pixmaps are what you need!? It helped me to boost some processes sometimes.

    with the PastePixmap for example. And you can modify pixmaps pixels using direct pointer access too (for plot by plot faster drawing. There’s is also discussions about shaders in the help forums too.

Viewing 15 posts - 181 through 195 (of 455 total)