Skip to Main Content
3D Game Engine Design, 2nd Edition
book

3D Game Engine Design, 2nd Edition

by David Eberly
November 2006
Intermediate to advanced content levelIntermediate to advanced
1040 pages
26h 31m
English
CRC Press
Content preview from 3D Game Engine Design, 2nd Edition
818 Chapter 18 Object-Oriented Infrastructure
{
Object* pkObject;
rkStream.Read(pkObject);
pkLink->Add(pkObject);
}
WM4_END_DEBUG_STREAM_LOAD(Object);
}
Notice how the function loads the controller pointers. At the time the object was
saved to disk, this value was the memory address for the controller. Now at load time
it can only be used as a unique identifier. That value is stored in the link object for
the linking phase that occurs after loading.
Derived classes implement the
Load function by calling the base class Load first,
and then reading native data followed by link data. This is done in the same order
that
Save processed the data.
void DerivedClass::Load (Stream& rkStream, Stream::Link* pkLink)
{
WM4_BEGIN_DEBUG_STREAM_LOAD;
BaseClass::Load(rkStream,pkLink); ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

3D Game Engine Architecture

3D Game Engine Architecture

David Eberly
Blender 3D By Example - Second Edition

Blender 3D By Example - Second Edition

Oscar Baechler, Xury Greer
Computer Graphics

Computer Graphics

Alexey Boreskov, Evgeniy Shikin

Publisher Resources

ISBN: 9781482267303