#include <PageManager.h>
Public Member Functions | |
| bool | operator() (uint8 desiredFlags) const |
| Check for given flags in this page manager. More... | |
| void | markPage (Size index, uint8 markFlags=DIRTY) |
| Add given flag fot a page. More... | |
| void | markRegion (Size offset, Size bytes, uint8 markFlags=DIRTY) |
| Mark memory area in page manager with a desired flag. More... | |
| Size | getPageCount (uint8_t desiredFlags=DIRTY) const |
| Size | getSize (uint8_t desiredFlags=DIRTY) const |
| void | setPageCount (Size count) |
| Resizes page manager to a specified number of pages. More... | |
| Size | getRequiredPageCount (Size size) const |
| Size | getRequiredSize (Size size) const |
| Size | accommodate (Size size) |
| Pages | getMarkedPages (uint8_t desiredFlags=DIRTY, bool clear=true) |
| bool | getNextTransferBlock (Size &outOffset, Size &outSize, Size ¤tPage) |
| Gets a block of data that needs to be transferred to the GPU. More... | |
Used for partial updates of buffers. Divides memory into pages, and then only pages that changed need to be updated on the GPU.
| Size PageManager::accommodate | ( | Size | size | ) |
Resize the page manager to fir the given number of bytes of data.
| size | Requested size in bytes. |
| PageManager::Pages PageManager::getMarkedPages | ( | uint8_t | desiredFlags = DIRTY, |
| bool | clear = true |
||
| ) |
Get pages with at least one of the specified flags, optionally clearing the flags as we go.
| desiredFlags | Bitwise and of flags for pages to be retrieved. |
| clear | Should the flags be cleared. |
| bool PageManager::getNextTransferBlock | ( | Size & | outOffset, |
| Size & | outSize, | ||
| Size & | currentPage | ||
| ) |
Gets a block of data that needs to be transferred to the GPU.
| outOffset | Current offset in bytes is written to this variable. |
| outSize | Size of the requested block is written to this variable. |
| currentPage | Before first call should be initialized to 0. Incremented on each call. |
true if new transfer block is available. | Size PageManager::getPageCount | ( | uint8_t | desiredFlags = DIRTY | ) | const |
| desiredFlags | Bitwise and of flags to be checked for. |
| Size PageManager::getRequiredPageCount | ( | Size | size | ) | const |
| size | Data size in bytes. |
| Size PageManager::getRequiredSize | ( | Size | size | ) | const |
Since whole pages are required to be allocated, amount of space required to store data is often higher than data size.
| size | Data size in bytes. |
| Size PageManager::getSize | ( | uint8_t | desiredFlags = DIRTY | ) | const |
| desiredFlags | Bitwise and of flags to be checked for. |
| void PageManager::markPage | ( | Size | index, |
| uint8 | markFlags = DIRTY |
||
| ) |
Add given flag fot a page.
The function also toggles the flag in object-wide flags property.
| index | Index of the page that needs to be flagged. |
| markFlags | A bitwise and operation of flags that need to be added. |
| void PageManager::markRegion | ( | Size | offset, |
| Size | bytes, | ||
| uint8 | markFlags = DIRTY |
||
| ) |
Mark memory area in page manager with a desired flag.
| offset | Start of the memory area in bytes. |
| bytes | Size in bytes of the area. |
| markFlags | A bitwise and operation of flags that need to be added. |
| bool PageManager::operator() | ( | uint8 | desiredFlags | ) | const |
Check for given flags in this page manager.
| desiredFlags | Bitwise and of flags to be checked for. |
true if at least one of the desired flags is on for this page manager. | void PageManager::setPageCount | ( | Size | count | ) |
Resizes page manager to a specified number of pages.
| count | Number of pages to resize to. |