Version

menu_open
Wwise SDK 2021.1.14
How to Create a Resource File For your Plug-in

Resource file (with .rc as the extension) is a file format used to describe the resources used by the plug-in to create a custom graphical interface. An easy way to manage Resource files is to use the Visual Studio Editor tool, which lets you drag-and-drop widgets on a canvas to build the GUI. Here are the steps to create a Resource file for a new plug-in.

First of all, create a new plug-in with wp.py (if you're not familiar with the development tools, refer to Using the Development Tools).

python "%WWISEROOT%/Scripts/Build/Plugins/wp.py" new

Answer the prompts and when the plug-in is created, change directory to the project folder and call premake.

cd MyNewFX
python "%WWISEROOT%/Scripts/Build/Plugins/wp.py" premake Authoring

Open the generated solution file (.sln) in Visual Studio 2019, make sure that the project folder is highlighted (do not confuse this with the solution folder, otherwise the Add New Item choices will be different) and select Add New Item... in the Project menu. In the dialog window, select Resource in the left column, and then Resource File (.rc) in the middle pane. This will create a file named Resource.rc in the WwisePlugin folder of your project.

In the Resource View, right-click on the Resource.rc file and select Add Resource. In the Add Resource window, select Dialog and click the New button.

Note: When you create a DIALOG window, make sure you set the following styles in its Properties:
  • Appearance/Border = None
  • Appearance/Clip Children = True
  • Appearance/Style = Child
  • Misc/Control = True
  • Misc/Control Parent = True

Using the Toolbox tab on the left side of the interface, you should now be able to drag-and-drop widgets on the canvas to compose the graphical interface of the plug-in. Saving the project will update the Resource file.

To include the Resource.rc file in your project, all you have to do is to call premake again. Then, the next time you build your plug-in, a file called resource.h will be automatically generated based on the Resource file:

python "%WWISEROOT%/Scripts/Build/Plugins/wp.py" build -c Release -x x64 -t vc160 Authoring

To tell the plug-in to use the custom interface, you need to override the methods provided by AK::Wwise::Plugin::GUIWindows. In Win32/PluginNamePluginGUI.h, include resource.h, add the method signatures and create a private variable to store a window handle:

#pragma once
#include "../MyNewFXPlugin.h"
#include "../resource.h"
class MyNewFXPluginGUI final
    : public AK::Wwise::Plugin::PluginMFCWindows<>
{
public:
    MyNewFXPluginGUI();
    HINSTANCE GetResourceHandle() const override;
    bool GetDialog(
        AK::Wwise::Plugin::eDialog in_eDialog,
        UINT& out_uiDialogID,
        AK::Wwise::Plugin::PopulateTableItem*& out_pTable
    ) const override;
 
    bool WindowProc(
        AK::Wwise::Plugin::eDialog in_eDialog,
        HWND in_hWnd,
        uint32_t in_message,
        WPARAM in_wParam,
        LPARAM in_lParam,
        LRESULT& out_lResult
    ) override;
private:
    HWND m_hwndPropView = nullptr;
};

In Win32/PluginNamePluginGUI.cpp, add the implementation of these methods:

HINSTANCE MyNewFXPluginGUI::GetResourceHandle() const
{
    AFX_MANAGE_STATE( AfxGetStaticModuleState() );
    return AfxGetStaticModuleState()->m_hCurrentResourceHandle;
}
bool MyNewFXPluginGUI::GetDialog( AK::Wwise::Plugin::eDialog in_eDialog, UINT & out_uiDialogID, AK::Wwise::Plugin::PopulateTableItem *& out_pTable ) const
{
    AKASSERT( in_eDialog == AK::Wwise::Plugin::SettingsDialog );
    out_uiDialogID = IDD_DIALOG1;
    out_pTable = nullptr;
    return true;
}
bool MyNewFXPluginGUI::WindowProc( AK::Wwise::Plugin::eDialog in_eDialog, HWND in_hWnd, UINT in_message, WPARAM in_wParam, LPARAM in_lParam, LRESULT & out_lResult )
{
    switch ( in_message )
    {
    case WM_INITDIALOG:
        m_hwndPropView = in_hWnd;
        break;
    case WM_DESTROY:
        m_hwndPropView = NULL;
        break;
    }
    out_lResult = 0;
    return false;
}

Recompile and load the plug-in in a Wwise project. You should now see your custom graphical interface.

V1::GUIWindows GUIWindows
Latest version of the C++ GUIWindows interface.
Definition: GUIWindows.h:335

Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise