User Tag List

Results 1 to 3 of 3

Thread: How can I use HWA in an extension?

  1. #1
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Phi's Avatar
    Join Date
    Jan 2010
    Location
    England
    Posts
    1,811
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)

    Question How can I use HWA in an extension?

    Hey devvers,
    I have an extension that displays on Fusion's window. It outputs a bitmap, or cSurface * aka LPSURFACE.
    What are the steps I need to take in order to get it to use HWA?

    Cheers

  2. #2
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)

    Join Date
    Aug 2008
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Phi, I don't know if I'm using actually HWA surfaces, but when compiling with HWA target on EDIF SDK, I get a performance boost and all my shaders work. So I suppose it's using HWA at all.

  3. #3
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Phi's Avatar
    Join Date
    Jan 2010
    Location
    England
    Posts
    1,811
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)

    Lightbulb

    Thanks ricko. In my case I'm manually messing with graphics, so it's more complicated.
    Extract from email from Yves:

    You can create 2 types of HWA surfaces from an extension:
    • ST_HWA_RTTEXTURE
      What is it : Render target texture in HWA mode.
      What you can do : blit other surfaces into it, blit to screen.
      What you can't do : GetDC, LockBuffer, GetPixel/SetPixel, etc.
      When to use it : when you have an intermediate surface that you blit other surfaces into before you render it to the screen.
      Note: Creating a render target takes time, so cache it if possible.
    • ST_HWA_ROMTEXTURE
      What is it : HWA texture created in video memory, managed. Managed means that the texture is restored when the device is lost.
      What you can do : blit to screen only
      What you can't do : GetDC, LockBuffer, GetPixel/SetPixel, blit to non surfaces that aren't render target or HWA screen, etc...
      When to use it : when you have a cached fixed image that you want to blit to screen.


    For example:

    Code:
        LPSURFACE ps = WinGetSurface((int)rhPtr->rhIdEditWin);
        BOOL bHWA = ((rhPtr->rh4.rh4Mv->mvAppMode & SM_D3D) != 0);
        LPSURFACE pProto = ps;
        if ( bHWA )
            GetSurfacePrototype(&pProto, ps->GetDepth(), ST_HWA_RTTEXTURE, ps->GetDriver());
        LPSURFACE randomSurface = new cSurface();
        randomSurface->Create(rdPtr->rHo.hoImgWidth, rdPtr->rHo.hoImgHeight, pProto);
    HWA surfaces are more limited than normal surfaces.

Similar Threads

  1. [PAID] [EXTENSION REQUEST] Collision Extension
    By butterfingers in forum Fusion 2.5
    Replies: 22
    Last Post: 1st May 2019, 01:58 PM
  2. Extension manager not show any extension
    By pradeep in forum Fusion 2.5
    Replies: 7
    Last Post: 2nd April 2017, 11:44 PM
  3. Replies: 4
    Last Post: 30th July 2016, 07:09 AM
  4. [PAID] Extension developer wanted - data / array extension
    By SirEatAlot in forum Paid Design & Development Requests
    Replies: 2
    Last Post: 3rd June 2015, 05:29 PM
  5. MMF2 Extension Request : OE-Cake Fluid extension
    By pyromane in forum Extension Development
    Replies: 5
    Last Post: 1st July 2013, 03:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •