But if MSFT actually suceeds in killing OGL on the PC Then we mayhave no chocie but to come up with a DX support layer for Java.

Who's we? The Java developers or Sun? As a Java developer I want options, not being a pawn in some company struggle or domination. I wouldn't be surprise if Sun is against supporting DirectX in Java but why should I care?

...

DirectX is the preferred low-level graphics API for gaming on Windows so why shouldn't Java support it now?

Java DOES support it now. Its called JNI. Go write your own JNI wrappers.

But if you want Sun to provide those JNI wrappers for you then the first part of your post makes absoltuely no sense, right?

Got a question about Java and game programming? Just new to the Java Game Development Community? Try my FAQ. Its likely you'll learn something!

I can't say I understand why you're making such a big deal out of the DirectX thing.

Well I'm pushing the issue a little. Nothing wrong with that, is it?

Quote

Obviously nobody has felt a big enough need for a directx binding to actually go out and make one.

First Sun didn't feel a need for a JOGL. Then they did. Things change.

Quote

I think that if you choose Java as your development platform, cross platform support is probably important to some degree. If that is the case OpenGL, OpenAL and other cross platform apis seem like a natural choice.

I can understand your argument if the cross-platform ability of Java is your only reason for using it? What if you just like Java and would rather use it instead of any .NET language including J#?

The importance of being cross-platform is also very much application dependent. Is it so important to you that your new game runs on Solaris that you're prepared to lessen its chances on Windows?

You can never fully rely on the programming language to achieve cross-platformity. Sometimes you have to achieve it at the application level by supporting several alternatives that may not each be individually portable but very suitable where they do run.

Quote

If your going to develop for windows only, maybe C#/Managed DirectX is a better fit than Java in the first place.

It may be but the question I'm asking is - does it have to be that way?

There is a choice - you can always go and use C# if you want to use DX. Since DX ties you to windows anyway you're not exactly loosing anything.

Sure but then I wouldn't be a Java programmer anymore. I could quit programming altogether too. Just imagine how many problems that would solve, apart from maybe where my next paycheck was going to come from.

