JunkBox_Win_Lib 1.5.3
Loading...
Searching...
No Matches
CDx2DView Class Reference

#include <Dx2DView.h>

Inheritance diagram for CDx2DView:
Collaboration diagram for CDx2DView:

Public Member Functions

virtual void ExecRender ()
 
virtual void InitObject (void)
 
virtual void OnInitialUpdate ()
 
- Public Member Functions inherited from CDxBaseView
 CDxBaseView ()
 
virtual ~CDxBaseView ()
 
virtual void SetState (void)
 
virtual void ClearObject (void)
 
virtual void SetParameter (D3DPRESENT_PARAMETERS *d3dParam, int xsize, int ysize)
 
POINT GetWindowDisplaySize (POINT pt)
 
BOOL InitDevice (int xsize=0, int ysize=0, CWnd *cwnd=NULL)
 
virtual int GetMouseButton ()
 
- Public Member Functions inherited from CExView
POINT GetMousePos ()
 
POINT SetWindowSize (int xs, int ys, BOOL first=TRUE)
 
POINT GetWindowSize (POINT pt)
 
POINT GetClientSize (POINT pt)
 
POINT GetWindowReSize (POINT pt)
 
POINT ExecWindowReSize (int xs, int ys)
 
void SetTitle (LPCTSTR title)
 
virtual BOOL SetNewSurface (int ovsbpos=0)
 
virtual void TimerStart (int tm=40)
 
virtual void TimerStop ()
 
virtual void OnDraw (CDC *pDC)
 
virtual ~CExView ()
 
afx_msg BOOL OnEraseBkgnd (CDC *pDC)
 
afx_msg void OnTimer (UINT_PTR nIDEvent)
 

Protected Member Functions

 CDx2DView ()
 
virtual ~CDx2DView ()
 
virtual void AssertValid () const
 
virtual void Dump (CDumpContext &dc) const
 
- Protected Member Functions inherited from CDxBaseView
virtual void OnActivateView (BOOL bActivate, CView *pActivateView, CView *pDeactiveView)
 
- Protected Member Functions inherited from CExView
 CExView ()
 
afx_msg void OnSize (UINT nType, int cx, int cy)
 
afx_msg void OnVScroll (UINT nSBCode, UINT nPos, CScrollBar *pScrollBar)
 
afx_msg BOOL OnMouseWheel (UINT nFlags, short zDelta, CPoint pt)
 

Additional Inherited Members

- Public Attributes inherited from CDxBaseView
LPDIRECT3D9 lpD3D
 
LPDIRECT3DDEVICE9 lpD3DDevice
 
LPDIRECT3DSURFACE9 lpBackBuffer
 
LPDIRECT3DSURFACE9 lpSurface
 
LPDIRECT3DTEXTURE9 lpTexture
 
D3DPRESENT_PARAMETERS d3dParam
 
LPDIRECTINPUT8 lpDInput
 
LPDIRECTINPUTDEVICE8 lpDMouse
 
LPDIRECTINPUTDEVICE8 lpDKeyBoard
 
POINT bufferSize
 
- Public Attributes inherited from CExView
ExCmnHead viewData
 
ExCmnHead cmnHead
 
ExMSGraph< sWordmsGraph
 
CExDocumentpDoc
 
CExFramepFrame
 
CAppCallBackpApp
 
voidanyData
 
BOOL hasViewData
 
CString Title
 
RECT clientRect
 
double sizeXYRate
 
double clientRate
 
double sizeFac
 
int xsize
 
int ysize
 
int zsize
 
int origXSize
 
int origYSize
 
int initXSize
 
int initYSize
 
int prevXSize
 
int prevYSize
 
bool cnstSize
 
bool cnstXSize
 
bool cnstYSize
 
bool cnstXYRate
 
int maxXSize
 
int maxYSize
 
int vSBpos
 
int prevSBpos
 
int vSBmax
 
int vSBntch
 
bool vSBctrl
 
int viewMode
 
int colorMode
 
int cMax
 
int cMin
 
int vMax
 
int vMin
 
bool doReSize
 
- Protected Attributes inherited from CExView
int timerID
 
bool ctrlMouse
 
bool activeWin
 

Detailed Description

Definition at line 29 of file Dx2DView.h.

Constructor & Destructor Documentation

◆ CDx2DView()

CDx2DView ( )
protected

