Wwise SDK
Version
menu
link
|
Wwise SDK 2025.1.4
|
Creating Resource Files for Your Plug-in
The Resource file (with an .rc extension) describes the resources the plug-in uses to create a custom graphical interface. An easy way to manage Resource files is to use the Visual Studio Editor tool, which you can use to drag widgets onto a canvas to build the GUI. This section explains how to create a Resource file for a new plug-in.
Before you proceed, ensure that you are familiar with the development tools. Refer to Using the Development Tools for more information.
To create a Resource file:
- Run the following command to create a plug-in. For the purposes of this procedure, select an "effect" type plug-in when prompted: python "%WWISEROOT%/Scripts/Build/Plugins/wp.py" new
- Run the following commands to change to the plug-in directory and then call
premake:cd MyPluginpython "%WWISEROOT%/Scripts/Build/Plugins/wp.py" premake Authoring - Open the generated solution file (for example,
MyPlugin_Authoring_Windows_vc160.sln) in Visual Studio 2019. - In the Resource View, select the project name and in the menu bar, click Project > Add New Item. The Add New Item dialog opens.
- In the left pane, select Resource, then in the center pane select Resource File (.rc) and click Add. A
Resource.rcfile is created and appears under the project name in the Resource View. The file is located in the plug-in'sWwisePluginsubdirectory. - In the Resource View, right-click the
Resource.rcfile and click Add Resource. In the Add Resource dialog, select Dialog and click New. A dialog resource is created and appears in the editing pane. - Set the following values in the Properties pane:
- Appearance/Border: None
- Appearance/Clip Children: True
- Appearance/Style: Child
- Misc/Control: True
- Misc/Control Parent: True
- Drag any desired widgets from the Toolbox, located to the left of the editing pane, onto the dialog. When you are finished, click Save.
- From a command prompt in your plug-in directory, run the following two commands in order: The first command includes thepython "%WWISEROOT%/Scripts/Build/Plugins/wp.py" premake Authoringpython "%WWISEROOT%/Scripts/Build/Plugins/wp.py" build -c Release -x x64 -t vc160 Authoring
Resource.rcfile in your project, and the second creates aresource.hfile based on the Resource file. - In the plug-in's
Win32subdirectory, open thePluginNamePluginGUI.hfile and add the following code:This code overrides the methods provided by#pragma once#include "../MyPlugin.h"#include "../resource.h"class MyPluginGUI final: public AK::Wwise::Plugin::PluginMFCWindows{public:MyPluginGUI();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;};AK::Wwise::Plugin::GUIWindowsand ensures that the plug-in uses the custom interface. - Add the following code to the
PluginNamePluginGUI.cppfile:HINSTANCE MyPluginGUI::GetResourceHandle() const{AFX_MANAGE_STATE( AfxGetStaticModuleState() );return AfxGetStaticModuleState()->m_hCurrentResourceHandle;}bool MyPluginGUI::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 MyPluginGUI::WindowProc( AK::Wwise::Plugin::eDialog in_eDialog, HWND in_hWnd, uint32_t 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;} - Save your changes and rebuild the plug-in. It is now available in Wwise as an Effect, which you can add to Wwise objects.
V1::GUIWindows GUIWindows
Latest version of the C++ GUIWindows interface.
Definition: GUIWindows.h:334
Cette page a-t-elle été utile ?
Besoin d'aide ?
Des questions ? Des problèmes ? Besoin de plus d'informations ? Contactez-nous, nous pouvons vous aider !
Visitez notre page d'AideDécrivez-nous de votre projet. Nous sommes là pour vous aider.
Enregistrez votre projet et nous vous aiderons à démarrer sans aucune obligation !
Partir du bon pied avec Wwise