Guiliani  Version 2.5 revision 7293 (documentation build 13)
GfxEnvWin.h
1/*
2* Copyright (C) TES Electronic Solutions GmbH,
3* All Rights Reserved.
4* Contact: info@guiliani.de
5*
6* This file is part of the Guiliani HMI framework
7* for the development of graphical user interfaces on embedded systems.
8*/
9
10#ifndef __GFX_ENV_WIN__H__
11#define __GFX_ENV_WIN__H__
12
13#include "GfxEnv.h"
14
15#include "GUIRect.h"
16#include <windows.h>
17
19
24class CGfxEnvWin : public CGfxEnv
25{
26public:
37 static eC_Bool CreateInstance(
38 const HWND& hWnd,
39 const SurfaceMode_t& eSurfaceMode,
40 const CGUICommonEnums::ImageType_t& eScreenFormat,
41 const eC_UInt& uiWidth,
42 const eC_UInt& uiHeight,
43 const eC_UInt& uiBufferCount = 1,
44 const eC_Bool& bResizable = false);
45
46#ifdef USE_DEPTH_BUFFER
47 eC_Bool EnterFullscreen();
48 eC_Bool LeaveFullscreen();
49
50 void ClearDepthInfo(const eC_UInt& uiValue);
51 eC_UByte GetDepthInfo(const eC_UInt& uiX, const eC_UInt& uiY);
52 void PutDepthInfo(const eC_UInt& uiX, const eC_UInt& uiY, const eC_UByte& ubValue, const eC_Bool& bDepthTest);
53#endif
54
55protected:
66 const HWND& hWnd,
67 const SurfaceMode_t& eSurfaceMode,
68 const CGUICommonEnums::ImageType_t& eScreenFormat,
69 const eC_UInt& uiWidth,
70 const eC_UInt& uiHeight,
71 const eC_UInt& uiBufferCount = 1,
72 const eC_Bool& bResizable = false);
73
76 virtual ~CGfxEnvWin();
77
78 virtual void EndOfRefresh();
79
80protected:
81 virtual eC_Bool RefreshScreen(const CGUIRect& rkInvalidatedArea);
82
83 virtual void** GetFrameBuffers() const;
84
85 virtual void SetWindowCaption(const eC_String& kCaption);
86
87 virtual eC_Bool SwapBuffers();
88
89private:
90 void CreateScreen();
91
99 LPBITMAPINFO CreateBitmapInfoHeader(
100 USHORT nBPP,
101 DWORD dwCompression,
102 eC_UInt uiWidth,
103 eC_UInt uiHeight);
104
105 void CreateMemoryDC();
106
107#ifdef USE_DEPTH_BUFFER
108 void CreateDepthMemoryDC(const eC_UInt& uiWidth, const eC_UInt& uiHeight);
109#endif
110
111 CGfxEnvWin(const CGfxEnvWin& kSource);
112
113 CGfxEnvWin& operator=(const CGfxEnvWin& kSource);
114
115private:
117 HWND m_hWnd;
118
120 HDC m_hFrontBufferDC;
121
123 HDC* m_hMemoryDC;
124
126 HBITMAP* m_hDCBitmap;
127
129 HBITMAP* m_hOldDCBitmap;
130
132 BYTE** m_pubBits;
133
134 HPEN m_hPen;
135 HPEN m_hPenOld;
136 HBRUSH m_hBrush;
137 HBRUSH m_hBrushOld;
138
139 HGLRC m_hRC;
140
141 eC_UInt m_uiDrawBufferIndex;
142 eC_UInt m_uiDisplayBufferIndex;
143
144#ifdef USE_DEPTH_BUFFER
145 // depth info
146 eC_UInt m_uiDepthWidth;
147 eC_UInt m_uiDepthWidthInPixels;
148 HDC* m_hDepthMemoryDC;
149 HBITMAP* m_hDCDepthBitmap;
150 HBITMAP* m_hOldDCDepthBitmap;
151 BYTE** m_pubDepthBits;
152#endif
153};
154#endif
ImageType_t
Definition: GUICommonEnums.h:80
Helper class to supply a platform independent rectangle implementation.
Definition: GUIRect.h:63
Definition: GfxEnv.h:53
SurfaceMode_t
Definition: GfxEnv.h:60
Implements windows GDI specific features.
Definition: GfxEnvWin.h:25
virtual eC_Bool RefreshScreen(const CGUIRect &rkInvalidatedArea)
virtual void ** GetFrameBuffers() const
virtual void SetWindowCaption(const eC_String &kCaption)
virtual ~CGfxEnvWin()
static eC_Bool CreateInstance(const HWND &hWnd, const SurfaceMode_t &eSurfaceMode, const CGUICommonEnums::ImageType_t &eScreenFormat, const eC_UInt &uiWidth, const eC_UInt &uiHeight, const eC_UInt &uiBufferCount=1, const eC_Bool &bResizable=false)
CGfxEnvWin(const HWND &hWnd, const SurfaceMode_t &eSurfaceMode, const CGUICommonEnums::ImageType_t &eScreenFormat, const eC_UInt &uiWidth, const eC_UInt &uiHeight, const eC_UInt &uiBufferCount=1, const eC_Bool &bResizable=false)
virtual eC_Bool SwapBuffers()
virtual void EndOfRefresh()