mirror of
https://github.com/narzoul/DDrawCompat
synced 2024-12-30 08:55:36 +01:00
Aiming to fix Alt-Tabbing issues (such as black screen instead of desktop) by temporarily setting the cooperative level to windowed mode, restoring the display mode and minimizing the main window when the app is inactive.
33 lines
927 B
C++
33 lines
927 B
C++
#pragma once
|
|
|
|
#include "CompatVtable.h"
|
|
#include "DDrawTypes.h"
|
|
#include "DirectDrawVtblVisitor.h"
|
|
|
|
template <typename TDirectDraw>
|
|
class CompatDirectDraw : public CompatVtable<CompatDirectDraw<TDirectDraw>, TDirectDraw>
|
|
{
|
|
public:
|
|
typedef typename Types<TDirectDraw>::TCreatedSurface TSurface;
|
|
typedef typename Types<TDirectDraw>::TSurfaceDesc TSurfaceDesc;
|
|
|
|
static void setCompatVtable(Vtable<TDirectDraw>& vtable);
|
|
|
|
static HRESULT STDMETHODCALLTYPE CreateSurface(
|
|
TDirectDraw* This,
|
|
TSurfaceDesc* lpDDSurfaceDesc,
|
|
TSurface** lplpDDSurface,
|
|
IUnknown* pUnkOuter);
|
|
|
|
static HRESULT STDMETHODCALLTYPE RestoreDisplayMode(TDirectDraw* This);
|
|
static HRESULT STDMETHODCALLTYPE SetCooperativeLevel(TDirectDraw* This, HWND hWnd, DWORD dwFlags);
|
|
|
|
template <typename... Params>
|
|
static HRESULT STDMETHODCALLTYPE SetDisplayMode(
|
|
TDirectDraw* This,
|
|
DWORD dwWidth,
|
|
DWORD dwHeight,
|
|
DWORD dwBPP,
|
|
Params... params);
|
|
};
|