2019-12-12 17:32:41 +01:00
|
|
|
// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten
|
|
|
|
// This file is part of the "Irrlicht Engine".
|
|
|
|
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
|
|
|
|
2021-08-27 17:55:04 +02:00
|
|
|
#ifndef IRR_C_Z_BUFFER_H_INCLUDED
|
|
|
|
#define IRR_C_Z_BUFFER_H_INCLUDED
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
#include "IDepthBuffer.h"
|
|
|
|
|
|
|
|
namespace irr
|
|
|
|
{
|
|
|
|
namespace video
|
|
|
|
{
|
|
|
|
|
|
|
|
class CDepthBuffer : public IDepthBuffer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
//! constructor
|
|
|
|
CDepthBuffer(const core::dimension2d<u32>& size);
|
|
|
|
|
|
|
|
//! destructor
|
|
|
|
virtual ~CDepthBuffer();
|
|
|
|
|
|
|
|
//! clears the zbuffer
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual void clear(f32 value, const interlaced_control interlaced) IRR_OVERRIDE;
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
//! sets the new size of the zbuffer
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual void setSize(const core::dimension2d<u32>& size) IRR_OVERRIDE;
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
//! returns the size of the zbuffer
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual const core::dimension2d<u32>& getSize() const IRR_OVERRIDE;
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
//! locks the zbuffer
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual void* lock() IRR_OVERRIDE { return (void*) Buffer; }
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
//! unlocks the zbuffer
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual void unlock() IRR_OVERRIDE {}
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
//! returns pitch of depthbuffer (in bytes)
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual u32 getPitch() const IRR_OVERRIDE { return Pitch; }
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
u8* Buffer;
|
|
|
|
core::dimension2d<u32> Size;
|
|
|
|
u32 Pitch;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class CStencilBuffer : public IStencilBuffer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
//! constructor
|
2020-02-22 21:48:12 +01:00
|
|
|
CStencilBuffer(const core::dimension2d<u32>& size, unsigned bit);
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
//! destructor
|
|
|
|
virtual ~CStencilBuffer();
|
|
|
|
|
|
|
|
//! clears the zbuffer
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual void clear(u32 value, const interlaced_control interlaced) IRR_OVERRIDE;
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
//! sets the new size of the zbuffer
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual void setSize(const core::dimension2d<u32>& size) IRR_OVERRIDE;
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
//! returns the size of the zbuffer
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual const core::dimension2d<u32>& getSize() const IRR_OVERRIDE;
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
//! locks the zbuffer
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual void* lock() IRR_OVERRIDE { return (void*) Buffer; }
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
//! unlocks the zbuffer
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual void unlock() IRR_OVERRIDE {}
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
//! returns pitch of depthbuffer (in bytes)
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual u32 getPitch() const IRR_OVERRIDE { return Pitch; }
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
u8* Buffer;
|
|
|
|
core::dimension2d<u32> Size;
|
|
|
|
u32 Pitch;
|
2020-02-22 21:48:12 +01:00
|
|
|
u32 Bit;
|
2019-12-12 17:32:41 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace video
|
|
|
|
} // end namespace irr
|
|
|
|
|
|
|
|
#endif
|