Doesnt really seem to be worth the trouble. Same like making a game run on a 300mhz cpu instead of a 500mhz one. ROI wise its unlikely to pay off. (Unless you're using some abstraction layer or some engine which handles the api differences... obviously. Which would be surely great, but not necessarily great enough for spending some years of spare time on it. Well, there is java2d which sorta kinda does that kind of thing.)

Wrong comparison. OpenGL provides roughly the same functionality as Direct3D, but DX includes more than that. However all the additional bits have their own analogs - DirectInput is wrapped with JInput, DirectSound is roughly equivilent to OpenAL. The only bit that doesn't have a direct equivilent is D3DX which is a bunch of utility classes for doing vector math, model loading, etc. But you can always find lots of java code for that kind of thing lying around.

I think the issue here is not wether or not dx is friendlier, has more features or something, I think the issue here is that dx (or more specifically, D3D) is a major rendering API with a lot of experience from D3D developers and support on (for java) the most important gaming platform, windows. Compatibility of java games on windows would probably improve, if it was using D3D instead of OGL.IMO, it would definitely be a Good Thing if there would be a d3d wrapper for windows, although it should be clear that OGL would be the api of choice if instant cross-platformness is a requirement.

Actually I am surprised that noone created a DX binding for java by now...

To me it seems clear that such an effort has to arise out of the community and can't be pushed by SUN, since the "write once, run everywhere" buzz is a central point of JAVAs marketing strategy. Providing a platform dependent official library simply does not match with that.

Some people seem to be afraid that Microsoft will sabotage there OpenGL binding for vista. I think that would be extremely unlikely because it would mean many games will not work on vista witch would deter people to switch, Microsoft’s biggest fear.

Your authorative style doesn't impress me at all. From what I know Sun employees haven't been granted any special rights here. It's a discussion forum and not a place where you tell people what to think. If you have no arguments then why not just exercise your right to remain silent.

I think "freedom of choice" is really the only good answer to the "Why no DX" question. And it addressse both sides:

Interesting argumentation in the utilitarian tradition. You start with the proposition that "Java shouldn't support DirectX". Then you continue to compare the impact of this for two parties, namely "society" as a whole on one hand and the individual developer on the other. You arrive at the conclussion that your proposition is justified because "society" has more to gain than the individual developer has to lose.

So in the name of the greater good the individual has to give - Java shouldn't support DirectX. It's just that in my book the balance looks different. I think it's more to gain if the individual Java developer is given the chance to come up with the next killer game using DirectX if he so wishes (*).

So here we stand.

(*) I'm talking about a real chance here which requires an existing and supported DirectX binding for Java.

So in the name of the greater good the individual has to give - Java shouldn't support DirectX.

As has been said before, exposing a platform specific api doesn't fit well with the whole java wora philosophy. For that reason there will probably never be a jsr for a directx binding. As far as I know there's no precedent for that (correct me if I'm wrong here please).I don't think anybody's saying that there should never be a java direct3d binding, but if sun isn't interested and nobody in the community is motivated enough to make a binding, then nothing's going to happen.The way I see it this leaves you with a couple of options

Make a direct3d binding yourself. As Jeff said, nothing's preventing you from doing it via JNI. This is no different from the way the opengl bindings are implemented

I think the issue here is not wether or not dx is friendlier, has more features or something, I think the issue here is that dx (or more specifically, D3D) is a major rendering API with a lot of experience from D3D developers and support on (for java) the most important gaming platform, windows. Compatibility of java games on windows would probably improve, if it was using D3D instead of OGL.IMO, it would definitely be a Good Thing if there would be a d3d wrapper for windows, although it should be clear that OGL would be the api of choice if instant cross-platformness is a requirement.

This is actually pretty interesting. Think of all the knowledge and experience we'll gain once we support DX and developers begin to flood in.

Further, choice is good, even if the other choice is considered 'less' for one or more reasons, which might not apply for certain developers.

Hi, appreciate more people! Σ ♥ = ¾Learn how to award medals... and work your way up the social rankings!

I think the issue here is not wether or not dx is friendlier, has more features or something, I think the issue here is that dx (or more specifically, D3D) is a major rendering API with a lot of experience from D3D developers and support on (for java) the most important gaming platform, windows. Compatibility of java games on windows would probably improve, if it was using D3D instead of OGL.IMO, it would definitely be a Good Thing if there would be a d3d wrapper for windows, although it should be clear that OGL would be the api of choice if instant cross-platformness is a requirement.

This is actually pretty interesting. Think of all the knowledge and experience we'll gain once we support DX and developers begin to flood in.

Further, choice is good, even if the other choice is considered 'less' for one or more reasons, which might not apply for certain developers.

Yes, exactly my thoughts . We need to be a little bit more practical.To me it makes sense that Sun won't be investing in a D3D binding, but java is not just Sun. No need to blame them for not having D3D in java, there's nothing really stopping us from doing it ourselves.For making porting easier, we can also think about delegating D3D functions to OGL calls on other platforms.

Think of all the knowledge and experience we'll gain once we support DX and developers begin to flood in.

Why would that attract developers to Java? You wouldn't get the cross-platform benefit so if you are sticking to Windows you already have the CLR and managed code to get similar benefits to Java... granted the tools still don't compare to what Java offers.. but I just don't see Direct X/3D support as a motivating factor.

I think it makes much more sense to have Direct X/3D support just like the Java 3D team did it.. where it is completely hidden behind a more portable framework. JInput seems to work like that as well. I actually wish that Sun would improve Java sound so things like OpenAL bindings weren't needed.

Supporting the 3D on Windows in the most compatible/stable way makes sense.. but not if I have to write Windows-only code. As I understand it Windows will have OpenGL 1.4 emulation via Direct 3D - They should open source that so people can keep it up to date with the latest OpenGL specs and simply let that BE the way OpenGL works on Windows. As long as the full OpenGL spec is supported without a significant performance hit that's all that really matters. It would make more sense for Microsoft to not put the burden of Direct X and OpenGL support on the graphics card driver writers anyway. Get them to do good Direct 3D implementations only and then have one Open GL implementation that was very stable, layered on top of Direct 3D. As long as it worked "good enough" everyone would be happy.

I will spare you all the rant about competition being "good" when it is coming from an evil monopolist that doesn't have "real" competition because of the monopoly. If it wasn't Microsoft behind Direct 3D I would welcome the competition for another cross-platform 3D API. Direct 3D isn't cross-platform though and it is supported by a criminal company that has never done anything to support the computing industry on good will.

Why would that attract developers to Java? You wouldn't get the cross-platform benefit so if you are sticking to Windows

Well, it's just a rendering API. Everything else will still be as portable if the windows-only game turns out to be successful enough to port it to other systems if the need should arise later. CLR doesn't give you that kind of portability even you would use OGL (unless you want to take a risk and use mono).

Quote

I think it makes much more sense to have Direct X/3D support just like the Java 3D team did it.. where it is completely hidden behind a more portable framework.

Oh I agree, but a good starting point for that would be a java D3D binding, wouldn't it?

I will spare you all the rant about competition being "good" when it is coming from an evil monopolist that can doesn't have "real" competition because of the monopoly. If it wasn't Microsoft behind Direct 3D I would welcome the competition for another cross-platform 3D API. Direct 3D isn't cross-platform though and it is supported by a criminal company that has never done anything to support the computing industry on good will.

I suppose this is the true resaon why many people oppose DirectX for Java. It's because Microsoft is behind it.

Java is highly portable but that doesn't mean it cannot be used with non-portable API's. Think of Java as just another programming language and DirectX as just another non-portable API. What reasons would there be for Java not to support it? To put Java at a disadvantage so people will use C++ instead? Is that such a good way of channelling your hatred of Microsoft?

What reasons would there be for Java not to support it? To put Java at a disadvantage so people will use C++ instead?

Theres the obvious reason that people will waste resources on it and very few games support both apis at the same time. The reason is that you don't just have to do a binding like that you have to provide fixes for all the major screwups from ati and nvidia drivers running in tipical system configurations. That is if you want a prophessional binding. Just binding it directly to the API would not solve shit.

Also everything we need to make great games is provided by jogl with several driver fixes already in place. No way in hell i would wish for someone to have to go with that driver bug hunting again for a directx binding. But if anyone is masochist enough go ahead and try it. Theres just no point on doing it for someone who just wants to do a game. And you certainly don't need to go to C++ because you have a fully functional cg api that is as good as directx and much more portable.

No it's because Microsoft is evil and we are doing it for your own good.

People are disgusted with Microsoft for a reason. If not look at just a few decisions made by them to turn cg apis for PCs into a swamp. Its their usual war tactics of dividing to conquer. DirectX uses the left handed coordinate system with Y up for no reason besides complicating. UV coordinates are screen cordinates with (0,0) being the top-left corner and Y going down again for no reason. To complicate things even further they store matrix data in the same order (column-major) as opengl does and thats because its easy to make calculations. It's no wander that people try to avoid DX shit whenever they have a chance.

To obtain what amounts to a right-handed world, use the PerspectiveRH and PerspectiveLH methods to define the projection transform. However, be careful to use the corresponding LookAtRH function, reverse the backface-culling order, and lay out the cube maps accordingly.

so you can use a right-handed CS by calling functionRH instead of functionLH and reverse backface culling..

So who's taking away your freedom of choice? Im just pointing out some reasons why in my opinion this would be only freedom to waste your time. But go ahead, do a D3D binding and show im wrong.

I never wrote that I wanted a D3D-Binding ... in contrast, some posts earliar I said that I this doesn't make sense IMHO, because Managed DX will always be one step ahead.. all I wanted to say is that anyone who wants to write one should do that, as you noted too

so you can use a right-handed CS by calling functionRH instead of functionLH and reverse backface culling..

My point is not if you can use that system or not. You can simulate any cs you want in any graphics 3d api. DirectX is still a left-handed coordinate system unless you write some code to simulate a different one. Besides it's not just as simple as flipping the camera and reverse backface culling. Read the rest.

Quote

Microsoft Direct3D uses a left-handed coordinate system. If you are porting an application that is based on a right-handed coordinate system, you must make two changes to the data passed to Direct3D.

* Flip the order of triangle vertices so that the system traverses them clockwise from the front. In other words, if the vertices are v0, v1, v2, pass them to Direct3D as v0, v2, v1. * Use the view matrix to scale world space by -1 in the z direction. To do this, flip the sign of the M31, M32, M33, and M34 fields of the Matrix structure that you use for your view matrix.

To obtain what amounts to a right-handed world, use the PerspectiveRH and PerspectiveLH methods to define the projection transform. However, be careful to use the corresponding LookAtRH function, reverse the backface-culling order, and lay out the cube maps accordingly.

Although left-handed and right-handed coordinates are the most common systems, there is a variety of other coordinate systems used in 3-D software. For example, it is not unusual for 3-D modeling applications to use a coordinate system in which the y-axis points toward or away from the viewer, and the z-axis points up. In this case, right-handedness is defined as any positive axis (x, y, or z) pointing toward the viewer. Left-handedness is defined as any positive axis (x, y, or z) pointing away from the viewer. If you are porting a left-handed modeling application where the z-axis points up, you must do a rotation on all the vertex data in addition to the previous steps.

The essential operations performed on objects defined in a 3-D coordinate system are translation, rotation, and scaling. You can combine these basic transformations to create a transform matrix.

When you combine these operations, the results are not commutative: the order in which you multiply matrices is important.

Flipping the order of triangle vertices and and adjusting the matrices is needed for converting the data from RH to LH. By dying so, you will to call functionLH..

If you want to use a right hand CD and your data is defeined in right-handed CS, you have to use functionRH and only reverse the cull-mode (and s.th. for cube maps..). Not using cube maps means changing exaclty one flag more when using a RH insterad of an LH CS!

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org