mirror of
https://github.com/narzoul/DDrawCompat
synced 2024-12-30 08:55:36 +01:00
This change assigns a different DirectDraw repository object for each original DirectDraw object that requires temporary surfaces, ensuring that video memory surfaces are created on the appropriate device on a multi-GPU system.
32 lines
519 B
C++
32 lines
519 B
C++
#pragma once
|
|
|
|
#define CINTERFACE
|
|
|
|
#include <ddraw.h>
|
|
|
|
#include "Common/CompatRef.h"
|
|
#include "Common/CompatWeakPtr.h"
|
|
|
|
namespace DDraw
|
|
{
|
|
namespace Repository
|
|
{
|
|
struct Surface
|
|
{
|
|
void* ddObject;
|
|
DDSURFACEDESC2 desc;
|
|
CompatWeakPtr<IDirectDrawSurface7> surface;
|
|
};
|
|
|
|
class ScopedSurface : public Surface
|
|
{
|
|
public:
|
|
ScopedSurface(CompatRef<IDirectDraw7> dd, const DDSURFACEDESC2& desc);
|
|
~ScopedSurface();
|
|
};
|
|
|
|
CompatWeakPtr<IDirectDraw7> getDirectDraw();
|
|
void onRelease(void* ddObject);
|
|
}
|
|
}
|