source: OGRE/trunk/ogrenew/RenderSystems/Direct3D7/include/OgreD3D7HardwarePixelBuffer.h @ 657

Revision 657, 2.6 KB checked in by mattausch, 19 years ago (diff)

added ogre dependencies and patched ogre sources

Line 
1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4    (Object-oriented Graphics Rendering Engine)
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2005 The OGRE Team
8Also see acknowledgements in Readme.html
9
10This program is free software; you can redistribute it and/or modify it under
11the terms of the GNU Lesser General Public License as published by the Free Software
12Foundation; either version 2 of the License, or (at your option) any later
13version.
14
15This program is distributed in the hope that it will be useful, but WITHOUT
16ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
18
19You should have received a copy of the GNU Lesser General Public License along with
20this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21Place - Suite 330, Boston, MA 02111-1307, USA, or go to
22http://www.gnu.org/copyleft/lesser.txt.
23-----------------------------------------------------------------------------
24*/
25#ifndef __D3D7PIXELBUFFER_H__
26#define __D3D7PIXELBUFFER_H__
27
28#include "OgreD3D7Prerequisites.h"
29#include "OgreHardwarePixelBuffer.h"
30
31namespace Ogre {
32
33        class D3D7HardwarePixelBuffer: public HardwarePixelBuffer
34        {
35        protected:
36                /// Lock a box
37                PixelBox lockImpl(const Image::Box lockBox,  LockOptions options);
38
39                /// Unlock a box
40                void unlockImpl(void);
41               
42                /// A pointer to the Direct3D device.
43                IDirect3DDevice7 * mD3DDevice;       
44
45                /// Surface abstracted by this buffer
46                LPDIRECTDRAWSURFACE7 mSurface;
47               
48                // Mipmapping
49                bool mDoMipmapGen;
50
51                // Locked region, needs to be stored as D3D7 Unlock needs the exact pointer used
52                // for the lock
53                RECT mLockRect;
54                RECT *mpRect;
55        public:
56                D3D7HardwarePixelBuffer(HardwareBuffer::Usage usage, IDirect3DDevice7 *device);
57               
58                /// Call this to associate a D3D surface or volume with this pixel buffer
59                void bind(LPDIRECTDRAWSURFACE7 surface, PixelFormat format);
60               
61                /// @copydoc HardwarePixelBuffer::blit
62                void blit(HardwarePixelBuffer *src, const Image::Box &srcBox, const Image::Box &dstBox);
63               
64                /// @copydoc HardwarePixelBuffer::blitFromMemory
65                void blitFromMemory(const PixelBox &src, const Image::Box &dstBox);
66               
67                /// @copydoc HardwarePixelBuffer::blitToMemory
68                void blitToMemory(const Image::Box &srcBox, const PixelBox &dst);
69               
70                /// Function to set mipmap generation
71                void _setMipmapping(bool doMipmapGen);
72
73                /// Function to generate mipmaps
74                void _genMipmaps(const RECT &texRect);
75               
76                ~D3D7HardwarePixelBuffer();
77        };
78};
79#endif
Note: See TracBrowser for help on using the repository browser.