Definition at line 26 of file Dx2DView.cpp.

27{
28 cnstXYRate = true;
29}
bool cnstXYRate
Definition ExView.h:104

◆ ~CDx2DView()

~CDx2DView ( )
protectedvirtual

Definition at line 33 of file Dx2DView.cpp.

34{
35}

Member Function Documentation

◆ AssertValid()

void AssertValid ( ) const
protectedvirtual

Reimplemented from CExView.

Definition at line 62 of file Dx2DView.cpp.

63{
65}
virtual void AssertValid() const
Definition ExView.cpp:130

References CExView::AssertValid().

Here is the call graph for this function:

◆ Dump()

void Dump ( CDumpContext & dc) const
protectedvirtual

Reimplemented from CExView.

Definition at line 69 of file Dx2DView.cpp.

70{
72}
virtual void Dump(CDumpContext &dc) const
Definition ExView.cpp:136

References CExView::cMin, and CExView::Dump().

Here is the call graph for this function:

◆ ExecRender()

void ExecRender ( void )
virtual

Reimplemented from CDxBaseView.

Definition at line 126 of file Dx2DView.cpp.

127{
128 //
130 if (clientRate!=1.0) {
132 szprcnt.Format(_T(" (%d%%)"), (int)(clientRate*100+0.5));
133 Title = Title + szprcnt;
134 }
136 mesg1.LoadString(IDS_STR_UNSPT_DATA);
137 mesg2.LoadString(IDS_STR_IMP_PROCESS);
138 Title = Title + _T(" ") + mesg1 + _T(" [") + mesg2 + _T("]");
139 this->SetTitle(Title);
140
141 HRESULT hr;
142
143 hr = lpD3DDevice->Clear(0, NULL, D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0,0,255), 1.0f, 0);
144 if (FAILED(hr)) {
146 mesg.LoadString(IDS_STR_FAIL_CLR_WND);
147 MessageBox(_T("CDx2DView::ExecRender():\n\n") + mesg);
148 return;
149 }
150
152 if (FAILED(hr)) {
154 mesg.LoadString(IDS_STR_FAIL_TRNS_BAKBUF);
155 MessageBox(_T("CDx2DView::ExecRender():\n\n") + mesg);
156 return;
157 }
158
159 hr = lpD3DDevice->Present(NULL, NULL, NULL, NULL);
160 if (FAILED(hr)) {
162 if (FAILED(hr)) {
165 MessageBox(_T("CDx2DView::ExecRender():\n\n") + mesg);
166 pFrame->SendMessage(WM_CLOSE);
167 //GetParentFrame()->DestroyWindow();
168 }
169 else ExecRender();
170 }
171}
virtual void ExecRender()
Definition Dx2DView.cpp:126
LPDIRECT3DDEVICE9 lpD3DDevice
D3DPRESENT_PARAMETERS d3dParam
LPDIRECT3DSURFACE9 lpBackBuffer
LPDIRECT3DSURFACE9 lpSurface
CString Title
Definition ExView.h:83
CExFrame * pFrame
Definition ExView.h:77
void SetTitle(LPCTSTR title)
Definition ExView.cpp:348
CExDocument * pDoc
Definition ExView.h:76
double clientRate
Definition ExView.h:87
HRESULT ResetDx9Device(LPDIRECT3DDEVICE9, D3DPRESENT_PARAMETERS *, CDxBaseView *pviw=NULL)
#define IDS_STR_FAIL_RESTR_DX9DEV
Definition resource.h:65
#define IDS_STR_FAIL_CLR_WND
Definition resource.h:64
#define IDS_STR_FAIL_TRNS_BAKBUF
Definition resource.h:61
#define IDS_STR_UNSPT_DATA
Definition resource.h:94
#define IDS_STR_IMP_PROCESS
Definition resource.h:95

References CExView::clientRate, CExView::cMin, CDxBaseView::d3dParam, CDx2DView::ExecRender(), IDS_STR_FAIL_CLR_WND, IDS_STR_FAIL_RESTR_DX9DEV, IDS_STR_FAIL_TRNS_BAKBUF, IDS_STR_IMP_PROCESS, IDS_STR_UNSPT_DATA, CDxBaseView::lpBackBuffer, CDxBaseView::lpD3DDevice, CDxBaseView::lpSurface, CExView::pDoc, CExView::pFrame, CExDocument::preTitle, CExDocument::pstTitle, jbxwl::ResetDx9Device(), CExView::SetTitle(), CExDocument::Title, and CExView::Title.

