Abstract:
An optimized 3D graphics library for a computer having a 3D graphics board or its equivalent is provided. The library provides a number of groups of functions which are optimized to simplify common tasks while being small enough building blocks to be used for most applications. In particular, the library provides the following groups of functions: (a) screen/window initialization, (b) primitive operations, (c) primitive properties, (d) buffer management, (e) color management, (f) queries, and (g) texture management.

Description:
BACKGROUND OF THE INVENTION 
     The present invention relates to 3D graphics boards for personal computers, and in particular to a graphics library for use in programming such boards. 
     Graphical operations on a computer require a tremendous amount of computation power. Separate graphics boards have been developed which use digital signal processing (DSP) chips to perform the calculation-intensive operations so that they do not have to be performed by the microprocessor on the mother board. Three-dimensional graphics add additional complexity in computations. Writing software to be executed on such graphic boards typically is a tedious process, requiring familiarity with the arithmetic operations performed by the particular board. 
     In many software languages, libraries are provided which perform higher level functions which are commonly used by programmers. These libraries thus eliminate the need for the programmer to write detailed code with a knowledge of the particular operating system and hardware requirements for a particular, commonly used function. 
     It would be desirable to have a graphics library for use with 3D graphics boards which is structured so that it provides an easy way to compute common functions, without being at a high enough level such that its applicability would be limited. 
     SUMMARY OF THE INVENTION 
     The present invention provides an optimized 3D graphics library for a computer having a 3D graphics board or its equivalent. The library provides a number of groups of functions which are optimized to simplify common tasks while being small enough building blocks to be used for most applications. In particular, the library provides the following groups of functions: (a) screen/window initialization, (b) primitive operations, (c) primitive properties, (d) buffer management, (e) color management, (f) queries, and (g) texture management. 
     In a preferred embodiment, a number of features are included to optimize the library for a personal computer environment. A number of the primitive properties can be disabled in order to boost performance. The disabling is provided for in an easily accessed and used mask. By disabling unneeded functions, performance can be boosted by limiting the number of calculations. Alternately, texture filtering can be disabled entirely. These features can be taken advantage of, for instance, for small features or features in the background of a particular display frame. Disabling or limiting texturing can make up to a 50% difference in throughput. The depth buffer function adds an additional 25% impact on throughput. 
     As an example of one optimization according to the present invention, a function cglSendStream provides an easy method for doing rendering, copying, uploading or downloading operations. The parameters include simply designating the proper addresses. Before calling this single service call to perform these functions, various variables and registers can be set to provide the desired operation and provide the performance optimizations that are desired. For instance, the mask used to enable or disable a number of functions is set by a programmer as part of the initialization for calling the service call, thus permitting the mask to be configured as desired on a service call by service call basis. 
     For a further understanding of the nature and advantages of the invention, reference should be made to the following description taken in conjunction with the accompanying drawings. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a block diagram of a computer system incorporating the present invention; 
     FIG. 2 is a diagram of the software hierarchy of the present invention; and 
     FIG. 3 is a diagram of the allocation of frame buffer memory used in the present invention. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENT 
     FIG. 1 shows a computer system having a mother board 12, a system memory 14, and a 3D graphics board 16, all connected to a system bus 18. The mother board 12 includes a CPU 20, a read only memory (ROM) 22 for storing the microcode, and a bus interface unit 24. The memory board 14 includes system memory 26, which may be in the form of DRAM chips. 3D graphics board 16 includes an application specific integrated circuit (ASIC) 28 which includes digital signal processing capabilities. A clock is provided by a clock generator 30. DRAM memory 32 provides local memory for the 3D processing, while a VRAM memory 34 acts as a frame buffer for data to be provided to a display 36. A RAMDAC 38 maintains the color palette and converts data from the memory into analog signals for use by display 36. 
     FIG. 2 illustrates the hierarchy of software for use in the present invention. The software operates with graphics hardware 40 which is a rendering engine for creating the graphics on a display. In one embodiment, the graphics hardware is the 3D graphics board 16 of FIG. 1. Alternately, a mother board can include sufficient graphics power in the microprocessor to act as the graphics hardware. The Creative Graphic Library 42 interacts with the graphics hardware 40. The Creative Graphic Library (CGL) includes a lower layer hardware specific or operating system specific code 44, with a top layer being a generic application program interface (API) 46. This library can be used in conjunction with 3D geometry API and drivers 48 by 2D and 3D applications software 50. 
     Attached as Exhibit 1 is a developer&#39;s information pack for the CGL which sets forth a description of each of the service calls in the library. The service calls are broken into seven service groups. The service calls have been chosen to provide an optimization between simplifying often-needed functions, and providing those functions at a level useful to most application software. Examples of the service calls in each service group are discussed below. 
     1. Screen/Window. This group of service calls basically is an initialization grouping which allows setting up the screen configuration. 
     cglQueryScreen. This is a service call which can be used to detect whether the graphics subsystem is present, and query the user of the application software for the appropriate screen configuration. Included are designations of what point of the screen is the 0, 0 coordinate, and the pixel size and frequency of the screen display. In addition, the color format and whether single or double buffering is desired is requested. This call also queries whether the depth and stencil buffers are to be used and the assignment of bits to them. 
     cglInitScreen. The service call is used to initialize the graphics program in accordance with the designations provided cglQueryscreen. 
     2. Primitive Operation. This group of service calls is a grouping which allows pixels to be placed on the screen or pixels to be sent to the screen, or alternatively to be rendered or copied. 
     cqlSendStream. This is a service call which is used to send a stream of pixels or a block of pixels for various purposes, such as for rendering, copying, uploading or downloading. These operations can be performed using a single service call. The parameters specified for the call are the addresses of the operation blocks. This service call will look to a number of parameters which are designated by the programmer in the setup code prior to calling the service call. For example, the operation needs to be designated in this setup as either a render or a copy operation. Additionally, the number of vertices needs to be designated, along with the primitive type (drawing a point, line, triangle, etc.). Depth, stencilling and texturing must all be designated. A single mask is uniquely used to enable a variety of features, including shading, depth test, &#39;stencil test, alpha-blending, texture mapping, depth cue, etc. The mask is called the uPropertyEnableMask. The use of such a mask structure simplifies the program usability to optimize performance separately for each use of the service call. Reference should be made to the attached Appendix for more details on this service call and on the mask. 
     3. Primitive Property. This group of service calls primarily specify certain properties of different primitive operations, with the primitive operations being enabled or disabled by the mask in the cglSendStream call. 
     cqlSetDepthMode. This is a service call which determines the comparison function which is used for depth testing. The depth test is performed only when the depth bit is set in the enable mask of the cglSendStream call. For instance, the comparison can indicate whether a greater than, lesser than or equal comparison is to be used. 
     cqlSetLogicalOpsMode. This is a service call which will be performed only if the Logicalops bit in the uPropertyEnableMask in the of the cglSendStream call is set. The parameters supported include a number of logical operations, such as a NOR operation, an AND operation, NAND, a not --  AND operation, etc. 
     4. Texture Management. This is a group consisting of a single service call for loading a texture map with the parameters including specifying the address of the map, the buffer width, the color format and whether dithering is used. 
     5. Buffer Management. This group of service calls provides for easy management of the frame buffer. In particular, a number of service calls for managing the double-buffering function are included. FIG. 3 illustrates the buffer organization, with the front and back buffer being the two buffers used for double-buffering. The starting positions for pointers to the different buffer areas can be either as indicated by solid lines, or as indicated by dotted lines in FIG. 3. The texture buffer stores texture information, and if single buffering is used, it would start immediately after the front buffer in FIG. 3. 
     6. Color Management. This group of service calls allows for managing aspects of the color characteristics. In addition to getting a color palette and setting the parameters of the color palette, service calls are provided for a download and upload operation. Logical operations and dithering can be included as part of the downloading process. 
     7. Query Control. This group of service calls deals with controlling a picking mode which compares pixels against a picking region, an extent mode, where pixels are compared against an extent region, and cursor control functions. 
     As will be understood by those of skill in the art, the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof. Accordingly, the foregoing description is illustrative of embodiments of the invention, but is not limiting of the scope of the invention. Accordingly, reference should be made to the appended claims for any description of the scope of the invention.