-
Notifications
You must be signed in to change notification settings - Fork 48
Configurator API
bolrog edited this page Apr 11, 2021
·
1 revision
ID2DXConfigurator is a pseudo-COM interface that can be used to integrate with D2DX. It is suitable e.g. for "high-res" mods that want to use arbitrary resolutions.
It can be accessed via the helper d2dx::TryGetConfigurator, or manually by using LoadLibrary/GetProcAddress to get a pointer to _D2DXGetConfigurator@4.
Note that the object is not really refcounted and there's no need to call AddRef/Release.
Note also that the built-in resolution mod in D2DX will be disabled if D2DXGetConfigurator is called prior to the first Glide call made.
Example use:
ID2DXConfigurator* d2dxConfigurator = d2dx::TryGetConfigurator();
if (d2dxConfigurator)
{
d2dxConfigurator->SetCustomResolution(1000, 500);
}
grSstWinOpen(hWnd, ...)
MIDL_INTERFACE("B11C5FA4-983F-4E34-9E43-BD82F9CCDB65")
ID2DXConfigurator : public IUnknown
{
public:
/*
Tell D2DX that the following call(s) to grSstWinOpen intends this custom resolution,
and to ignore the 'screen_resolution' argument. To return to normal behavior, call
this method with a width and height of zero.
Returns S_OK on success and an HRESULT error code otherwise.
*/
virtual HRESULT STDMETHODCALLTYPE SetCustomResolution(
int width,
int height) = 0;
/*
Get a suggested custom resolution from D2DX (typically close to 640x480 or 800x600,
but in the aspect ratio of the monitor).
This method allows matching D2DX's default behavior.
Returns S_OK on success and an HRESULT error code otherwise.
*/
virtual HRESULT STDMETHODCALLTYPE GetSuggestedCustomResolution(
/* [out] */ int* width,
/* [out] */ int* height) = 0;
};