LWJGL Forum

Please login or register.

Login with username, password and session length

Author Topic: Creating a DirectX binding  (Read 40278 times)

Matzon

  • Demigod
  • *****
  • Offline Offline
  • Posts: 2242
Creating a DirectX binding
« on: July 09, 2007, 16:17:31 »

There have been some discussions about creating a DirectX binding for LWJGL on JGO, see this thread:
http://www.javagaming.org/forums/index.php?topic=16985

CaptainJester mentioned that he was already working on this.

LWJGL will be happy to donate to the project, and I encourage people to discuss this some more and help CaptainJester.
We can also provide SVN access.

Naturally there will be some integration work, that we will have to tackle - and this will be a win32 only binding (sans wine). However some people have talked about doing an OGL wrapper on top.

CaptainJester

  • Talks Too Much
  • ***
  • Offline Offline
  • Posts: 175
Re: Creating a DirectX binding
« Reply #1 on: July 09, 2007, 18:18:10 »

Hopefully I will have something preliminary to show in a couple of weeks.  Maybe just getting a triangle on the screen.
Logged
The problems of this world cannot possibly be solved by skeptics or cynics whose horizons are limited by the obvious realities.  We need men and women who can dream of things that never were. - John Fitzgerald Kennedy(35th US President)
8)

princec

  • Nerdus Imperius
  • *****
  • Offline Offline
  • Posts: 1898
Re: Creating a DirectX binding
« Reply #2 on: July 09, 2007, 18:36:55 »

Would like to explain to everyone that writing an OGL->Direct3D wrapper is really, really, really f*cking difficult :) SciTech basically couldn't manage it and they're pretty much experts. Well, they did one, but it was far from reliable.

Cas :)

elias4444

  • Nerdus Imperius
  • *****
  • Offline Offline
  • Posts: 636
Re: Creating a DirectX binding
« Reply #3 on: July 11, 2007, 17:40:16 »

I would definitely stay clear of an OGL -> D3D wrapper... I don't think it's worth the immense amount of work.

Would it be better to create a separate project (apart from LWJGL) for a D3D binding? I'm worried that by including D3D alongside the OGL bindings you might introduce platform inconsistencies throughout the project.

Is there some benefit of including D3D that I'm missing? I know Vista has had some issues with OGL, but they seem to be clearing up slowly, but surely.
Logged
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com

Matzon

  • Demigod
  • *****
  • Offline Offline
  • Posts: 2242
Re: Creating a DirectX binding
« Reply #4 on: July 11, 2007, 18:14:39 »

I dont expect many issues with supporting both opengl and directx with a similar Display. As for packaging and distribution we might want to split it up into lwjgl_ogl.jar / lwjgl_dx.jar or something like that - but lets worry about that further down the line.

The main benefit of having dx support is basically much better driver support on the primary win32 platform. Supporting dx on linux/mac could perhaps be done using wine - but I am very unsure about that.

erikd

  • Newbie
  • *
  • Offline Offline
  • Posts: 21
Re: Creating a DirectX binding
« Reply #5 on: July 11, 2007, 18:38:40 »

I would definitely stay clear of an OGL -> D3D wrapper... I don't think it's worth the immense amount of work.

Yes, the more I think about it, the less it makes sense. Apart from being difficult, it would never be the optimal solution. It's probably better to use a D3D binding in higher level libs like Slick and jME.
Logged

Nero

  • Newbie
  • *
  • Offline Offline
  • Posts: 2
Re: Creating a DirectX binding
« Reply #6 on: July 11, 2007, 21:16:25 »

Logged

Evil-Devil

  • Prolific Timewaster
  • ****
  • Offline Offline
  • Posts: 302
Re: Creating a DirectX binding
« Reply #7 on: July 13, 2007, 09:49:58 »

I think there should be no OGL -> D3D -> OGL Wrapper. Distribute both APIs as single packages and let the programmer handle how they like to use it. It is like writing an engine for LWJGL and JOGL (i never did, but some ppl i know did), setting up base abstract classes and doing the final stuff in specialiced classes. Thats the way I'd like to go with DX to, if I would use it in any project besides OGL.
Logged

