1 | <HTML> |
---|
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
---|
3 | <!-- Created on , 12 2006 by texi2html 1.64 --> |
---|
4 | <!-- |
---|
5 | Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author) |
---|
6 | Karl Berry <karl@freefriends.org> |
---|
7 | Olaf Bachmann <obachman@mathematik.uni-kl.de> |
---|
8 | and many others. |
---|
9 | Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de> |
---|
10 | Send bugs and suggestions to <texi2html@mathematik.uni-kl.de> |
---|
11 | |
---|
12 | --> |
---|
13 | <HEAD> |
---|
14 | <TITLE>OGRE Manual v1.0.7: The Hardware Buffer Manager</TITLE> |
---|
15 | |
---|
16 | <META NAME="description" CONTENT="OGRE Manual v1.0.7: The Hardware Buffer Manager"> |
---|
17 | <META NAME="keywords" CONTENT="OGRE Manual v1.0.7: The Hardware Buffer Manager"> |
---|
18 | <META NAME="resource-type" CONTENT="document"> |
---|
19 | <META NAME="distribution" CONTENT="global"> |
---|
20 | <META NAME="Generator" CONTENT="texi2html 1.64"> |
---|
21 | <LINK TYPE="text/css" rel="stylesheet" href="../style.css"> |
---|
22 | </HEAD> |
---|
23 | |
---|
24 | <BODY LANG="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000"> |
---|
25 | |
---|
26 | <A NAME="SEC173"></A> |
---|
27 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> |
---|
28 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_36.html#SEC172"> < </A>]</TD> |
---|
29 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_36.html#SEC172"> Up </A>]</TD> |
---|
30 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_38.html#SEC174"> > </A>]</TD> |
---|
31 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="index.html#SEC_Top">Top</A>]</TD> |
---|
32 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD> |
---|
33 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> |
---|
34 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD> |
---|
35 | </TR></TABLE> |
---|
36 | <HR SIZE=1> |
---|
37 | <H2> 5.1 The Hardware Buffer Manager </H2> |
---|
38 | <!--docid::SEC173::--> |
---|
39 | The HardwareBufferManager class is the factory hub of all the objects in the new geometry system. You create and destroy the majority of the objects you use to define geometry through this class. It's a Singleton, so you access it by doing HardwareBufferManager::getSingleton() - however be aware that it is only guaranteed to exist after the RenderSystem has been initialised (after you call Root::initialise); this is because the objects created are invariably API-specific, although you will deal with them through one common interface. |
---|
40 | <BR><BR> |
---|
41 | For example: |
---|
42 | <TABLE><tr><td> </td><td class=example><pre>VertexDeclaration* decl = HardwareBufferManager::getSingleton().createVertexDeclaration(); |
---|
43 | </pre></td></tr></table><TABLE><tr><td> </td><td class=example><pre>HardwareVertexBufferSharedPtr vbuf = |
---|
44 | HardwareBufferManager::getSingleton().createVertexBuffer( |
---|
45 | 3*sizeof(Real), // size of one whole vertex |
---|
46 | numVertices, // number of vertices |
---|
47 | HardwareBuffer::HBU_STATIC_WRITE_ONLY, // usage |
---|
48 | false); // no shadow buffer |
---|
49 | </pre></td></tr></table>Don't worry about the details of the above, we'll cover that in the later sections. The important thing to remember is to always create objects through the HardwareBufferManager, don't use 'new' (it won't work anyway in most cases). |
---|
50 | <A NAME="Buffer Usage"></A> |
---|
51 | <HR SIZE=1> |
---|
52 | <BR> |
---|
53 | <FONT SIZE="-1"> |
---|
54 | This document was generated |
---|
55 | by <I>Steve Streeting</I> on <I>, 12 2006</I> |
---|
56 | using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html |
---|
57 | "><I>texi2html</I></A> |
---|
58 | |
---|
59 | </BODY> |
---|
60 | </HTML> |
---|