Screen scaling extension questions

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Hello,

    I want to create an extension that ideally would augment the way the game viewport is upscaled when "Resize display to fill window size" is checked. I'm assuming this would involve calling WinGetSurface, processing the pixel values myself, and then... well... I'm not really sure.

    Let's assume my game is 640x480. I call WinGetSurface and process the pixel values, creating a 1280x960 cSurface. How can I get MMF to display this surface, considering its main surface is still only 640x480? In my mind there are two options:

    1.) Somehow resize the cSurface attached to the main window, then blit the new stuff onto it. Except, I can't seem to find a function in the documentation that says it does this. Even if there was one, I wonder if it would do what I'd expect it to when the surface gets drawn.
    2.) Try and set up the window to draw the new surface myself. Except, wouldn't MMF be wasting processing power by still drawing the old surface underneath? How can I stop that from happening?

    If someone who knows about the MMF2 SDK could nudge me in the right direction, I'd be very grateful.

    Thanks,
    Sebastian

    Please login to see this link. (Indie games and Fusion resources)
    For freelance inquiries please email admin at ultimatewalrus.com

  • Hi,

    As we all know, the MMF runtime has come a long way and was never really meant to be tinkered with, so I can imagine this being virtually impossible from an extension! Anyway...
    1) To resize the main surface what you would try is calling ->Delete() and ->Create() on it (and make sure to look out for variables holding the size of that surface, knowing the runtime there probably are some.. besides cSurface::GetWidth/Height.) I think this might work because I doubt that MMF ever recreates the main surface on its own.. why would it? Doesn't make sense.
    2) I'm not sure if I get it. Do you want to implement a complete new rendering routine that draws all objects etc. to a Surface...? I think you might run into big issues with default objects like Actives there. You can't draw specific Active frames, for example...
    PS You can always write Yves a PM about this, I think he wrote most of this part of MMF. He's a busy man, and it might take him a few days to respond in the worst case, but he always gives very good answers if you ever have questions about the way MMF works. Plus, I'm really unsure if there's any way to turn off MMF's rendering at runtime (There is an option in MMF2 dev for this, per frame).

    Another question, though - what exactly is the point of this extension - by augment, do you mean that you want to extend the size of the canvas when the window is resized? Instead of zooming, get more pixels to work with? In that case, isn't that already possible without extensions? I've done things like that with the Window Control object and some application settings.

    Please login to see this link.

  • Hi Looki,

    The intent of the extension is not to re-render the scene, but to take the pixels that have already been rendered to the main surface and upscaling them to a higher resolution using an Please login to see this link..

    The method you described sounds like it could work though! I forgot I could PM Yves. Maybe I'll do a quick test of your method to see if I even need to bother him with it.

    Thanks!

    Please login to see this link. (Indie games and Fusion resources)
    For freelance inquiries please email admin at ultimatewalrus.com

  • Took a lot of fiddling but I believe I got some rudimentary code working:

    Thank you Looki!!

    Please login to see this link. (Indie games and Fusion resources)
    For freelance inquiries please email admin at ultimatewalrus.com

  • ...shoot. Doesn't look like it works in HWA (just get a blank screen). Guess I'll have to ask Yves after all.

    Please login to see this link. (Indie games and Fusion resources)
    For freelance inquiries please email admin at ultimatewalrus.com

  • Ahh, that sounds more reasonable to implement. I didn't know you wanted HWA compabibility, because as LB said, HWA works... differently. There's no HWA SDK, but the latest SDK version comes with some HWA enums, e.g. HWA surface types and buffer types.. but I don't know how that would help here, since you're creating the surface based on the prototype of the older surface anyway. I think PMing Yves here would be the best choice, however I think that implementing scaling algorithms on the CPU in HWA seems like a waste, you should just use shaders there - except HWA has problems with shader model 3.0+, so it might be hard implementing those.

    Please login to see this link.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!