publicminx

  • Newbie
  • *
  • Offline Offline
  • Posts: 1
Re: Creating a DirectX binding
« Reply #8 on: April 11, 2009, 11:07:30 »

hello folx ;)

i detected some times ago a nice java-direct3d wrapper ...

link: http://sourceforge.net/projects/java-direct3d

supports directx 9/direct3d and 64 bit (!) ...
sources (c++) are availiable ...
appears not to be under further development ;(

anyway: the result (in some quick/dirty tests) were: between twice and more times as fast as LWJGL ...
or better: this will most likely the case for most ATI/Catalyst users ... like me (i have a 4830 card)

the reason for that is the bad OpenGL implementation of AMDs/ATIs Catalyst Drivers ...
you can see that in "everyone-realworld-applications" like SecondLife, Ogre, ActiveWorlds and/or generally if you test Software which offers both: Directx/Direct3D and OpenGL or test on the same/similar systems with different Graphic cards ...

a nice Example is also this Engine/Demo: http://unigine.com/download/
(let you benchmark OpenGL, different Direct3D versions)

general: for ATI/Catalyst/OpenGL the most likely result is:
- Nvidia/Geforce is usually about twice as fast as ATI/Catalyst (or much much more in some situations)
- ATI/Catalyst Direct3D is about twice as fast asa ATI/Catalyst OpenGL (or much much more in some situations)

this also means: Ogre/Java (there is a binding) and Direct3D beats by far everything you can do with LWJGL/JMonkey in performance for ATI/Catalyst cards ...
because of the bad OpenGL Permance (extraordinary bad, not the typically result of the "more focus of the industry on Direct3d"!)

The main problems with the Catalyst OpenGL implementation seems to be in the Texture (Mem) Handling not in GPU-related stuff ...

In most typical "patched" Gamebenches or Synthetic Tests you cannot see that, because they run only with Opengl or Direct3d or tests statically stuf which has not much to do with what i call "Everyones Realworld Stuff" like SDL, SFML, Ogre, JWJGL, Jogl, JMonkey, Irrlicht, Second Life, all that OpenSim stories and so on and so on ...
all of them have to handle usually much more flexible structures, general texture handling etc.

so, Direct3D would make sense for much more concrete reasons...

(but please no odd name like "LWJGL" as base... better to rename both. show ppl the LWJGL page and talk about what it does and later ask them how the name was then you know what i mean)

Logged

bobjob

  • Prolific Timewaster
  • ****
  • Offline Offline
  • Posts: 394
  • LWJGL: WOW SO GOOD
Re: Creating a DirectX binding
« Reply #9 on: April 12, 2009, 23:07:01 »

Ok, Im sorry I really couldnt help myself.  :P


hello folx ;)
hi

Quote
i detected some times ago a nice java-direct3d wrapper ...
link: http://sourceforge.net/projects/java-direct3d
congrats!

Quote
general: for ATI/Catalyst/OpenGL the most likely result is:
- Nvidia/Geforce is usually about twice as fast as ATI/Catalyst (or much much more in some situations)
- ATI/Catalyst Direct3D is about twice as fast asa ATI/Catalyst OpenGL (or much much more in some situations)
thanx for the official stats.

Quote
(but please no odd name like "LWJGL" as base... better to rename both. show ppl the LWJGL page and talk about what it does and later ask them how the name was then you know what i mean)
sure thing boss.
Logged

Evil-Devil

  • Prolific Timewaster
  • ****
  • Offline Offline
  • Posts: 302
Re: Creating a DirectX binding
« Reply #10 on: April 14, 2009, 11:43:13 »

Since when does the GL in LWJGL stands for (Open GL)? :D
Anyway, a feasible D3D binding would be cool, tho the overhead for any recent lwjgl/jogl based engine.
Logged

@

  • Newbie
  • *
  • Offline Offline
  • Posts: 41
Re: Creating a DirectX binding
« Reply #11 on: May 30, 2014, 14:20:54 »

Sorry if i'm misposting, but i'm curious: What happened with this? Does exist a way to use directx with java? Are there any plans for including a wrapper on lwjgl 3 ?
Logged