1 // dxtexView.h : interface of the CDxtexView class
3 /////////////////////////////////////////////////////////////////////////////
5 #if !defined(AFX_DXTXVIEW_H__712C53D1_D63B_11D1_A8B5_00C04FC2DC22__INCLUDED_)
6 #define AFX_DXTXVIEW_H__712C53D1_D63B_11D1_A8B5_00C04FC2DC22__INCLUDED_
10 #endif // _MSC_VER > 1000
13 class CDxtexView
: public CScrollView
15 protected: // create from serialization only
17 DECLARE_DYNCREATE(CDxtexView
)
18 CDxtexDoc
* GetDocument();
24 // ClassWizard generated virtual function overrides
25 //{{AFX_VIRTUAL(CDxtexView)
27 virtual void OnDraw(CDC
* pDC
); // overridden to draw this view
28 virtual void OnInitialUpdate();
30 virtual void OnUpdate(CView
* pSender
, LPARAM lHint
, CObject
* pHint
);
35 virtual ~CDxtexView();
37 virtual void AssertValid() const;
38 virtual void Dump(CDumpContext
& dc
) const;
40 BOOL
TitleModsChanged(VOID
) { return m_bTitleModsChanged
; }
41 VOID
ClearTitleModsChanged(VOID
) { m_bTitleModsChanged
= FALSE
; }
42 CString
GetStrTitleMods(VOID
);
43 VOID
GetImageInfo(CString
& strInfo
);
44 HRESULT
InvalidateDeviceObjects(VOID
);
45 HRESULT
RestoreDeviceObjects(VOID
);
47 // Generated message map functions
49 //{{AFX_MSG(CDxtexView)
50 afx_msg
void OnLButtonUp(UINT nFlags
, CPoint point
);
51 afx_msg
void OnFileOpenSubsurface();
52 afx_msg
void OnFileOpenAlphaSubsurface();
53 afx_msg
void OnFileOpenFace();
54 afx_msg
void OnFileOpenAlphaFace();
55 afx_msg
void OnViewOriginal();
56 afx_msg
void OnViewCompressed();
57 afx_msg
void OnViewAlphaChannel();
58 afx_msg
void OnViewRgbOnly();
59 afx_msg
void OnViewLargerMipLevel();
60 afx_msg
void OnViewSmallerMipLevel();
61 afx_msg
void OnViewZoomIn();
62 afx_msg
void OnViewZoomOut();
63 afx_msg
void OnViewChangeBackgroundColor();
64 afx_msg
void OnViewNegX();
65 afx_msg
void OnViewPosX();
66 afx_msg
void OnViewNegY();
67 afx_msg
void OnViewPosY();
68 afx_msg
void OnViewNegZ();
69 afx_msg
void OnViewPosZ();
70 afx_msg
void OnViewHigherVolumeSlice();
71 afx_msg
void OnViewLowerVolumeSlice();
72 afx_msg
void OnUpdateFileOpenSubsurface(CCmdUI
* pCmdUI
);
73 afx_msg
void OnUpdateFileOpenAlphaSubsurface(CCmdUI
* pCmdUI
);
74 afx_msg
void OnUpdateFileOpenFace(CCmdUI
* pCmdUI
);
75 afx_msg
void OnUpdateFileOpenAlphaFace(CCmdUI
* pCmdUI
);
76 afx_msg
void OnUpdateViewOriginal(CCmdUI
* pCmdUI
);
77 afx_msg
void OnUpdateViewCompressed(CCmdUI
* pCmdUI
);
78 afx_msg
void OnUpdateViewAlphaChannel(CCmdUI
* pCmdUI
);
79 afx_msg
void OnUpdateViewRgbOnly(CCmdUI
* pCmdUI
);
80 afx_msg
void OnUpdateViewLargerMipLevel(CCmdUI
* pCmdUI
);
81 afx_msg
void OnUpdateViewSmallerMipLevel(CCmdUI
* pCmdUI
);
82 afx_msg
void OnUpdateViewZoomIn(CCmdUI
* pCmdUI
);
83 afx_msg
void OnUpdateViewZoomOut(CCmdUI
* pCmdUI
);
84 afx_msg
void OnUpdateViewNegX(CCmdUI
* pCmdUI
);
85 afx_msg
void OnUpdateViewPosX(CCmdUI
* pCmdUI
);
86 afx_msg
void OnUpdateViewNegY(CCmdUI
* pCmdUI
);
87 afx_msg
void OnUpdateViewPosY(CCmdUI
* pCmdUI
);
88 afx_msg
void OnUpdateViewNegZ(CCmdUI
* pCmdUI
);
89 afx_msg
void OnUpdateViewPosZ(CCmdUI
* pCmdUI
);
90 afx_msg
void OnUpdateViewHigherVolumeSlice(CCmdUI
* pCmdUI
);
91 afx_msg
void OnUpdateViewLowerVolumeSlice(CCmdUI
* pCmdUI
);
96 HRESULT
UpdateDevice(VOID
);
97 HRESULT
RenderScene(VOID
);
98 CDxtexApp
* PDxtexApp(VOID
) { return (CDxtexApp
*)AfxGetApp(); }
99 HRESULT
BuildViewSurface(BOOL bOrig
, D3DCUBEMAP_FACES FaceType
, LONG lwSlice
, LONG lwMip
, BOOL bViewAlpha
);
100 HRESULT
LoadSurfaceFromVolumeSlice(LPDIRECT3DVOLUME9 pVolume
, UINT iSlice
, LPDIRECT3DSURFACE9 psurf
);
102 DWORD
NumBytesInSurfaces(D3DCUBEMAP_FACES FaceType
, LPDIRECT3DBASETEXTURE9 ptex
);
103 HRESULT
CreateVertexBuffer(VOID
);
104 CString
FormatName(D3DFORMAT fmt
);
106 LPDIRECT3DVERTEXBUFFER9 m_pVB
;
107 LPDIRECT3DTEXTURE9 m_ptexCur
; // Currently-viewed texture surface
108 LPDIRECT3DSWAPCHAIN9 m_pSwapChain
;
109 CRect m_rcSrc
; // Size of m_pddsCur and m_pddsBack
110 CRect m_rcDest
; // m_rcDest scaled by m_fZoom
111 FLOAT m_fZoom
; // Zoom factor
112 BOOL m_bViewOrig
; // View "original" vs. "new" surface
113 BOOL m_bViewAlpha
; // View alpha channel alone vs. normal image
114 BOOL m_bRgbOnly
; // Display RGB only, no alpha blending
115 BOOL m_bTitleModsChanged
; // Whether title bar text modifiers need to be updated
116 LONG m_lwMipCur
; // Currently-viewed mip. 0 = top, 1 = next one down, etc.
117 D3DCUBEMAP_FACES m_CubeFaceCur
; // D3DCUBEMAP_FACE_FORCE_DWORD = no cube map, or D3DCUBEMAP_FACE_POSITIVE_X, etc.
118 LONG m_lwSliceCur
; // For volume maps
119 DWORD m_dwClearColor
; // Background color that will show through where alpha is non-opaque
122 #ifndef _DEBUG // debug version in dxtexView.cpp
123 inline CDxtexDoc
* CDxtexView::GetDocument()
124 { return (CDxtexDoc
*)m_pDocument
; }
127 /////////////////////////////////////////////////////////////////////////////
129 //{{AFX_INSERT_LOCATION}}
130 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
132 #endif // !defined(AFX_DXTXVIEW_H__712C53D1_D63B_11D1_A8B5_00C04FC2DC22__INCLUDED_)