Enabling an extension to work in HWA?

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.
  • Hey all, Liji recently sent me the code for his 'Pixel object' - and I was wondering what it takes to enable it to work in HWA mode?

    Currently the extension just crashes the runtime if tried to run under HWA.

    Essentially my goal is to be able to grab a pixel color in a specific location to three variables separately. (R,G,B stored in 3 separate variables)

    Any thoughts on this anyone?

  • Hi Chaos,

    I do not think that this extension need special HWA function. So did you try to build with HWA in edif and debug?
    I tried with the DebugObject from Phi but it does not give a lot of information about the crash (just that it crashed on GenerateEvent in Edif.Runtime.cpp). It is better with the source code.

    Damien

  • Did I understand correctly: Liji sent you the C++ code, did he?
    If so, did you try to compile and debug with Visual Studio?
    Without Visual Studio, I tried directly with MMF and the DebugObject from PHI but it does not help a lot o find the source of the crash.

    Damien

  • Unfortunately there's no way to enable HWA support for the Pixel Object, unless someone would figure out how to access the Direct3D internals of MMF and then read directly from the pixel buffer...
    I expected it to crash btw, any call to MMF's GetPixel() function on a HWA surface will crash.

    Please login to see this link.

  • Yes that would be fantastic! I look forward to seeing results of your attempt conceptgame!

    I plan on using this to pick up colors from the terrain, to indicate what terrain type it is, without having a ton of masks or sensors. :D

  • I managed to get it work for GetPixel thanks to Yves 2 days ago. But not in the way we want it with Looki. And I am still trying to make it work for SetPixel since it is also a part of this extension. If you only need GetPixel Chaos, I can give a special extension with only this Expression.

    Damien

  • Yes of course. I tried as said above but I just got an empty surface. It did not crash, that was the good point.
    The trick is to use one of the HWA texture which is created in the video memory. You blit the application surface to this temp surface and used it as base to blit on a DIB surface.
    You can then call GetPixel.


    My main concern is that this surface is slow writing according to comments, so it cannot really be used for what I thought.

    Code
    ST_HWA_ROUTEXTURE,            // HWA texture created in video memory, unmanaged (lost when device is lost). Slow writing, should be treated read-only

    Indeed, Yves is a busy man. I really need to to talk with him at the next convention to understand the whole surface topic. I hope he should come and have more time to explain.

    Damien

  • Ohh, sorry. I didn't know you use a software fallback. I didn't even think about that, but yes I guess it's a bit slow. Probably still good enough if you only blit each frame (60 times a sec) and not on every get pixel call ;)

    Please login to see this link.

  • This extension would allow me to get a pixel color at a specific coordinate? I don't need to change any colors at all, just get the RGB value of it, preferably broken into individual colors. IE. GetRed, GetGreen, GetBlue

Participate now!

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