Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Promit

OpenGL Mixing D3DX and OpenGL

This topic is 5659 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This is more of a comment than a question, but I thought I''d say it anyway. Basically I was coding an OpenGL camera class, and didn''t feel like writing all the various math functions for matrix rotation around axis, matrix transform coord, matrix do every freaking thing, etc. I found myself wishing that I was using Direct3D so I could have my oh so precious SIMD accelerated D3DX library. Then I got an idea and through #include <d3dxmath.h> into the header file, started over, and used those convient D3DX functions. Those are bloody useful things; the only catch is that you have to build the View matrix yourself, since D3DX will create a D3D row major one, not a column major. Of course, I usually put together the view matrix myself after working out the look, up, and right vecs anyway, so this wasn''t a problem. I''m just saying, so many of us use OpenGL, DSound, and DInput, why not throw in D3DX as well? It makes things way easier, and that math part is seamless to integrate. Obviously, some pieces won''t work without major hacking (e.g. D3DXMesh) but you don''t have to do the math yourself! Now you can code OpenGL AND be lazy

Share this post


Link to post
Share on other sites
Advertisement
To enhance the point that it''s ok to mix and match DX and OGL and that the real world, including MS do so: for amusement do a search of the binary in D3DX8.LIB for "_glu"

I think it''s only the fanboys with irrational hatred for all things MS* who''d object to mixing and matching bits from each API (on an x86 based Windows platform).

[* time to look at the ARB members list again ]




--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
It''ll kill portability, but if that''s no problem for you, then it''ll work. If you use the ARB_transpose_matrix extension, then OpenGL will accept row-mahor matrices directly, and you don''t need to convert manually.

quote:

time to look at the ARB members list again


Not for long anymore. Afaik, it''s planned to kick MS from the ARB when OpenGL 2.0 comes out.

Share this post


Link to post
Share on other sites
quote:
To enhance the point that it''s ok to mix and match DX and OGL and that the real world, including MS do so: for amusement do a search of the binary in D3DX8.LIB for "_glu".


Wow! Nice catch. I guess they figured calling glu routines was easier than learning all of this new fangled algebra stuff.

quote:
I think it''s only the fanboys with irrational hatred for all things MS* who''d object to mixing and matching bits from each API (on an x86 based Windows platform).


I''m not a fanboy, but I''ve seen some weird stuff happen on two of my nVidia cards when I load both Direct3D and OpenGL into a single process. Though I don''t think I''d do it myself, you might be able to get away with just using the math routines from D3DX.

Personally, I think I''d prefer to write my own math library if I were using OpenGL alone. Since the video card should be doing most of your transformations, I don''t think there are really alot of routines that need to be optimized with SIMD code. A matrix multiplier for transforming batches of vectors is about the only thing that comes to mind.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!