Files
itgmania212121/stepmania/src/RageMovieTexture.h
T

116 lines
3.6 KiB
C++
Raw Normal View History

/*
-----------------------------------------------------------------------------
Class: RageMovieTexture
Desc: Based on the DShowTextures example in the DX8 SDK.
2002-04-16 17:31:00 +00:00
Copyright (c) 2001-2002 by the persons listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
2001-11-03 10:52:42 +00:00
#ifndef _RAGEMOVIETEXTURE_H_
#define _RAGEMOVIETEXTURE_H_
#include "RageScreen.h"
#include <d3dx8.h>
//#include <d3d8types.h>
#include <atlbase.h>
#include "baseclasses/streams.h"
2001-11-03 10:52:42 +00:00
//-----------------------------------------------------------------------------
// Define GUID for Texture Renderer
// {71771540-2017-11cf-AE26-0020AFD79767}
//-----------------------------------------------------------------------------
struct __declspec(uuid("{71771540-2017-11cf-ae26-0020afd79767}")) CLSID_TextureRenderer;
2001-12-19 01:50:57 +00:00
class RageMovieTexture;
2001-11-03 10:52:42 +00:00
//-----------------------------------------------------------------------------
// CTextureRenderer Class Declarations
//
// Usage: 1) CheckMediaType is called by the graph
// 2) SetMediaType is called by the graph
// 3) call GetVidWidth and GetVidHeight to get texture information
// 4) call SetRenderTarget
// 5) Do RenderSample is called by the graph
//-----------------------------------------------------------------------------
class CTextureRenderer : public CBaseVideoRenderer
{
public:
CTextureRenderer(LPUNKNOWN pUnk,HRESULT *phr);
~CTextureRenderer();
public:
// overwritten methods
HRESULT CheckMediaType(const CMediaType *pmt ); // Format acceptable?
HRESULT SetMediaType(const CMediaType *pmt ); // Video format notification
HRESULT DoRenderSample(IMediaSample *pMediaSample); // New video sample
// new methods
LONG GetVidWidth() {return m_lVidWidth;};
LONG GetVidHeight(){return m_lVidHeight;};
2001-12-19 01:50:57 +00:00
HRESULT SetRenderTarget( RageMovieTexture* pTexture );
2001-12-28 10:15:59 +00:00
BOOL IsLocked(int iIndex) { return m_bLocked[iIndex]; };
2001-11-03 10:52:42 +00:00
protected:
LONG m_lVidWidth; // Video width
LONG m_lVidHeight; // Video Height
LONG m_lVidPitch; // Video Pitch
2001-12-19 01:50:57 +00:00
RageMovieTexture* m_pTexture; // the video surface we will copy new frames to
2001-11-03 10:52:42 +00:00
D3DFORMAT m_TextureFormat; // Texture format
2001-12-28 10:15:59 +00:00
BOOL m_bLocked[2]; // Is the texture currently locked while we
2001-11-03 10:52:42 +00:00
// copy the movie frame to it?
};
//-----------------------------------------------------------------------------
// RageMovieTexture Class Declarations
//-----------------------------------------------------------------------------
class RageMovieTexture : public RageTexture
{
public:
2002-04-28 20:42:32 +00:00
RageMovieTexture(
RageScreen* pScreen,
const CString &sFilePath,
const DWORD dwMaxSize,
const DWORD dwTextureColorDepth,
const DWORD dwHints );
2001-11-03 10:52:42 +00:00
virtual ~RageMovieTexture();
2002-04-28 20:42:32 +00:00
virtual void Reload(
const DWORD dwMaxSize,
const DWORD dwTextureColorDepth,
const DWORD dwHints );
2001-11-03 10:52:42 +00:00
LPDIRECT3DTEXTURE8 GetD3DTexture();
2001-12-19 01:50:57 +00:00
LPDIRECT3DTEXTURE8 m_pd3dTexture[2]; // double buffered
int m_iIndexActiveTexture; // either 0 or 1
2001-11-03 10:52:42 +00:00
protected:
virtual VOID Create();
virtual HRESULT CreateD3DTexture();
virtual HRESULT InitDShowTextureRenderer();
virtual HRESULT PlayMovie();
virtual void CheckMovieStatus();
virtual void CleanupDShow();
//-----------------------------------------------------------------------------
// DirectShow pointers
//-----------------------------------------------------------------------------
CComPtr<IGraphBuilder> m_pGB; // GraphBuilder
CComPtr<IMediaControl> m_pMC; // Media Control
CComPtr<IMediaPosition> m_pMP; // Media Postion
CComPtr<IMediaEvent> m_pME; // Media Event
CTextureRenderer *m_pCTR; // DShow Texture renderer
2001-12-19 01:50:57 +00:00
2001-11-03 10:52:42 +00:00
};
#endif