Can you mix OpenGL with Direct X?

Started by
16 comments, last by Fredric 24 years ago
I was wondering if you could write pieces of a game in OpenGL, and others in Direct X. I''m involved in a project with another programmer- who is learning Direct X while I''m learning OpenGL... is this a problem? Programming::~Fredric(const Annoy_Ance)
3D Math- The type of mathematics that'll put hair on your chest!
Advertisement
Yes and no. As long as you don''t try to mix oGL with Direct3D or DirectDraw it will work fine.
?? So, OpenGL DDRAW AND D3D don''t go at all? damn

Programming::~Fredric(const Annoy_Ance)
3D Math- The type of mathematics that'll put hair on your chest!
Nope. It''s one or the other. When you''re dealing with matters of graphics, you can only really have one API working at a time. If its claimed by OpenGL, there is no room for graphical DirectX, and vice versa. The way they work is VERY different, and they do not mesh well - at all.

However, not all is lost; all non-graphical aspects of DirectX, such as DirectInput and DirectSound and DirectPlay and so on will work fine with OpenGL.

You''re just going to have to make a decision about what your goals are, what you will be able to do with what you know, as well as your desired platform. If its 2D only, I advice DirectDraw; if its 3D, I advise OpenGL. Either way, good luck, and pursue it to no limit. Naturally, it''s best to know both graphical DX AND OpenGL.

- Hai, watashi no chichi no kuruma ga oishii deshita!
...or, in other words, "Yes, my dad's car was deliscious!"
- Hai, watashi no chichi no kuruma ga oishikatta desu!...or, in other words, "Yes, my dad's car was delicious!"
Thank you for your advice... I''m not sure whether to learn DX or OpenGL, but could someone explain to me why OpenGL is not as good at 2d as DDraw? I heard that you need to learn VC++ for Direct X... that''s mainly why I chose OpenGL in the first place, because I hate VC++! So confusing with all those handles and stuff! Anyhow, can someone help me out?

Programming::~Fredric(const Annoy_Ance)
3D Math- The type of mathematics that'll put hair on your chest!
maybe you could make 2 versions of what you''re working on. one for OGL and one for DX. it may be extra work, but hey, why not?
One of the reasons OpenGL isn''t as effective for 2D as DirectDraw is that OpenGL, regardless of what you''re doing, is always running 3D (when you want 2D, you just specify an orthographic projection, but OpenGL still behaves as though you''re specifying things in 3 dimensions). I suppose OpenGL does have various commands for pushing raw pixel data to the framebuffer, but I''m a little uncertain as to just how accelerated that is compared to blitting in DirectDraw. OpenGL was designed more for rendering primitives and the like, while DirectDraw was specifically designed for slapping bitmaps around in video memory.
direct x 2d graphics look way better than open gl 2d graphics. i''ve been working on both, got 2d working in both of them, and the ogl version of my graphic is dithered, somewhat. however, i''m deciding on using opengl because the codes much easier, and my game is mainly in 3d, so the player won''t have time to pay too much attn to dithered 2d. i''ve been trying to integrate 3d models with 2d graphics (i.e. cockpit in sim) for a while, and i finally got it goin in open gl. direct x, i can just not get direct 3d up and running (via loading x files). bottom line: opengl 3d is as good as ddraw, opengl 2d sucks crap like d3d, but at least i can get it up and running.

a2k
------------------General Equation, this is Private Function reporting for duty, sir!a2k
Direct x is mainly for VC++. However in version 7 there is some stuff for visual basic as well, although, i believe they are little bit slower. If you are new the graphics programming / geometry environment, i woudl definately recommend starting with OPENGL. Direct X is difficult because of the cryptic way it works for beginners, or novices. Opengl hides alot of the hardcore stuff , but does allow one to access that if needed> and makes it a lot easier. John McCormack, Creator of Quake, went from direct x to OpenGl becuase of its ease of use. in the memo he wrote, he stated :" Remember if you are use an API to write a game you will be working with it alot. Therefore make sure its something you''re comfortble with" .

OpenGL is able to do things in a few lines of code that takes DX quite a bit more code to do. There is no speed difference between them that i have noticed. However, remember OpenGL is not the world''s most compatible API. It was designed on a SGI machine, and ported to use 3d Accelerated cards. For the few people who dont have 3d Accelerated cards in their machines, it may run very very slow. and different cards have different effects on OpenGL. Fir instance the older voodoo cards have to be run in 16 bit color mode, or its dog slow. i am not sure about the new ones.

Keep these things in mind when deciding. I had to make the same decision, and ultimately went with OpenGL.

CXI

The Code is a Living breathing entity, and will move in accordance with you, therefore, be one with the Tao of the Code..
The Code is a Living breathing entity, and will move in accordance with you, therefore, be one with the Tao of the Code..
Basically, as long as you don''t mix the rendering aspects everything is OK.

i.e. You can use OpenGL with all DirectX components apart from DDraw & D3D.

On the other question, I am learning OpenGL, I don''t want to start an API war, but I do like it, and so far have found it quite easy to pick up. Although if you don''t like VC++, it might not be a good option.


-Mezz

This topic is closed to new replies.

Advertisement