Docstoc

tca

Document Sample
tca Powered By Docstoc
					OpenGL
Documentation Vs
Direct3D
Documentation




Pawel Bokota
Eng 352-004
April 27, 2009
                                                         Table of Contents

Abstract ........................................................................................................................................... 1
Introduction ..................................................................................................................................... 1
How Programmers Make 3D Applications ..................................................................................... 2
Accessibility.................................................................................................................................... 3
Comparing the Reference Manuals ................................................................................................. 4
The Programming Guides ............................................................................................................... 5
Conclusion ...................................................................................................................................... 6
References ....................................................................................................................................... 6
Annotated Bibliography .................................................................................................................. 7
Abstract

    This article compares and contrasts the documentation of the Khronos Group’s OpenGL
    and Microsoft’s Direct3D application programming interfaces. Application programming
    interfaces (APIs) are programming routines that provide an interface for the programmer
    to accomplish some function. In this case, OpenGL and Direct3D are both APIs that let
    programmers interface with the computer graphics card. Like any other professional API,
    OpenGL and Direct3D come with documentation that is supposed to help the
    programmer with the API. Even though both APIs accomplish the same task their
    documentations are structured differently. This analysis shows that Microsoft’s Direct3D
    reference manual is superior to the Khronos Group’s OpenGL reference manual.


Introduction

           OpenGL and Direct3D are the two most widely used APIs for the purpose of
    creating interactive computer graphics. OpenGL is maintained by the Khronos Group [1],
    which is an industry consortium interested in computer graphics. Direct3D, on the other
    hand, is owned by Microsoft. Both of these APIs compete with each other for the
    computer graphics market.
           These two APIs are similar in their design and provide almost identical
    performance. Therefore, programmers must decide which API to choose based on the
    support the API gives; this support includes the documentation. It is therefore critical for
    the Khronos Group and Microsoft to provide excellent documentation with their API.




                                                                                                   1
How Programmers Make 3D Applications

           The first step in producing 3D computer graphics is for programmers to write
    instructions to the computer. These instructions are then sent to a computer graphics card,
    which is a piece of hardware that is responsible for drawing images on a computer
    monitor. However, it would be very complicated to write instructions directly to the
    computer graphics card because of the complexity of 3D applications and computer
    hardware. Therefore, an intermediate step is needed, which is where OpenGL and
    Direct3D come in. Both OpenGL and Direct3D are interfaces that programmers use to
    interact indirectly with a computer graphics card. For programmers to use these interfaces
    they first need to learn the interfaces and both products provide documentation for
    programmers to do just this.
           Programmers then write code (computer instructions) that use OpenGL and
    Direct3D to take advantage of the computer graphics card. Once programmers have
    written all the code, they send it to the computer hardware to get interpreted. The
    computer graphics card reads these instructions and draws whatever it was told to draw
    on the computer monitor. The figure below is just one example that demonstrates the
    power of computer graphics.




                             Figure 1 – Photorealistic computer graphics [2]




                                                                                             2
Accessibility
           Both the OpenGL and Direct3D reference manuals are available online and are
    downloadable. However, only Microsoft provides an easy interface to download its
    complete documentation, making it more accessible. This paper will analyze only
    OpenGL’s online documentation and Direct3D’s downloadable documentation.




           Figure 2 – Main page for the Khronos Group OpenGL documentation website [3]




               Figure 3 – Download website for Microsoft’s Direct3D documentation [4]




                                                                                         3
