3D Graphics Programming with QuickDraw 3D
To read data from (or write data to) a data storage device, you first need to create a storage object of the appropriate type. For example, to read data from a Macintosh file, you can create a Macintosh storage object. You also need to create a file object (of type TQ3FileObject
) and attach the file object to the storage object. Once you've created a storage object and a file object and attached them to one another, you can then read data from the file object by using file object reading calls. See the chapter "File Objects" for information on creating file objects, attaching them to storage objects, and reading or writing data using those file objects.
QuickDraw3D distinguishes between storage objects and file objects primarily so that you can read and write stored data using a single set of functions. QuickDraw3D supports only one class of file object, instances of which can be attached to any of the types of storage objects that it supports.
A storage object is of type TQ3StorageObject
, which is a type of shared object. QuickDraw3D provides three subclasses of the TQ3StorageObject
type:
kQ3StorageTypeMemory
) represents a dynamically allocated block of RAM. You can allocate the block of memory yourself, or you can have QuickDraw3D allocate a block of memory on your behalf. Memory storage objects are available on all computer systems. QuickDraw3D supports one subclass of the kQ3StorageTypeMemory
storage object type:
kQ3MemoryStorageTypeHandle
) represents a handle to a block of dynamically allocated RAM. On the Macintosh Operating System, QuickDraw3D uses the SetHandleSize
function when it needs to change the size of the memory block. On operating systems that do not support handles, QuickDraw3D allocates and maintains the memory blocks internally.
kQ3StorageTypeMacintosh
) represents the data fork of a Macintosh file using a file reference number. Macintosh storage objects are available only on the Macintosh Operating System. QuickDraw3D supports one subclass of the kQ3StorageTypeMacintosh
storage object type:
kQ3StorageTypeUnix
) represents a file using a structure of type FILE
. This structure is accessed using the standard I/O library, a collection of functions that provide character I/O and file-manipulation services for C programs on any operating system. The represented object can be a pipe, the standard input file, the standard output file, or any other FILE
abstraction. QuickDraw3D supports one subclass of the kQ3StorageTypeUnix
storage object type:
For a description of pointers and handles, see the book Inside Macintosh: Memory. For a description of the Macintosh file-specification methods (that
is, file reference numbers and file system specification structures), see the
book Inside Macintosh: Files. For a description of the standard I/O library,
see the documentation for any UNIX-based computer (for example,
A/UX Essentials from Apple Computer, Inc., or The UNIX Programming Environment by Kernighan and Pike), or any book devoted specifically to C language programming (for example, The C Programming Language by Kernighan and Ritchie).
Let us know what you think of these prototype pages.
Generated with Harlequin WebMaker