DDSURF.H
[目次 | 型・クラス・構造体 | マクロ]
1|/**************************************************************************
2| 1. <<< DirectDraw Surface (DDSurf) >>>
3|***************************************************************************/
4|
5|#ifndef __DDSURF_H
6|#define __DDSURF_H
7|
8|#ifdef UNDER_CE
9| #include <ddraw.h>
10| #define IID_IDirectDrawX IID_IDirectDraw4
11| #define IDirectDrawX IDirectDraw4
12| #define IDirectDrawSurfaceX IDirectDrawSurface4
13| #define DDSURFACEDESCX DDSURFACEDESC2
14|#else
15| #include <D:\mssdk\include\ddraw.h>
16| #define IID_IDirectDrawX IID_IDirectDraw7
17| #define IDirectDrawX IDirectDraw7
18| #define IDirectDrawSurfaceX IDirectDrawSurface7
19| #define DDSURFACEDESCX DDSURFACEDESC2
20|#endif
21|
22|
23|/*************************************************************************
24| 2. <<< モジュール設定・優先ヘッダ >>>
25|**************************************************************************/
26|#ifndef USES_PRIORITY_HEADER
27|/*[START_OF_PRIORITY_HEADER]*/
28|
29|#ifndef USES_DDSURF
30|#define USES_DDSURF
31|
32|typedef struct _DDSurf DDSurf;
33|typedef struct _DDSurf_Ovl DDSurf_Ovl;
34|typedef int DDSurf_Type;
35|
36|
37|#endif
38|
39|/*[END_OF_PRIORITY_HEADER]*/
40|#endif
41|
42|
43|/*************************************************************************
44| 3. <<< エラーコード, リターンコード >>>
45|**************************************************************************/
46|
47|#define DDSurf_Err_Some 0
48|
49|
50|/*--------------------------------------------------------------*/
51|/*4. <<< Interface Area -------------------------------------- >>> */
52|/*--------------------------------------------------------------*/
53|
54|#ifdef __cplusplus
55|extern "C" {
56|#endif
57|
58|
59|/**************************************************************************
60| 5. <<< [DDSurf_Type] >>>
61|***************************************************************************/
62|#define DDSurf_RGB 0 /* bit0=0 */
63|#define DDSurf_YUV 1 /* bit0=1 */
64|#define DDSurf_Underlay 2 /* bit1=1 */
65|
66|
67|/**************************************************************************
68| 6. <<< [DDSurf] DirectDraw Primary Surface >>>
69|【補足】
70|・メインとなるサーフェス(プライマリ・サーフェス)です。
71|・内部に、COM クラスと、DirectDrawX クラスを持っています。
72|***************************************************************************/
73|struct _DDSurf {
74| IDirectDrawX* ddraw; /* Direct Draw 全般 */
75| IDirectDrawSurfaceX* surf; /* サーフェス */
76| DDSURFACEDESCX sd; /* サーフェスの情報, dwWidth など */
77|
78| ERRORS_INITCHK_VAR
79|};
80|
81|
82|void DDSurf_init( DDSurf*, HWND mainWnd );
83|void DDSurf_finish( DDSurf* );
84|
85|void DDSurf_drawBmpRes( DDSurf* _this, LPTSTR id, int x, int y );
86|
87|/**************************************************************************
88| 7. <<< [DDSurf_Ovl] DirectDraw Overlay Surface >>>
89|【補足】
90|・追加するサーフェスです。
91|・表示を開始するには、ovflag |= DDOVER_SHOW として、DDSurf_Ovl_update をします。
92|***************************************************************************/
93|struct _DDSurf_Ovl {
94| IDirectDrawSurfaceX* surf; /* サーフェス */
95| DDSURFACEDESCX sd; /* サーフェスの情報 */
96| DDSurf_Type type;
97|
98| RECT scan_rc; /* フレームバッファ中のスキャン位置 */
99| RECT wnd_rc; /* 画面上の表示位置 */
100|
101| DDSurf* prim; /* プライマリ・サーフェスへのリンク */
102| DWORD ovflag; /* 重ね合わせの情報(1)、UpdateOverlay() の第4引数に指定 */
103| DDOVERLAYFX ovfx; /* 重ね合わせの情報(2)、UpdateOverlay() の第5引数に指定 */
104|
105| ERRORS_INITCHK_VAR
106|};
107|
108|void DDSurf_Ovl_init( DDSurf_Ovl* _this, int width, int height, int nBackBuf,
109| DDSurf_Type type, int colorKey, bool bDisp, DDSurf* prim );
110|void DDSurf_Ovl_finish( DDSurf_Ovl* );
111|
112|void DDSurf_Ovl_update( DDSurf_Ovl* _this );
113|void DDSurf_Ovl_disp( DDSurf_Ovl*, bool bDisp );
114|void DDSurf_Ovl_drawBmpRes( DDSurf_Ovl* _this, LPTSTR id, int x, int y );
115|
116|#define DDSurf_NoColorKey -1
117|
118|/**************************************************************************
119| 8. <<< 構造体のデバッグ出力 >>>
120|***************************************************************************/
121|
122|void DDSurf_DDOVERLAYFX_print( DDOVERLAYFX* t, const char* title );
123|
124|
125|#ifdef __cplusplus
126|}
127|#endif
128|
129|/*--------------------------------------------------------------*/
130|/*9. <<< Mapping Area ---------------------------------------- >>> */
131|/*--------------------------------------------------------------*/
132|
133|
134|#endif /* __DDSURF_H */
135|
136|