Referenced by CDx2DView::ExecRender().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitObject()

void InitObject ( void )
virtual

Reimplemented from CDxBaseView.

Definition at line 175 of file Dx2DView.cpp.

176{
179 if (!hasViewData) {
181 mesg.LoadString(IDS_STR_FAIL_REINIT_OBJ);
182 MessageBox(_T("CDx2DView::InitObject():\n\n") + mesg);
183 return;
184 }
185}
ExCmnHead cmnHead
Definition ExView.h:73
BOOL hasViewData
Definition ExView.h:81
POINT Dx9GetBackBuffer(LPDIRECT3DDEVICE9, LPDIRECT3DSURFACE9 *)
Definition Dx9.cpp:175
BOOL Dx9SurfaceFromMemory(LPDIRECT3DDEVICE9, LPDIRECT3DSURFACE9 *, CmnHead)
Definition Dx9.cpp:198
#define IDS_STR_FAIL_REINIT_OBJ
Definition resource.h:67

References CExView::cMin, CExView::cmnHead, jbxwl::Dx9GetBackBuffer(), jbxwl::Dx9SurfaceFromMemory(), CExView::hasViewData, IDS_STR_FAIL_REINIT_OBJ, CDxBaseView::lpBackBuffer, CDxBaseView::lpD3DDevice, and CDxBaseView::lpSurface.

Here is the call graph for this function:

◆ OnInitialUpdate()

void OnInitialUpdate ( void )
virtual

Reimplemented from CDxBaseView.

Definition at line 83 of file Dx2DView.cpp.

84{
86 if (isNull(cmnHead.grptr)) return;
87
88 origXSize = cmnHead.xsize;
89 origYSize = cmnHead.ysize;
90 sizeXYRate = (double)cmnHead.ysize/(double)cmnHead.xsize;
91
92 BOOL rslt = InitDevice(cmnHead.xsize, cmnHead.ysize);
93 if (!rslt) {
95 mesg.LoadString(IDS_STR_FAIL_GET_DX9DEV);
96 MessageBox(_T("CDx2DView::OnInitialUpdate():\n\n") + mesg);
98 return;
99 }
100
101 // グラフィックデータ
103 if (bufferSize.x<0) {
105 mesg.LoadString(IDS_STR_FAIL_CRT_BAKBUF);
106 MessageBox(_T("CDx2DView::OnInitialUpdate():\n\n") + mesg);
108 return;
109 }
110
111 // サーフェイスを作成して表示データを読み込む
113 if (!hasViewData) {
116 MessageBox(_T("CDx2DView::OnInitialUpdate():\n\n") + mesg);
118 return;
119 }
120
122 return;
123}
BOOL InitDevice(int xsize=0, int ysize=0, CWnd *cwnd=NULL)
ExCmnHead cmnHead
Definition ExDocument.h:53
bool doneErrorMessage
Definition ExFrame.h:51
int origYSize
Definition ExView.h:95
double sizeXYRate
Definition ExView.h:86
int origXSize
Definition ExView.h:94
POINT SetWindowSize(int xs, int ys, BOOL first=TRUE)
Definition ExView.cpp:156
#define IDS_STR_FAIL_GET_DX9DEV
Definition resource.h:59
#define IDS_STR_FAIL_CRT_BAKBUF
Definition resource.h:60
#define IDS_STR_FAIL_TRNS_SURFACE
Definition resource.h:63

References CDxBaseView::bufferSize, CExView::cMin, CExDocument::cmnHead, CExView::cmnHead, CExFrame::doneErrorMessage, jbxwl::Dx9GetBackBuffer(), jbxwl::Dx9SurfaceFromMemory(), CExView::hasViewData, IDS_STR_FAIL_CRT_BAKBUF, IDS_STR_FAIL_GET_DX9DEV, IDS_STR_FAIL_TRNS_SURFACE, CDxBaseView::InitDevice(), CDxBaseView::lpBackBuffer, CDxBaseView::lpD3DDevice, CDxBaseView::lpSurface, CExView::origXSize, CExView::origYSize, CExView::pDoc, CExView::pFrame, CExView::SetWindowSize(), and CExView::sizeXYRate.

Here is the call graph for this function:

The documentation for this class was generated from the following files: