1
0
mirror of https://github.com/narzoul/DDrawCompat synced 2024-12-30 08:55:36 +01:00

46 lines
1.2 KiB
C++

#pragma once
#include <ddraw.h>
#include <Common/CompatPtr.h>
#include <Common/CompatRef.h>
#include <DDraw/Surfaces/Surface.h>
namespace DDraw
{
class PrimarySurface : public Surface
{
public:
PrimarySurface(DWORD origFlags, DWORD origCaps) : Surface(origFlags, origCaps) {}
virtual ~PrimarySurface();
template <typename TDirectDraw, typename TSurface, typename TSurfaceDesc>
static HRESULT create(CompatRef<TDirectDraw> dd, TSurfaceDesc desc, TSurface*& surface);
static HRESULT flipToGdiSurface();
static CompatPtr<IDirectDrawSurface7> getGdiSurface();
static CompatPtr<IDirectDrawSurface7> getBackBuffer();
static CompatPtr<IDirectDrawSurface7> getLastSurface();
static RECT getMonitorRect();
static CompatWeakPtr<IDirectDrawSurface7> getGdiPrimary();
static CompatWeakPtr<IDirectDrawSurface7> getPrimary();
static HANDLE getFrontResource();
static HANDLE getGdiResource();
static DWORD getOrigCaps();
static void updatePalette();
template <typename TSurface>
static bool isGdiSurface(TSurface* surface);
static void updateFrontResource();
static void waitForIdle();
virtual void restore();
static CompatWeakPtr<IDirectDrawPalette> s_palette;
private:
virtual void createImpl() override;
};
}