Mark Sibly

Forum Replies Created

Viewing 15 posts - 376 through 390 (of 1,431 total)
  • Author
    Posts
  • in reply to: Modifying the mojo Canvas Class #11336

    Mark Sibly
    Keymaster

    Ok, not sure what’s happening (mx2cc shouldn’t crash!)  but the above code will not work with the upcoming version of monkey2 v1.1.08 anyway as I have modified how vertexbuffers are written. Which is exaclty why all this stuff was/is private…

    But NewDrawOp appears to be the same as the existing AddDrawOp anyway. What exactly are you trying to do?

    in reply to: Max Databuffer File Size? #11335

    Mark Sibly
    Keymaster

    Probably 2Gig, ie: 2^31. Need to convert some ints to longs (or maybe add a size_t type thing) before it can go full 64 bit.

    This will also be a problem in Windows as it will really require a new target, ie: separate Windows32/Windows64 targets.

    in reply to: Something askew with Deque? #11323

    Mark Sibly
    Keymaster

    It’s a bug – fix coming soon!

    in reply to: Apply shader to group or layer of objects #11319

    Mark Sibly
    Keymaster

    I *think* what Anatol is after is something like…

    …so if you set canvas.Shader to a non-null value, you can draw a bunch of stuff using a single shader regardless of each image’s Image.Shader. I can see this being useful for multipass techniques.

    This actually kind of mirrors the Canvas.Blend property which overrides Image.Blend if non-null.

    It also provides a way to set the shader used for points, lines, polys etc.

    Is this right Anatol?

    in reply to: Is there something like GetDate ? #11311

    Mark Sibly
    Keymaster

    milliseconds passed from 197x or so

    Nice idea…

    http://currentmillis.com/

    in reply to: Collision checking #11310

    Mark Sibly
    Keymaster

    Rect does have an ‘intesersection’ method, but no, not really, you’l have to do it yourself or go 3rd party for now.

    I will probably add some simple functionality for this eventually though (probably to ‘std’ module)  – if you post an issue at github, it’ll give me a hurry up.

    in reply to: Apply shader to group or layer of objects #11309

    Mark Sibly
    Keymaster

    Hi,

    There’s no easy way to do this currently as an image’s shader cannot be overridden.

    An image’s shader is ‘applied’ via the DrawOp system in canvas. If you look at the code for DrawImage in canvas.monkey2, this line is where the ‘magic’ happens:

    It would not actually be hard to add something like a ‘ImageShader” property to Canvas which could be used to override this image.Shader shader if non-null. It could also override point, line,shape shaders too (so ImageShader may not be best name).

    This already kind of happens with Canvas.BlendMode which actually overrides Image.BlendMode if non-null.

    There would be no way to provide global shader params that would affect *all* drawn images, but if you can live with that I would be OK with adding some sort of ‘global’ shader override to Canvas.

    in reply to: SQLITE – Destructor Definitions? #11308

    Mark Sibly
    Keymaster

    Currently, you’ll need to write a c handler for these as mx2 functions are not compatible with c++’s so they’ll need to be ‘converted’.

    in reply to: Is there something like GetDate ? #11299

    Mark Sibly
    Keymaster

    Actually, there’s no GetDate as yet, will add some more time stuff soon.

    SeedRnd Millisecs() usually does the trick, although it measures app execution time so it sort of depends on being used after ‘hit any key to begin’ or something, otherwise it may return similar values if just used in a set place after app start.

    in reply to: Shapes or bitmaps? #11281

    Mark Sibly
    Keymaster

    If you’re just drawing rectangular shapes, there’s likely to be little to no difference speedwise. Unless your trying to draw a gazillion things, I’d stick with images just ‘coz they’re simpler and more flexible, ie: you can draw anything you want!

    Have a look at the rendertoimage banana for a simple example of how to pre-render shapes to an image.

    in reply to: Continue Line #11280

    Mark Sibly
    Keymaster

    add stuff, but don’t break stuff.

    Definitely! EOL handling is strangely tricky, but think I have it covered this time around.

    in reply to: Diddy2 #11277

    Mark Sibly
    Keymaster

    Nice!

    in reply to: Continue Line #11276

    Mark Sibly
    Keymaster

    In the meantime, you could break long ‘And’ If statements into multiple block Ifs, eg:

    This is what I tend to do – I like having just one statement per line (as you might have guessed).

    in reply to: Server question? #11274

    Mark Sibly
    Keymaster

    If you’re talking about TCP, a ‘listening’ server socket is not a stream – it is a ‘connection point’ for incoming connections (which are themselves streams). With TCP, you need to be connected before you can send/receive data so you can’t actually exchange any data with the ‘server’ which is there purely to establish the connections.

    With UDP you can talk to the ‘server’ (a ‘server’ doesn’t actually do much/anything) but it is unreliable and packets can arrive out of order so it’s not as easy to use as TCP.

    If you’re thinking about using something higher level, I was thinking about converting enet again which would be very easy to do. Would this be useful?

    http://enet.bespin.org/

    There is also raknet, which is much more complex and would likely take considerably longer to do fully:

    http://www.jenkinssoftware.com/raknet/manual/Doxygen/

    Both are very mature and well regarded.

    If you want to keep using sockets, I recommend looking at some socket tutorials first, eg:

    https://www.tutorialspoint.com/unix_sockets/

    A lof of these use threads to handle multiple connections, but the basic ideas are the same with fibers. Google for more etc…

    in reply to: Continue Line #11271

    Mark Sibly
    Keymaster

    Not currently, I haven’t felt the need so far for anything beyond the current scheme of allowing line splitting after ‘(‘, ‘,’ and ‘[‘. That’s just the way I like to code I guess – if a line get so long it’s wider than a page, I like to break it into bits. Ditto with functions longer than a page(ish).

    But that’s just me. The ‘..’ token is currently unused and I’d be OK with adding that for line ‘continuation as it’s clean and simple and makes it obvious that you are in fact splitting a line.

Viewing 15 posts - 376 through 390 (of 1,431 total)