Jump to content
  • Advertisement
Sign in to follow this  
ProgrammingNerd

OpenGL assembly in directx

This topic is 4780 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

Is it efficient to write assembly versions of the D3DX functions( D3DXVec3Dot, etc) if I am trying to write a cross-platform api, ie everything that is the game would be separate from directx, so i could write a "plugin" in opengl and it would work. Only one thing, I'm assuming that it can't be cross-platform if I'm writing intel-specific assembly code. Please help, and thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
I wouldn't bother going to low-level assembly - that's just over the top really. Also, unless I'm much mistaken there's already a D3DX equivalent for OpenGL (GLU/GLUT?). Not to be rude, but I'll put money on either of those implementations being better than most individuals can come up with [smile]

If you write good, clean, C/C++ code that is ISO (or close to) standard it'll compile down to a binary on each supported platform, unless you're a really good assembly programmer the compiler will probably generate better code anyway. Thus you can still maintain cross-platform qualities but with a lot less hassle on your part.

hth
Jack

Share this post


Link to post
Share on other sites
Often the math is done using standard C/C++, however, many base components, such as vectors etc are implemented using assembly, because you use the SIMD instructions which allows you to multiply 4 vectors in one go (etc), something that C/C++ doesn't know itself.

So, commonly, vectors and matrices is worth and has the ability of getting a tremendous boost from this, but many functions are not even worth considering for assembly as there is a minor speed boost and are used very rarely.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!