///////////////////////////////////////////////////////////////////////
// Header file: "Text.h"
//
// (C) Copyright 2001, RightMark Gathering.  All Rights Reserved.
//
// @Author: Konstantin Mironovich (km) develop@rightmark3d.org
//
// Purpose: interface for the CText class
//
// History: 
//   2001/11/10 created. (km)
//
///////////////////////////////////////////////////////////////////////

#pragma once

#define KEY_COLOR   0x00000000L
//#define KEY_COLOR   0x00ff00ffL     // magenta

class CText  
{
public:
    CText(IDirectDraw7 *pdd, IDirectDrawSurface7 *pds, int w, int h);
    virtual ~CText();

    HRESULT Initialize(void);
    HRESULT Terminate(void);

    HRESULT Draw(void);
    HRESULT Set(LPCTSTR msg, int x = 0, int y = 0);
    HRESULT SetFont(LPCTSTR name, int height, int flag = 0);
    HRESULT SetColor(COLORREF text, COLORREF shadow);

private:
    IDirectDrawSurface7 *m_pbs;     // DD7 back drawsurface
    IDirectDrawSurface7 *m_pts;     // DD7 text surface
    IDirectDraw7 *m_pdd;            // DD7 object

    COLORREF m_Shade;               // text shadow color
    COLORREF m_Color;               // text color
    CRect m_Rect;
    CFont m_Font;
    int m_Width;
    int m_Height;
    
    bool m_IsInitialized;

private:
    CText();
	HRESULT Clear(void);
	HRESULT Clear(LPRECT rc);
	HRESULT Clear(CRect& rc);
};

