How can I go to DirectX to understand it? Studied OpenGL very easy, but I did not meet ample opportunities. Saw how on DirectX made (in Microsoft ) a render of the sea. And I think that this is not possible on OpenGL . What is better to choose, what I understand better or to beat and understand DirectX ?
Closed due to the fact that it is necessary to reformulate the question so that it was possible to give an objectively correct answer by the participants aleksandr barakin , Vladimir Martyanov , Abyx , LEQADA , insolor Jan 11 '16 at 13:57 .
The question gives rise to endless debates and discussions based not on knowledge, but on opinions. To get an answer, rephrase your question so that it can be given an unambiguously correct answer, or delete the question altogether. If the question can be reformulated according to the rules set out in the certificate , edit it .
- Article on Habré - codemo
- programs do not have to use either one or the other. but when the information came up that microsoft uses g opengl for drawing, I decided for myself - jmu
5 answers
The first versions of OpenGL are really very light. But some things suffer performance. For example glBegin () glVertex () glEnd () is much slower than using the vertex buffer. In Direct it is not, in the new versions of OpenGL it is cut out. Therefore, modern OpenGL is no easier than Direct3D. The main advantage of OpenGL is cross-platform. More OpenGL is not immediately supported in the drivers. Sometimes there are bugs in it, because it is less common than DX. The advantage of DirectX is that it consists of several parts. Direct3D is only its separate part. There is also DirectSound, DirectMusic for sound, DirectInput for input. Although these components can be safely used in the OpenGL application (only because of this it will cease to be cross-platform). DirectX still has handy debugging. Another DX library comes with D3DX, one of the very convenient features of which is the ability to load textures of some formats. There is no such thing in OpenGL, you have to load the textures yourself, knowing the binary file format, although you can find supporting libraries. But despite all this, I chose OpenGL, as I plan to make my cross-platform engine.
- Therefore ... Is it better to choose DirectX?) - h18
- oneI think that for these reasons all games write on DirectX. But personally, I still chose OpenGL. - gammaker
Learn OpenGL 3.3 and up. Modern OpenGL is almost as good as DirectX.
- It is good that it is not inferior and it is still easier. You do not know how you can perform initialization so that there is no console window? - h18
- If I'm not mistaken about this, you can read in the "super book" on OpenGL. It discusses in detail the topic of porting OpenGL to Windows. - OpenGLprogrammer
- oneThe console window appears because you are creating a console application. But I wouldn’t get rid of him if I were you: it is useful for a debugging output. And you will always have time to remove it. - cy6erGn0m
The documentation for Direct X is better written. MSDN considers the very essence of building a three-dimensional scene from scratch. The authors of the OpenGl documentation assume that you already know how to use matrices for affine transformations, what are normal vectors, mipmapping, vertex and fragment shaders, how the pipeline works, how textures are applied and therefore simply in alphabetical order describe the headers of the functions that are in the library.
As for the rendering of the sea in OpenGl, this is much simpler in later versions, since shaders are written in C in such a language, and not in the assembler of a video card.
In general, to program a suitable three-dimensional scene, you need to know mathematics well (matrices, quaternions for rotation, Fresnel integrals for calculating light) and not any specific library.
Looking for what tasks, OpenGL gives the way to cross-platform development, and the ability to easily go to gamedive for iOS / Android mobile platforms, which is currently quite popular. On the other hand, DirectX provides a more powerful API, and when it comes to developing games / applications exclusively for the Win-platform, it is better to write on DX. And in modern, adult PC-shnom gamedev, DX is essentially standard.
In addition, DX looks and works faster, although it all depends on the directness of the hands of the developers (compared the games L4D2 and TF2, on the same computer under MacOS and Win7).
In general, for an amateur, it’s better to start exploring 3D from what you like most, then you will always have time to retrain for what is needed. And you can start by drawing a Rubik's cube on OGL and DX. You will understand what is more convenient for you.
OpenGL is a thing that is needed to distribute your graphics on almost everything, but it’s not (for me) to work in it. This is most likely due to the fact that the developers of this lib were pulling the cat by the tail for a long time, and this now makes itself felt.
1) almost object-oriented; 2) DirectX3D is easier to understand the structure of the library itself, tried to learn OpenGL, a lot of questions for self-taught right on the fly, online help is also not very. So personally, I create my application on DirectX and C #, and then when everything is ready, I will slowly transfer the code to this not so developed, but very demanded OpenGL / OpenGL ES for cross-platform along with C ++ (Qt).