Panda3D
panda
src
gobj
vertexDataBook.I
Go to the documentation of this file.
1
/**
2
* PANDA 3D SOFTWARE
3
* Copyright (c) Carnegie Mellon University. All rights reserved.
4
*
5
* All use of this software is subject to the terms of the revised BSD
6
* license. You should have received a copy of this license along
7
* with this source code in a file named "LICENSE."
8
*
9
* @file vertexDataBook.I
10
* @author drose
11
* @date 2007-05-16
12
*/
13
14
/**
15
* Allocates and returns a new VertexDataBuffer of the requested size.
16
*/
17
INLINE
VertexDataBlock
*
VertexDataBook::
18
alloc
(
size_t
size) {
19
MutexHolder
holder(_lock);
20
return
do_alloc(size);
21
}
22
23
/**
24
* Returns the number of pages created for the book.
25
*/
26
INLINE
size_t
VertexDataBook::
27
get_num_pages
()
const
{
28
return
_pages.size();
29
}
30
31
/**
32
* Creates a new page of sufficient size to hold the requested block. The
33
* page is not added to the _pages list.
34
*/
35
INLINE
VertexDataPage
*VertexDataBook::
36
create_new_page(
size_t
size) {
37
size_t
page_size = ((size + _block_size - 1) / _block_size) * _block_size;
38
return
new
VertexDataPage
(
this
, page_size, _block_size);
39
}
VertexDataPage
A block of bytes that holds one or more VertexDataBlocks.
Definition:
vertexDataPage.h:37
MutexHolder
A lightweight C++ object whose constructor calls acquire() and whose destructor calls release() on a ...
Definition:
mutexHolder.h:25
VertexDataBlock
A block of bytes that stores the actual raw vertex data referenced by a GeomVertexArrayData object.
Definition:
vertexDataBlock.h:29
VertexDataBook::get_num_pages
size_t get_num_pages() const
Returns the number of pages created for the book.
Definition:
vertexDataBook.I:27
VertexDataBook::alloc
VertexDataBlock * alloc(size_t size)
Allocates and returns a new VertexDataBuffer of the requested size.
Definition:
vertexDataBook.I:18
Generated on Wed Jan 23 2019 21:40:05 for Panda3D by
1.8.15