Mark Sibly

Forum Replies Created

Viewing 15 posts - 301 through 315 (of 1,431 total)
  • Author
    Posts
  • in reply to: Mask shader alpha/blending issue #12041

    Mark Sibly
    Keymaster

    My work here is done…

    in reply to: CRT Shader? #11999

    Mark Sibly
    Keymaster

    Excellent, the shaders are looking really great too!

    I have long wanted to add some kind of ‘full screen 2d shader effect’ API to the mojo view system, but have been reluctant to do this as I’d be more or less ‘guessing’ how people wanted to use it (like 90% of what I do I guess) and it would likely end up cumbersome and nasty.

    But seeing what people are actually wanting to do with shaders and how they want to use them is enormously useful and will hopefully make for some interesting mojo additions one of these days!

    in reply to: CRT Shader? #11996

    Mark Sibly
    Keymaster

     

    What can I run/test that’s crashing?

    Recent shader changes shouldn’t be affecting existing code.

    in reply to: How to load file contained non-latin chars? #11995

    Mark Sibly
    Keymaster

    That’s the web site I linked!

    That’ll teach me to skim read before coffee at 7.00 am…

    And the wchar stuff isn’t all that complex to implement, you just need to be really careful of 2 huge C bogey-men – buffer over-runs and memory leaks!

    in reply to: How to load file contained non-latin chars? #11992

    Mark Sibly
    Keymaster

    “just convert to/from WCHAR” only at the point where the Win32 API requires it

    This is the basic idea but it’s not trivial!

    I should have it mostly done now though – just pushed to develop branch so feel free to check it out.

    There is also a minor chance that I’ve borked something in the process, as this stuff is used in lots of places. Ted2go is a pretty good test of libc/filesystem stuff and that seems to be going OK but still…use with caution.

    Also found this in the process:

    http://utf8everywhere.org/

    A pretty good read on all the issues, and I agree with about 97% of it I think…

    in reply to: String vs CString vs WString #11932

    Mark Sibly
    Keymaster

    What is String type under the hood? Is it utf-8 string?

    No, it’s an internal custom 16 bit per char format.

    Is it ok that LoadString/SaveString using CString instead of WString?

    CString means ‘utf-8’ encoded null terminated string, so yes. WString is not really technically supported yet.

    I tried to use russian letters for window title and I got abrakadabra when app started.

    But if I load the same letters from file – everything is OK.

    Not really sure what you mean here. Please post some sample code if you want me to look at something! This is especially important if international characters are involved as randomly copying and pasting stuff from google in an attempt to try to duplicate problems like this can only get me so far.

    To clarify a bit on the whole windows+utf mess: The problem is typically with API calls where you have to pass a filename or something ‘visible’ (eg: window title) to an OS function.

    All OS’s except windows accept utf-8 cstrings (ie: monkey2 CStrings) for filenames etc which are (conveniently, by design) backward compatible with plain ascii, and are fully handled by monkey2. When a monkey2 string is converted to a CString all information retained as its in utf-8 encoding.

    However, windows requires you to use entirely different APIS if you want to use filenames etc that aren’t plain 7 bit ascii. Monkey2 doesn’t use such APIs yet, so non-ascii chars in filenames etc will cause problems, as monkey2 will still convert to utf-8 cstrings (which are still valid c strings, windows just doesn’t know how to deal with them properly).

    These different APIs uses yet another string type – a WSTRING – which is very close to what monkey2 currently uses internally (although that could change) but needs to be null terminated etc. Note that there is also a c++ std::wstring which is similar to WSTRING but only on some targets. Fun stuff.

    in reply to: Monkey2 conversion #11906

    Mark Sibly
    Keymaster

    I already include Assets the whole directory?

    You need to prefix file name with “asset::” when you load it, eg: Image.Load( “asset::32x32sheet.png” ).

    For texture flags, always use TextureFlags.Dynamic for an image you’re updating frequently (I added some of these I think).

    in reply to: Monkey2 conversion #11904

    Mark Sibly
    Keymaster

    Try building with debug on. You’re missing a ‘=New Int[512,512]’ and an “asset::blah.png”.

    With these fixed I get a smooth scrolling sort of parallax charmap, with random chars all over the place, some sort of animated! Both monkey2 and monkeyx versions look the same to me.

    in reply to: Monkey2 conversion #11897

    Mark Sibly
    Keymaster

    It could be anything  – it could be the fact that monkey2 really uses direct3d, whereas monkey-x  uses ‘pure’ opengl, it could be the way I uploaded textures to the driver, the order of API operations I use, whatever…the point is it’s invalid so don’t do it.

    Drawing an image that you’ve just draw an image to is expansive in Monkey2.

    If you have some runnable sample code, please post it, but nothing that uses undefined or invalid behaviour please!

    [edit]You may be right, there may be some sort of issue here, but testing with invalid code is not the right way to find it.

    in reply to: Monkey2 conversion #11895

    Mark Sibly
    Keymaster

    Ok, that’s pretty hard to follow, but as far as I can tell you’re trying to draw a texture onto itself, ie: you’re drawing ‘image’ to an ‘icanvas’, where icanvas has the same image as a render target. Please correct me if I’m wrong here…

    Anyway, you can’t do this – it’s technically ‘undefined behaviour’ in opengl/gles/webgl and I’m surprised it works at all!

    If you want to do stuff like this, you need to double buffer, ie: have 2 images/icanvses, and draw image0->icanvas1 and  image1->icanvas0 etc and flip between them.

    in reply to: Monkey2 conversion #11892

    Mark Sibly
    Keymaster

    Still not quite sure what you mean here…could you try and explain the problem a bit more clearly.

    I assume it’s speed related as there’s mention of snails in there, and that it’s something to do with drawing images to images but beyond that…?

    Ideally, some nice simple runnable monkey2 code with a clear description of the ‘symptoms’ would be ideal!

    in reply to: Window.ClearColor vs canvas.Clear(color) #11891

    Mark Sibly
    Keymaster

    Here’s a little demo of manually drawing letterbox borders yourself.

    This allows you to turn of windows clearing so there is 0 overdraw, I’m not sure it’ll be significantly faster, or even any faster at all as window clearing should be pretty fast. But it’s still nice to be able to customize letterbox borders…

    If it is significantly faster, it’s probably worth adding an option similar to Window.ClearEnabled to automate it.

    It uses the currently undocumented View.RenderBounds property, but it should be pretty obvious what this does, ie: it’s the view ‘bounds’  in windows coordinates. View bounds is view rect + padding + border + margin.

    in reply to: How to load file contained non-latin chars? #11890

    Mark Sibly
    Keymaster

    Basically, the libc module (and more…) needs to be rewritten for Windows to use the ‘wide char’ versions of various OS filesystem APIs.

    This is not a problem on any other OSes because they all very sensibly use utf-8 c strings for all APIs, which is backwardly compatible with old school ascii and means I can use ‘standard c’ APIs everywhere – except Windows!

    It’ll happen eventually…

    in reply to: Christmas monkey #11873

    Mark Sibly
    Keymaster

    that well-decorated site

    Ha! You mean the xmas lights? They were the painstaking result of a 2 minute google image search!

    I’ll see if I can’t knock something together for here…

    in reply to: Child like DRIVEL #11871

    Mark Sibly
    Keymaster

    Meh, each to their own…locking this now as it’s not really achieving anything.

Viewing 15 posts - 301 through 315 (of 1,431 total)