Rigs of Rods 2026.01
Soft-body Physics Simulation
Loading...
Searching...
No Matches
Public Member Functions
AngelOgre::HardwarePixelBufferPtr Class Reference

Description

A shared pointer to a pixel buffer, which may be a texture surface (a single face and mipmap level) or a render target.

Binding of Ogre::HardwarePixelBufferSharedPtr.

Remarks
Obtain one with TexturePtr::getBuffer(). Use lock()/unlock() to access the pixels directly, or blitFromMemory()/blitToMemory() to copy them from/to a PixelBox.
All methods catch OGRE exceptions and forward them as SE_GENERIC_EXCEPTION_CAUGHT script events, so check the event if a call seems to do nothing.

Definition at line 21 of file AngelOgre_HardwarePixelBufferPtr.h.

Public Member Functions

 HardwarePixelBufferPtr ()
 
 HardwarePixelBufferPtr (const HardwarePixelBufferPtr &in other)
 
HardwarePixelBufferPtr & opAssign (const HardwarePixelBufferPtr &in other)
 
const PixelBox & lock (const box &lockbox, HardwareBufferLockOptions opt)
 
const PixelBox & getCurrentLock ()
 
void unlock ()
 
uint getWidth ()
 
uint getHeight ()
 
void blitFromMemory (const PixelBox &src, const box &dst)
 
void blitToMemory (const box &src, const PixelBox &dst)
 

Constructor & Destructor Documentation

◆ HardwarePixelBufferPtr() [1/2]

AngelOgre::HardwarePixelBufferPtr::HardwarePixelBufferPtr ( )

Creates an empty (null) pointer.

◆ HardwarePixelBufferPtr() [2/2]

AngelOgre::HardwarePixelBufferPtr::HardwarePixelBufferPtr ( const HardwarePixelBufferPtr &in  other)

Creates a copy pointing to the same buffer.

Member Function Documentation

◆ blitFromMemory()

void AngelOgre::HardwarePixelBufferPtr::blitFromMemory ( const PixelBox &  src,
const box &  dst 
)

Copies a region of memory into a region of this buffer.

Parameters
srcThe source pixels.
dstThe destination region within this buffer; if its size differs from src, the pixels are scaled.
Note
The buffer must not be locked.

◆ blitToMemory()

void AngelOgre::HardwarePixelBufferPtr::blitToMemory ( const box &  src,
const PixelBox &  dst 
)

Copies a region of this buffer into memory.

Parameters
srcThe source region within this buffer.
dstThe destination pixels; if its size differs from src, the pixels are scaled.
Note
The buffer must not be locked.

◆ getCurrentLock()

const PixelBox & AngelOgre::HardwarePixelBufferPtr::getCurrentLock ( )

Returns the PixelBox of the currently locked region.

Note
Only valid between lock() and unlock(); otherwise an empty PixelBox is returned.

◆ getHeight()

uint AngelOgre::HardwarePixelBufferPtr::getHeight ( )

Height of the buffer, in pixels.

◆ getWidth()

uint AngelOgre::HardwarePixelBufferPtr::getWidth ( )

Width of the buffer, in pixels.

◆ lock()

const PixelBox & AngelOgre::HardwarePixelBufferPtr::lock ( const box &  lockbox,
HardwareBufferLockOptions  opt 
)

Locks a region of the buffer for reading/writing.

Parameters
lockboxThe region to lock, in pixels.
optLocking options, see HardwareBufferLockOptions.
Returns
A PixelBox describing the locked memory. Remains valid until unlock() is called. If locking fails, an empty PixelBox is returned.

◆ opAssign()

HardwarePixelBufferPtr & AngelOgre::HardwarePixelBufferPtr::opAssign ( const HardwarePixelBufferPtr &in  other)

◆ unlock()

void AngelOgre::HardwarePixelBufferPtr::unlock ( )

Releases the lock obtained by lock(), uploading any modifications to the GPU.


The documentation for this class was generated from the following file: