9 Graphics apis




Дата канвертавання22.04.2016
Памер15.37 Kb.


9

Graphics APIs

Graphics APIs provides a standard platform that enables software developers to access specialised hardware (especially graphics hardware) features without having to write hardware-specific code. There are three main Graphic APIs

    1. OpenGL


OpenGL was first released in 1992, by Silicon Graphics, Inc. It was created as an open standard, and is available on many platforms such as MacOS, Windows, and BEOS. Even though it was created as an open standard, any changes that are done to the OpenGL source must be approved first by the Architectural Review Board (ARB). The ARB consists of representatives from major companies involved with the graphics industry, including 3D Labs, SGI, Apple, NVIDIA, ATI, Intel, id Software, and for now at least, even Microsoft. It is strictly a graphics API. One aspect of OpenGL that makes it well suited for graphics development is that it is device independent, therefore portable.
    1. Microsoft DirectX


Microsoft DirectX is an advanced suite of multimedia APIs built into Microsoft Windows® operating systems. DirectX debuted in 1995 and quickly became a recognized standard for multimedia application development on the Windows platform.

API controls a set of low-level functions that access the hardware or provide hardware emulation if no hardware exists. These functions include support for 2D and 3D graphics acceleration, control over myriad input devices, functions for mixing and sampling sound and music output, control over networking and multiplayer gaming, and control over various multimedia streaming formats. The component APIs that handle these functions are the following:



  • DirectDraw

  • Direct3D

  • DirectInput

  • DirectSound

  • DirectMusic

  • DirectPlay

  • DirectShow

DirectX uses two drivers, the Hardware Abstraction Layer (HAL) and the Hardware Emulation Layer (HEL), to send requests to the hardware device. When DirectX is initialized, it checks the hardware to see if the hardware supports certain capabilities. If the hardware does support a certain capability, then the HAL will be used to access that hardware function; otherwise, the HEL will be used to emulate the capability through software.

DirectX is based on the COM (Component Object Model), which means the programmer needs to create pointers to a class and use those, instead of just calling the functions.


    1. Glide


Glide was developed by 3dfx. It can work on other graphics cards, but was made specifically for 3dfx chipsets. As a result, it typically runs rather badly on non-3dfx cards. Unfortunately, 3dfx is dead, and although there are many 3dfx cards still out there, they are quickly becoming outdated and being replaced. Using an API that only targets an audience that is rapidly shrinking really is not a good idea.
    1. DirectX vs. OpenGL


Its not fair or useful to compare DirectX to OpenGL because OpenGL is a strict graphics library where as DirectX is suite of APIs .You can, however, compare it to Direct3D - the graphical part of DirectX.
      1. Portability


DirectX is only supported on Microsoft Operating Systems (OS) and the Xbox, where as any OS can implement the OpenGL specification. Windows NT 4.0, which Direct3D does not even do (well, it does, but you have to use DirectX 3. DirectX is supported by almost all major vendors of hardware. So far, OpenGL is also to same.
      1. Trainability


Initial versions of DirectX were difficult to learn and master. But the developer’s say those new versions are becoming much easier. The 3rd party documentation and tutorials are not always helpful.
      1. Language support


Since most graphic programs are written using C & C++ there was no great need for other language support. Nevertheless From what I read both the APIs support many languages. One of COM's specifications is that it is language independent. For a long time though, languages other than C/C++ were not supported. With DirectX 7.0, "out of the box" support was included for Visual Basic (it does not support pointers and such, so a new DLL (Dynamic Link Library) called dx7vb.dll was required.).
      1. Performance and Quality Factors


Through the literature survey after looking at opinions of several people, it seems that performance and quality does not depend on whether openGL or DirectX is used. Instead, how good the developer and specially the familiarity with what ever the API matters more. Furthermore it depends on how well the API, driver, operating system, and hardware interact.
      1. The usage


All the Quake games used OpenGL, Half-Life wrote support for everything. Earth 2150 (not really a great game, but graphically very advanced) wrote support for OpenGL and D3D. MechWarrior 4: Vengeance used only DirectX, but it was just Microsoft's way of showing off Direct3D8.0 anyway. All XBox games use D3D. (Other consoles are not really worth mentioning since they usually use their own custom APIs, though some - like the Sony Playstation 2 - do support OpenGL in various formats.)
      1. Tool support


It is worth mentioning that DirectX also provides many other interfaces for working with sound, input, etc. OpenGL does not include any of this functionality, because it is a pure graphics library. When writing a game, however, you will need these tools. Fortunately, there are many technologies that can be used with OpenGL that provide this functionality. OpenAL provides a cross platform audio library. Other such libraries are OpenML, Simple DirectMedia Layer (SDL).
    1. Graphic APIs and Universal BioSys


Our project requires interacting directly with several hardware devices. Specially for the demo we need a BSP, which will be based on a Graphics API. As it seems a pure Graphics API like OpenGL does not give much control over input devices, DirectX will be our choice.




Best security through nature….



База данных защищена авторским правом ©shkola.of.by 2016
звярнуцца да адміністрацыі

    Галоўная старонка