#pragma once
#include "BKOscScr_Shared.h"

#ifdef BKOSCDLL_EXPORTS
#define BKOSCDLL_API __declspec(dllexport)
#else
#define BKOSCDLL_API __declspec(dllimport)
#endif


#include <d2d1.h>
//#include <d2d1helper.h>

BKEXTERN_C class BKOSCDLL_API CBKOscScrD2D: public CBKOScScr_Shared
{
		D2D1_RECT_F            m_rectWnd{}; // размеры viewportа в оконном режиме

		ID2D1Factory          *m_pDirect2dFactory{ nullptr };
		ID2D1HwndRenderTarget *m_pRenderTarget{ nullptr };
		ID2D1SolidColorBrush  *m_pLightSlateGrayBrush{ nullptr };
		ID2D1SolidColorBrush  *m_pWhiteBrush{ nullptr };
		ID2D1SolidColorBrush  *m_pGreenBrush{ nullptr };
		ID2D1StrokeStyle      *m_pStrokeStyleCustomOffsetZero{ nullptr };

		HRESULT             CreateFactory();

	public:
		virtual void        BKOSC_OnDisplay(_Notnull_ SAMPLE_INT *inBuf, int inLen) noexcept override;
		virtual HRESULT     BKOSC_Screen_Init(_Notnull_ CWnd *pWndScreen) override;
		virtual void        BKOSC_Screen_Done() noexcept override;
		virtual void        BKOSC_OnSize(int cx, int cy) noexcept override;
		virtual HRESULT     BKOSC_OnSetBuffer(int nLen) override;

		CBKOscScrD2D() noexcept;
		virtual ~CBKOscScrD2D() override;
};
