12

Does Blender use OpenGl or DirectX? Or is it all done from scratch?

4 Answers4

10

You can look at the blender source code and see it's written in both python and C/C++ -- less python, more C. OpenGL is referenced frequently in the code, while DirectX only rarely. So there ya go.

Leopd
  • 41,333
  • 31
  • 129
  • 167
  • 7
    DirectX is only referenced for getting user input into the built-in game engine. Sound is output by either OpenAL or PortAudio or SDL. Blender contributor here. – datenwolf Apr 10 '13 at 11:03
10

Does Blender use OpenGl or DirectX?

All graphics output of Blender is done using OpenGL.

Or does it use a programming language (python?) to do everything from scratch?

Why "or"? An API doesn't substitute a programming language. Blender has been programmed in C, C++ and Python. OpenGL is used to render everthing on screen, including the user interface.

datenwolf
  • 159,371
  • 13
  • 185
  • 298
  • 3
    I meant: "did they use libraries or did everything from scratch?" By graphics output do you mean both final rendering and user interaction? – tiffanyButterfly23 Apr 11 '13 at 00:00
  • 2
    @tiffanyButterfly23: Blender uses a number of 3rd party libraries. Among them are image and video file formats, siumlation like the "Bullet" physics library, some libraries for spatial data structures and computer vision. However when Blender was started, indeed almost everything was written from scratch, except for the Phython interpreter. And some of the libraries residing in the "extra" 3rd party code directory of the Blender source tree are indeed mostly maintained by Blender developers. – datenwolf Apr 11 '13 at 00:24
3

Expanding on what datenwolf said. Blender for the majority was written in C, the Game Engine was written in C++ and the entire application has Python bindings (meaning you can use python within the application). Blender uses OpenGL and has a special engine (comprised of opengl calls and functionality, mostly legacy but pushing to use modern stuff, vbos etc) that is used to draw the interface and power its 3d capabilities called GHOST.

iKlsR
  • 2,642
  • 6
  • 27
  • 45
1

For such questions I found ohloh to be useful. It is a site which generates statistics on open source projects. One of the statistics is a list of different programming languages used in the project. You can look at the statistics for Blender here. ohloh is also useful for identifying the tools a project used and/or to compare to similar projects.

wagnerpeer
  • 937
  • 7
  • 22