Subversion Repositories spk

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
79 cycrow 1
//************************************************************************
2
//
3
// LCDGfx.h
4
//
5
// The CLCDGfx class abstracts GDI/bitmap details. It is used in the
6
// OnDraw event.
7
// 
8
// Logitech LCD SDK
9
//
10
// Copyright 2005 Logitech Inc.
11
//************************************************************************
12
 
13
#ifndef _LCDGFX_H_INCLUDED_ 
14
#define _LCDGFX_H_INCLUDED_ 
15
 
16
#include <windows.h>
17
#include <tchar.h>
18
#include <lglcd.h>
19
 
20
 
21
#ifndef LCDUITRACE
22
    // .NET compiler uses __noop intrinsic
23
    #if _MSC_VER > 1300
24
        #define LCDUITRACE __noop
25
    #else
26
        #define LCDUITRACE (void)0
27
    #endif
28
#endif
29
 
30
#ifndef LCDUIASSERT
31
    // .NET compiler uses __noop intrinsic
32
    #if _MSC_VER > 1300
33
        #define LCDUIASSERT __noop
34
    #else
35
        #define LCDUIASSERT (void)0
36
    #endif
37
#endif
38
 
39
 
40
 
41
class CLCDGfx
42
{
43
public:
44
    CLCDGfx(void);
45
    virtual ~CLCDGfx(void);
46
 
47
    HRESULT Initialize(int nWidth, int nHeight);
48
    void Shutdown(void);
49
 
50
    void BeginDraw(void);
51
    void ClearScreen(void);
52
    void SetPixel(int nX, int nY, BYTE bValue);
53
    void DrawLine(int nX1, int nY1, int nX2, int nY2);
54
    void DrawFilledRect(int nX, int nY, int nWidth, int nHeight);
55
    void DrawText(int nX, int nY, LPCTSTR sText);
56
    void EndDraw(void);
57
 
58
    HDC GetHDC(void);
59
    lgLcdBitmap160x43x1 *GetLCDScreen(void);
60
    BITMAPINFO *GetBitmapInfo(void);
61
    HBITMAP GetHBITMAP(void);
62
 
63
protected:
64
    int m_nWidth;
65
    int m_nHeight;
66
    lgLcdBitmap160x43x1 *m_pLCDScreen;
67
    BITMAPINFO *m_pBitmapInfo;
68
    HDC m_hDC;
69
    HBITMAP m_hBitmap;
70
    HBITMAP m_hPrevBitmap;
71
    PBYTE m_pBitmapBits;
72
};
73
 
74
 
75
#endif // !_LCDGFX_H_INCLUDED_ 
76
 
77
//** end of LCDGfx.h *****************************************************