1
// Copyright (C) 2002-2011 Nikolaus Gebhardt
2
// This file is part of the "Irrlicht Engine".
3
// For conditions of distribution and use, see copyright notice in irrlicht.h
5
#include "IrrCompileConfig.h"
9
#ifdef _IRR_COMPILE_WITH_SOFTWARE_
18
CZBuffer::CZBuffer(const core::dimension2d<u32>& size)
19
: Buffer(0), BufferEnd(0), Size(0,0), TotalSize(0)
22
setDebugName("CZBuffer");
38
//! clears the zbuffer
39
void CZBuffer::clear()
41
memset(Buffer, 0, (BufferEnd-Buffer)*sizeof(TZBufferType));
46
//! sets the new size of the zbuffer
47
void CZBuffer::setSize(const core::dimension2d<u32>& size)
56
TotalSize = size.Width * size.Height;
57
Buffer = new TZBufferType[TotalSize];
58
BufferEnd = Buffer + TotalSize;
63
//! returns the size of the zbuffer
64
const core::dimension2d<u32>& CZBuffer::getSize() const
72
TZBufferType* CZBuffer::lock()
79
//! unlocks the zbuffer
80
void CZBuffer::unlock()
84
} // end namespace video
85
} // end namespace irr
87
#endif // _IRR_COMPILE_WITH_SOFTWARE_
95
IZBuffer* createZBuffer(const core::dimension2d<u32>& size)
97
#ifdef _IRR_COMPILE_WITH_SOFTWARE_
98
return new CZBuffer(size);
101
#endif // _IRR_COMPILE_WITH_SOFTWARE_
105
} // end namespace video
106
} // end namespace irr