Mark Sibly

Forum Replies Created

Viewing 15 posts - 886 through 900 (of 1,431 total)
  • Author
    Posts
  • in reply to: How to convert a string to character? #6762

    Mark Sibly
    Keymaster

    “a”[0] is fine!

    in reply to: types must be intergral ?? #6678

    Mark Sibly
    Keymaster

    Floor is returning a double!

    Yes it does! It’s a frequently used op in floating point math too…

    So you need to cast to int in this case, eg: Int( Floor( blah ) )  & 255, because you can only use the ‘&’ operator with integral types.

    local X:int = Int(Floor(v) & 255)

    This fails because compiler evaluates what’s inside () first, which in this case is Floor(v) & 255, which is the original problem expression.

    in reply to: Chipmunk queries #6594

    Mark Sibly
    Keymaster

    One thing I can probably do quite easily is wrap cpSpaceBBQuery so it accepts an mx2 function, allowing you to use it with methods, lambas etc.

    in reply to: Chipmunk queries #6591

    Mark Sibly
    Keymaster
    This wont work…

    …because ‘data’ is a local variable and will go out of scope when the ctor returns, meaning there will be nothing keeping the MyClass instance alive.

    The main problem here is binding an mx2 object to a ‘native’ cp object. I think a ‘generic’ way to do this would be very useful and will look into it soon.

    in reply to: Poor mans Antialias #6472

    Mark Sibly
    Keymaster

    This is apparently done with shaders a lot these days – possibly not quite as good, but not 4x slower either:

    https://blog.codinghorror.com/fast-approximate-anti-aliasing-fxaa/

    http://www.iryoku.com/smaa/

    in reply to: Monkey 2 App Methods #6471

    Mark Sibly
    Keymaster

    A lot of OnBlah stuff that was in mx1 is now implemented as ‘signals’ in AppInstance, eg: Activated and Deactivated (probably more coming). You can ‘hook’ these up to your own handler like this (inside, say, your window’s constructor):

    App.Activated+=OnActivated    ‘Assumes there’s an OnActivated method/function somewhere!
    App.Deactivated+=OnDeactivated    ‘Assumes there’s an OnDeactivated method/function somewhere!

    For OnUpdate, it’s up to you how to update, easiest way is just to update inside OnRender but you can also create a timer, eg:

    New Timer( 60,OnUpdate )

    in reply to: Http GET/POST #6470

    Mark Sibly
    Keymaster

    This will happen for ios/android eventually, but right now I’m busy with other stuff.

    in reply to: Request: class/struct extention private acces #6469

    Mark Sibly
    Keymaster

    access to private stuffs when using Extension

    Nope.

    a new keyword like Pextension

    What would this do?

    How about using ‘Protected’? Creating a class extension is very much like subclassing a class (in fact, this is how it’s implemented) so it makes sense to me.

    in reply to: V1.0.0 now out and hearts are back! #6431

    Mark Sibly
    Keymaster

    Sorry the delay everyone!

    still waiting for mine donated via PayPal from my Hotmail email but still no heart :/

    Much appreciated, but are you donating regularly? Hearts are reserved for regular contributors sorry!

    in reply to: Monkey 2 Sample App and Audio Issues! #6427

    Mark Sibly
    Keymaster

    The .ogg issue is my fault – fix coming soon!

    Supported formats should be .wav and .ogg. If you have a dud .wav file can you send it to me?

    You can test files in the IDE – just open the file from the ‘Open…’ menu or via the project treeview.

    I’m interested in adding more audio formats but, like video, they need to be patent etc. free – any ideas?

    Is FLAC a good choice for compressed/loseless audio? I guess this’d make it the audio equivalent of png, while ogg is the equivalent of jpg?

    in reply to: Playing with shaders #6426

    Mark Sibly
    Keymaster

    From one hand I would like to see this type of functionality given out of the box in mojo.

    Same here, but time=money etc. I’d already spent a month or 2 on 2d and couldn’t really justify spending more time on the graphics ‘subsystem’, esp. when I had no ‘alternate’ use case for it, such as mojo3d! Plus people were waiting on better IDE, reflection, mobile, website, docs etc etc.

    in reply to: Playing with shaders #6425

    Mark Sibly
    Keymaster

    I can never understand how the stuff happening in the shader gets passed to the graphics card…

    Your shader programs are actually executed on the GPU.

    GPU still renders triangles, but it calls your vertex shader to get the position of each triangle vertex. Vertex shader does this by writing to the built-in gl_Position var. The inputs to the vertex shader program are the vertex buffer data (ie: local position, texcoords, normal etc) and the vertex shader needs to somehow transform the position value to clip space (one model->view->projection matrix multiply is often enough) and write the other to varyings (see below) for interpolation.

    GPU then draws a triangle, scanline by scanline just the way you would in software, only it calls your fragment shader to evaluate the color to actually render each pixel (aka fragment) to the draw buffer. Fragment shader does this by writing to the built-in gl_FragColor var. The inputs to the fragment shader are ‘varying’ values that you have previously set up in the vertex shader – things like vertex color, texcoords etc. The GPU interpolates these for you while it generates the triangle.

    in reply to: Playing with shaders #6395

    Mark Sibly
    Keymaster

    Nice work, and very similiar to what I did to get a little 3d engine going, ie: modify the Vertex struct and rewrite some shaders!

    Do you really need ‘time’ to be a vertex attribute here though? It’s likely to be the same for most (all if your fast enough) vertices, in which case it should really be a ‘uniform’.

    This is where the ‘UniformBlock’ thing comes in – have a look in Cavas for how shader _uniforms are set, and at UniformBlock.Init() for how uniform names are bound. You could bind mx2_Time in UniformBlock.Init() and set mx2_Time somewhere in canvas.

    in reply to: #Import “*.png” or similar yet? #6390

    Mark Sibly
    Keymaster

    Have you got monkey2 working on XP? Have you tried just taking out the CancelIOEx call? I think it’s only used by mx2 debugger…

    in reply to: #Import “*.png” or similar yet? #6384

    Mark Sibly
    Keymaster

    Any news on the #Import “*.png” or similar?

    Probably not for a while now – need to take the ‘make some money’ thing seriously for a bit…

Viewing 15 posts - 886 through 900 (of 1,431 total)