What you're saying is not entirely correct or incorrect ...
Both OpenGL and Direct3D are graphical APIs that act as a hardware abstraction layer for rendering 3D graphics (most often) in real time. Their primary use is to provide a uniform way for software developers to produce 3D graphics regardless of which graphics hardware they have. Being that both of these APIs work in essentially the same way (some would argue because Microsoft copied OpenGL because they didn't want to use open standards), and the code required to interface with either API is relatively small, many graphics engines are designed to use either API to increase the viability of the engine for cross-platform use.
DirectX also contains a bunch of other libraries to manage many other areas of game development, but the last statistics I saw indicated these libraries were far less popular than their open source cross-platform equivalents; but that may have changed.







