From d640dbc9d961d6c7bb9262d52cb5d5956e47523a Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 22 Mar 2007 18:58:40 +0000 Subject: [PATCH] add RageTextureLock --- stepmania/src/RageDisplay.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/stepmania/src/RageDisplay.h b/stepmania/src/RageDisplay.h index 984485625f..eda7ce176b 100644 --- a/stepmania/src/RageDisplay.h +++ b/stepmania/src/RageDisplay.h @@ -145,6 +145,19 @@ struct RenderTargetParam bool bFloat; }; +struct RageTextureLock +{ + virtual ~RageTextureLock() { } + + /* Given a surface with a format and no pixel data, lock the texture into the + * surface. The data is write-only. */ + virtual void Lock( unsigned iTexHandle, RageSurface *pSurface ) = 0; + + /* Unlock and update the texture. If bChanged is false, the texture update + * may be omitted. */ + virtual void Unlock( RageSurface *pSurface, bool bChanged = true ) = 0; +}; + class RageDisplay { friend class RageTexture; @@ -206,6 +219,9 @@ public: int xoffset, int yoffset, int width, int height ) = 0; virtual void DeleteTexture( unsigned iTexHandle ) = 0; + /* Return an object to lock pixels for streaming. If not supported, returns NULL. + * Delete the object normally. */ + virtual RageTextureLock *CreateTextureLock() { return NULL; } virtual void ClearAllTextures() = 0; virtual int GetNumTextureUnits() = 0; virtual void SetTexture( TextureUnit tu, unsigned iTexture ) = 0;