Jump to content
  • Advertisement
Sign in to follow this  
tmtlib2010

Direct3D simplifier (easy as OpenGL) for Delphi

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

Hello! I release my new simple program demonstrating D3D usage in Delphi.
Now you can use DirectX programs like that:
dxuLookAt(0, 0, 30,5, 0, 00, 0, 1, 0);
dxBindTexture(DX_TEXTURE_2D, texid_dx);
dxPushMatrix;
dxRotatef(180,1,0,0);
dxTranslatef(0,-10,0);
dxBegin(dx_TRIANGLES);
dxTexCoord2f(0,0);
dxVertex3f(0,0,0); ... etc.
It is first release of OpenGL to Direct3D wrapper. We can improve it together. Btw, it usable already!

OpenGL to Direct3D wrapper made with Delphi
(This program demonstrates OGL vs D3D rendering difference).

v0.1 features list:
- dxRotatef
- dxTranslatef
- dxuLookAt
- dxMatrixMode
- dxLoadIdentity
- dxuPerspective
- dxClearColor
- dxClear
- dxDisable
- dxEnable
- dxBegin
- dxTexCoord2f
- dxVertex3f
- dxEnd
- dxPushMatrix
- dxPopMatrix
- dxBindTexture

Download source code and EXE demo: opengl_to_directx_01.zip (300kb)

new versions at igrodel.ru
p.s. And it does NOT require D3DX.DLL =)

Share this post


Link to post
Share on other sites
Advertisement
I really like the idea. When choosing between DirectX and OpenGL, I've always decided to use OpenGL so far. The main reason was not platform independency or something like that - it was the plain look of OpenGL code compared to its nasty DirectX equivalent.

Though, Delphi isn't of any interest for me. If its a .dll library I can link with any language, I'm really looking forward to it. Hope, the overhead isn't too high there.

Share this post


Link to post
Share on other sites
making dll is a good idea. Main problem is about limitations. For example opengl extensions is difficult to implement in full amout. opengl 1.0, vertex arrays and multi texturing can be made without any problems. More advanced things like shader support and directx specific extension better implement in opengl style, but not compatible with GL specifications. Maybe =) Hope this code will help learn some D3D. Thank for feedback.

Share this post


Link to post
Share on other sites
I don't think you should be aiming to do a 100% OpenGL-Equivalent wrapper. For performance and structure issues it might be best to abandon full compatibility right from the beginning. Better focus on "making it as similar as possible" but without forcing it to be exactly the same. If you'll have to generate huge amounts of internal management code to wrap Dx functionality to OpenGL, it might turn out bad for performance and stability. In those cases, it might be better to mimic the OpenGL style but not its functionality. However, 1:1 is great in areas where it's possible!

Share this post


Link to post
Share on other sites
I asked some questions on other forums and decided to implement OpenGL VBO through D3D. If anyone have suggestions about that please let me know.

Share this post


Link to post
Share on other sites
There is very similar project already from Google: ANGLE.
Although it doesn't use OpenGL API, it uses OpenGL ES 2.0 API (very similar to GL 2.x). If you can find GL ES API headers for Delphi, then you can already use ANGLE project. It supports even shader translation from hlsl to glsl (ES set).

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!