sicilica

Forum Replies Created

Viewing 7 posts - 16 through 22 (of 22 total)
  • Author
    Posts
  • in reply to: module std/graphics/color.monkey2 additions #2286

    sicilica
    Participant

    I disagree. Even though you could argue that you can tell which version it is by looking at Ints and Floats – having two constructors with very different functionality that both use numeric types is confusing. IIRC it was inconsistent before, like mojo1 used 0-255 and mojo2 used 0-1 or something, and anytime I needed to set a color I never knew what format I was supposed to be using. The most important thing is consistency, and if you only have one, 0-1 is more useful for most applications.

    Couldn’t you use Color.FromARGB? Or else just multiply by something. I will say, it would make sense to me for FromARGB to have an overload that takes four Bytes instead of one Int.

    Const BYTE_TO_FLOAT:= 1.0/255.0

    in reply to: Help with an OpenGL sample #2284

    sicilica
    Participant

    To clarify, you at least need a vertex shader and fragment shader. Assuming you just need a simple pass-through shader that does a texture lookup or solid color, I’m sure there are a lot of us here who could help.

    Like Mark says, you also might need to make your own render buffer instead of using mojo’s canvas to get things to play nicely. If you read the last blog post, there should be a GLWindow class soon that can do that for you.

    in reply to: module std/graphics/color.monkey2 additions #2283

    sicilica
    Participant

    You wrote a script to write the monkey code? I mean, clever solution, and not to be condescending, but… why not sublime text?

    In any case, I might yank this just so I never feel like I have to new up a Color object, since any time I construct a throwaway just for data transfer my pre-optimization nerves tingle. Thanks.

    in reply to: Defining preprocessor directives #2107

    sicilica
    Participant

    It couldn’t really be #If, because the whole point of “#” is to signify that you’re sending a command to the preprocessor – this is why MX1’s “Import” became “#Import” in M2. Mark’s talking about having those conditionals execute later in the compilation process, after the preprocessor’s finished.

    I dunno if I have a better name than StaticIf, but +1 to having all those preprocessor flags available as constants.  Occasionally I’ve wanted to be able to access them at runtime before, for… reasons.

    in reply to: Class fields overlapping? #2106

    sicilica
    Participant

    In case anyone has this problem in the future, deleting your build folder and rebuilding works, and hopefully it won’t be long until a fix is live. Thanks Mark!

    in reply to: I propose a possible extension change? #1922

    sicilica
    Participant

    I don’t know about .mx2 in particular, but while .monkey felt long, .monkey2 somehow seems REALLY long.

    +0.5?

    in reply to: Function pointers should auto-cast to Bool #1867

    sicilica
    Participant

    You can call null functions? That’s – interesting. I can’t think of a lot of reasons that’d be useful, but it’s good to know.

    The object ?. operator would be a lot like Option objects in languages like Scala, it sounds like. I guess having both that and a default behavior for null function calls could clean up a lot of boilerplate safety checks. Sweet.

Viewing 7 posts - 16 through 22 (of 22 total)