Comparing the Reference Manuals

           Navigating the OpenGL documentation is simple: on the left side of the web page
    there is an alphabetical ordering of all the functions the API provides. The Direct3D API
    has a similar navigational design to OpenGL, as it also provides navigational links on the
    left side, but instead of ordering function alphabetically it orders them by similarity. In
    addition to the navigation on the left side, Direct3D includes an index and a search
    feature. The index and search make navigation in Direct3D easier and more efficient than
    that of OpenGL.




                         Figure 4 – Direct3D API documentation, search function


                                                                                                  4
            An interesting observation from these two documentations is the advantageous
    that they provide over paper manuals, especially Microsoft’s Direct3D. For example,
    when looking at a specific page in the reference manuals both documentations provide
    hyperlinks to referring pages. A paper manual might tell its reader to see another page
    while these API documentations have hyperlinks that users just click on with their mouse,
    which will take them to the referring page.
            Another interesting feature is the search function that the Direct3D manual
    provides; the user enters some text to search for, and the entire manual gets searched for
    that text, and the results are displayed as links so that if users click on a search result it
    will take them to that page (an example of a search is displayed in figure 4). The closest
    functionality that paper manuals have to this is the index.



The Programming Guides

            Having just a reference manual is usually not enough for programmers to learn an
    API, and therefore there are usually tutorials and books that explain more thoroughly how
    an API works. OpenGL and Direct3D are no different. The OpenGL API has an official
    programming guide book associated with it; however the latest edition of the book is not
    free. There is an older edition of the book that is available online but much of the
    information is outdated. On the other hand, Microsoft releases a programming guide
    along with its manual for free. It does not go into the detail that the OpenGL book does
    but it’s adequate to get started. In addition to the programming guide Microsoft provides
    tutorials and many example applications




                                                                                                     5
Conclusion

           In all cases Microsoft’s Direct3D had superior documentation features compared
    to OpenGL. The Direct3D manual was more accessible because Microsoft provided an
    online version and one that can be easily downloaded. The Direct3D reference manual
    was also packaged with a search and index feature something that should become a
    standard in the future. In addition, Direct3D included a programming guide and many
    example applications, which OpenGL also had but the latest information was not free. In
    conclusion Microsoft’s Direct3D API documentation is superior to the Khronos Group’s
    OpenGL.




References

    1. “OpenGL Overview,” OpenGL, <http://www.opengl.org/about/overview/>, accessed
       March 28, 2009

    2. Tran, Gilles, “Glasses, pitcher, ashtray and dice (POV-Ray),” Oyonale – 3D art and
       graphic experiments, <http://www.oyonale.com/modeles.php?lang=en&page=40>,
       accessed March 28, 2009

    3. “OpenGL 2.1 Reference Pages,” OpenGL, <http://www.opengl.org/sdk/docs/man/>,
       accessed April 24, 2009

    4. “DirectX Software Development Kit,” Microsoft,
       <http://www.microsoft.com/downloads/details.aspx?FamilyID=24a541d6-0486-
       4453-8641-1eee9e21b282&displaylang=en>, accessed April 24, 2009




                                                                                              6
Annotated Bibliography

“OpenGL 2.1 Reference Pages,” OpenGL, <http://www.opengl.org/sdk/docs/man/>, accessed
March 27, 2009

       This is the location of the OpenGL reference manual. It includes only a list of functions
       but they’re detailed. It is also easy to navigate the website because the functions are in
       alphabetical order and there is no clutter on the website.

“Reference for Direct3D 10,” msdn,
 <http://msdn.microsoft.com/en-us/library/bb205147(VS.85).aspx>, accessed March 27, 2009

       This is the online location for Direct3D10 reference documentation. This online version
       is slightly more difficult to navigate than OpenGL’s website because it’s more difficult to
       get to it. However, the reference pages describe everything that the API includes such as
       structures and interfaces, something that the OpenGL reference lacks. In a regular paper
       reference of Direct3D there might be a lot of flipping through the pages but with HTML
       there are links that you just click on and they will take you to another page.

“Programming Guide for Direct3D 10,” msdn,
<http://msdn.microsoft.com/en-us/library/bb205067(VS.85).aspx>, accessed March 27, 2009

       This is the official Direct3D 10 programming guide. It goes over some of the theory of
       computer graphics, the workings of the API, and it includes a few tutorials. It can be
       downloaded or viewed online.




                                                                                                    7

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:5
posted:12/7/2011
language:English
pages:9