OGRE  1.7
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OgreD3D10HardwareVertexBuffer.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4 (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2011 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 #ifndef __D3D10HARDWAREVERTEXBUFFER_H__
29 #define __D3D10HARDWAREVERTEXBUFFER_H__
30 
31 #include "OgreD3D10Prerequisites.h"
33 
34 namespace Ogre {
35 
38  {
39  protected:
41  // have to implement these, but do nothing as overridden lock/unlock
42  void* lockImpl(size_t offset, size_t length, LockOptions options) {return 0;}
43  void unlockImpl(void) {}
44 
45  public:
46  D3D10HardwareVertexBuffer(HardwareBufferManagerBase* mgr, size_t vertexSize, size_t numVertices,
47  HardwareBuffer::Usage usage, D3D10Device & device, bool useSystemMem, bool useShadowBuffer);
49 
50  // override all data-gathering methods
51  void* lock(size_t offset, size_t length, LockOptions options);
52  void unlock(void);
53  void readData(size_t offset, size_t length, void* pDest);
54  void writeData(size_t offset, size_t length, const void* pSource,
55  bool discardWholeBuffer = false);
56 
57  void copyData(HardwareBuffer& srcBuffer, size_t srcOffset,
58  size_t dstOffset, size_t length, bool discardWholeBuffer = false);
59  bool isLocked(void) const;
60 
62  bool releaseIfDefaultPool(void);
64  bool recreateIfDefaultPool(D3D10Device & device);
65 
67  ID3D10Buffer * getD3DVertexBuffer(void) const;
68 
69 
70  };
71 
72 }
73 #endif
74 
void * lock(size_t offset, size_t length, LockOptions options)
Lock the buffer for (potentially) reading / writing.
D3D10HardwareVertexBuffer(HardwareBufferManagerBase *mgr, size_t vertexSize, size_t numVertices, HardwareBuffer::Usage usage, D3D10Device &device, bool useSystemMem, bool useShadowBuffer)
void unlock(void)
Releases the lock on this buffer.
bool releaseIfDefaultPool(void)
For dealing with lost devices - release the resource if in the default pool.
Specialisation of HardwareVertexBuffer for D3D10.
LockOptions
Locking options.
Base definition of a hardware buffer manager.
Usage
Enums describing buffer usage; not mutually exclusive.
void readData(size_t offset, size_t length, void *pDest)
Reads data from the buffer and places it in the memory pointed to by pDest.
void copyData(HardwareBuffer &srcBuffer, size_t srcOffset, size_t dstOffset, size_t length, bool discardWholeBuffer=false)
Copy data from another buffer into this one.
void * lockImpl(size_t offset, size_t length, LockOptions options)
Internal implementation of lock()
void unlockImpl(void)
Internal implementation of unlock()
bool recreateIfDefaultPool(D3D10Device &device)
For dealing with lost devices - recreate the resource if in the default pool.
Abstract class defining common features of hardware buffers.
Base implementation of a D3D10 buffer, dealing with all the common aspects.
void writeData(size_t offset, size_t length, const void *pSource, bool discardWholeBuffer=false)
Writes data to the buffer from an area of system memory; note that you must ensure that your buffer i...
Specialisation of HardwareBuffer for a vertex buffer.
ID3D10Buffer * getD3DVertexBuffer(void) const
Get the D3D-specific vertex buffer.