Files
Aerofoil/PortabilityLayer/QDGraf.h

45 lines
717 B
C
Raw Normal View History

#pragma once
#include <stdint.h>
#include "GpPixelFormat.h"
#include "QDState.h"
#include "QDPort.h"
struct PixMap;
struct Rect;
2019-12-21 18:40:17 -05:00
struct IGpDisplayDriverSurface;
struct CGraf
{
CGraf()
: m_port(PortabilityLayer::QDPortType_CGraf)
2019-12-21 18:40:17 -05:00
, m_ddSurface(nullptr)
{
}
explicit CGraf(PortabilityLayer::QDPortType overridePortType)
: m_port(overridePortType)
, m_ddSurface(nullptr)
{
}
int Init(const Rect &rect, GpPixelFormat_t pixelFormat)
{
if (int errorCode = m_port.Init(rect, pixelFormat))
return errorCode;
return 0;
}
2019-12-21 18:40:17 -05:00
bool Resize(const Rect &rect)
{
return m_port.Resize(rect);
}
// Must be the first item
PortabilityLayer::QDPort m_port;
2019-12-21 18:40:17 -05:00
IGpDisplayDriverSurface *m_ddSurface;
};