Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (581)
games submitted by our members
Games in WIP (500)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 2 [3]
  ignore  |  Print  
  jogl API feedback requested for JSR 231  (Read 12873 times)
0 Members and 1 Guest are viewing this topic.
Offline shaddam_IV

Junior Member




Java makes me happy the way C# doesn't!


« Reply #60 - Posted 2004-04-17 06:13:51 »

Quote
In addition to things I have mentioned in my first post (security), I wonder if it would be possible to integrate java images with opengl calls - so ImageIO could be used directly for feeding textures to opengl.

There is also a big question of updating the official binding. With JOGL, in theory you could just regenerate it every time  new glext.h appeared. With official libraries, it would be very bad to have to wait more than few weeks for new extensions to appear in GL.java - so some kind of process has to be set up to keep it up to date.


I think the main GL class should not extend the OpenGL API any more than it has to, so I don't think we should integrate ImageIO with the javax.media.opengl.GL class.  However, I do think you are correct that it would be nice to have some functions of convenience that leverage the power of Java with the OpenGL API.  Perhaps a set of utility classes in a package named javax.media.opengl.util could do it.  This would be a separate set of classes that do things like load textures and models, or perhaps even contain mesh utilities like DX has.  The nice thing about this approach is that it doesn't muddy the core OpenGL API but contains the higher level functions of convenience that most of us would like.  Of course, this is extra work.  It might be better to provide these util functions as an open source community project instead (Of course, this would require a non-javax package name).

What do you think, abies (or anyone else)?

I second the motion for having an official process for getting new extensions pulled into the bindings in short order.

There are 10 kinds of people in the world.  Those that understand binary and those that don't.
Offline hdevaan

Senior Newbie




Java games kick @ss!


« Reply #61 - Posted 2004-04-17 07:28:08 »

Quote


I think the main GL class should not extend the OpenGL API any more than it has to, so I don't think we should integrate ImageIO with the javax.media.opengl.GL class.  However, I do think you are correct that it would be nice to have some functions of convenience that leverage the power of Java with the OpenGL API.  Perhaps a set of utility classes in a package named javax.media.opengl.util could do it.  This would be a separate set of classes that do things like load textures and models, or perhaps even contain mesh utilities like DX has.  The nice thing about this approach is that it doesn't muddy the core OpenGL API but contains the higher level functions of convenience that most of us would like.  Of course, this is extra work.  It might be better to provide these util functions as an open source community project instead (Of course, this would require a non-javax package name).

What do you think, abies (or anyone else)?


I agree with shaddam_IV on this; reuse of existing image I/O classes is good, but it has a more 'rightful' place in an opengl.util package. I'm not sure if going so far as to keep image I/O outside of the JSR 231 API is a good idea though. It's true that we should be careful not to turn part of the API into a complete 3D engine, but something like image I/O can certainly be branded 'core functionality' for any 3D API.

Quote

I second the motion for having an official process for getting new extensions pulled into the bindings in short order.


Agreed, waiting too long on new extensions would very likely hurt JOGL popularity (although one or two weeks aren't going to kill any of us, are they?).
Offline trance-x

Junior Newbie




Java games rock!


« Reply #62 - Posted 2004-04-17 16:30:15 »

>Uh, trance.  I don't think you are following the
>argument correctly. You seem to think the people
>who want to be consistent want to change things.  
>Please see www.dictionary.com for a definition of
>the word "consistent."  That is exactly the
>opposite of what we are saying.


www.dictonary.com:

-----------<snip>
Entry:   consistent
Function:   adjective
Definition:   compatible
Synonyms:   accordant, according to, agreeable, agreeing, coherent, compatible, conforming with, congenial, congruous, consonant, equable, harmonious, like, logical, matching, sympathetic
Antonyms:   disagreeing, incompatible, incongruous, inconsistent
Concept:   correspondence
Source:   Roget's Interactive Thesaurus, First Edition (v 1.0.0)
Copyright © 2004 by Lexico Publishing Group, LLC. All rights reserved.
-----------</snip>

and? nothing has changed ...


>We are suggesting maintaining exact names across languages.  

no. "some" ppl. other ones had a discussion about the "_gl". look at the first page of this thread. look at the reactions. and: i was delegated to write here, you can see my own thread in this forum. so it seems there are several topics ...

and my reaction to "your" topic: no problem with that. but this was not "my" topic. so: your "consistence" targets "another topic" ... its similar, it could be mixed, but it not the same.

furthermore: there is _no_ combination where "gl._gl" makes something consistent. didnt you read what i had written? my argues were - as a side aspect - also valid for "your discussion" and naming conventions in general. ...  it would not be senseful keeping java consistent AND makes no sense keeping consistence between two different languages AND makes no sense keeping java to GL consistent. the reason: it is a product of a conversion which creates something "new" ...   this leads to a general inconsistence ...  i simply want avoid such trends ... thats all.

//Remember, the "pro-renaming argument fails to
//address the issue of naming your GLDrawable
//something besides "gl", which has great potential to  
//confuse others.

no. great potential to confuse means in forums often only that someone thinks that it should be to keep an argumentation.

"Drawable" has a meaning. what means "Drawable"? what are the "real" differences between a "Drawable" from an openGL package to any other java apis? what about the addressing in other situations? how do you handle and name "methods" in general? ... i see no problem ... only a problem which was made because a bad conversion ... not only your problem: "JFrame" (swing) is also no good solution .... you have a "swing"-ui or any other api and inside should be a "Frame"... a frame from swing, a frame from ui XY... but no "XFRame", "Frame", "JFrame", "GLFrame"...

sometimes... - thats life - there are good reasons to break consistence ... but not in those simple cases ...

note: you can say "the arm of a human" ... "humans arm" ... but avoid things like "humans arm of a human" ... in computer languages, in offline life, general :) (exceptions are hacking languages with lives from chaotic combinations. thats ok, i like chaos too, but thats not java) ... ... earlier or later you will produce more and more inconsistence ... unnecessary overhead ... "Drawable" means "Drawable". thats all.  "get" means "get" ... there is no reason to produce "gl_get", "xy_get", "bla_get" ... "gl." adresses enough and gives no confusion ... (api design play another role here... lalala.bla.blubb.quak.Drawable is another thing as "gl.bla.Drawable")

... so please keep things simple... forget ALL "_gl", "GL" ... that means in some situations a bnit more work but in thousand other cases more consistence and less work. "implements"  or creating new objects are exceptions .... masses of "_gl"s  in every line not!

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Markus_Persson

JGO Wizard


Medals: 12
Projects: 19


Mojang Specifications


« Reply #63 - Posted 2004-04-19 10:35:42 »

My requests for JOGL/JSR 231:

1) Exposed swapbuffers so we're not forced to use the Animator (I understand this has already been implemented? yay!)

2) Some way of making it work in an applet for someone who has installed a recent version of java without having to purchase a verisign certificate. Applets, suck, I know. But 3d on webpages = teh sexy. Wink

3) Stability / Less jvm level crashes. I've had some problems with certain hardware crashing totally when I try using PBuffers. This wouldn't be a problem if it just threw an exception, but right now it crashes and dumps a log file to disk.

Other than that, I think it's fine as it is. Sure, it would make more sense to have "gl.vertex3f" instead of "gl.glVertex3f", but it doesn't really matter either way.

Play Minecraft!
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #64 - Posted 2004-04-20 05:52:53 »

Gregory Pierce had some good ideas that I'm not sure have been mentioned.

I think one of the mains ones was brought up early on in the thread though...

It makes no sense for there to be multiple OpenGL bindings, there is only one OpenGL API, and usually only one implementation available at the system level.  So abstracting away the dependency on AWT,SWT,LWJGL etc. make a lot of sense.
Have bindings that deal with a GL context and a way to get that context from AWT windows, Swing windows, SWT windows, LWJGL screens, etc.

This will allow for better interoperability between the various APIs that we would possibly want to use.

Each of LWJGL, SWT, AWT etc.  have different philosophies but stupidly their have been separate OpenGL bindings made for each, when OpenGL is one thing that isn't actually different between them.. What a waste of effort.  Let the various APIs have their differences, but let's keep the stuff that should be shareable between them so that it is actually shareable (hint GL context).


P.S.  Just to be fair I have to say that I haven't actually used any of the OpenGL bindings yet.  But I expect to at some point and I would rather not have to deal with a mess when I get there.

Offline jonmeyer

Junior Newbie




Java games rock!


« Reply #65 - Posted 2004-04-20 18:43:09 »

I don't mind too much about the whole prefix issue. Pick one and go with it.

My top issues:

1. A single API standard that works across all the GL bindings (LWGL, JOGL etc) - we did it for XML parsers, now lets do it for OpenGL. I shouldn't be tied to a single implementation because of the standard.

2. SWT Support, or at least make it easy for someone to provide it. Distance the JSR from the AWT.

3. My app does smart swapping, using a glCopyArea when only a small portion of the back buffer is dirty. For this I need manual glSwapBuffers control.

4. glVertexPointer should accept non-direct FloatBuffers and float arrays, and not be restricted to direct FloatBuffers. Ditto glColorPointer.

5. Some specification of expected behavior if you call native code that executes GL routines. Some of my rendering code is owned by a third party and they won't port to Java.

6. My one naming issue: GLUtesselatorCallback and its brethren. By instinct I type GLUTesselatorCallback. The GLUtesselatorCallback just feels plain wrong.  And on that topic, should GLUtesselatorCallbackAdapter be just be GLUTesselatorAdapter.  Cf. MouseAdapter.

Jon
Offline Mithrandir

Senior Member




Cut from being on the bleeding edge too long


« Reply #66 - Posted 2004-04-21 04:32:08 »

In order of priority:

1)  An specification that is thoroughly specified, not just a copy of the (non-existant in many cases) Javadoc. If I want to implement my own version of the specification, the document should be clear and unambiguous enough that I can do it without asking questions.

2)  Scalable API definition.  It's impossible to extend the API with vendor specific additions right now. Considering that OpenGL gets extended far faster than the JSR process ever does, this restricts us to only very slow changes. If a vendor introduces a new set of APIs and I want to limit my application to those APIs, let me. Get out of my way and let me do what I want. It should have interfaces for the core OpenGL spec and then extension interfaces for each vendor etc.

3)  Get rid of lazy instantiation (or at least select a mode where it is immediate). Trying to do realtime graphics apps using offscreen buffers is impossible right now if you need to do one-off rendering to a buffer and synchronise it to the current frame.

4) Textures should be able to take NIOBuffers. Right now we still have to pull the images into Java land, when we don't really need to.

5) *Pointer methods should take non-direct buffers

The site for 3D Graphics information http://www.j3d.org/
Aviatrix3D JOGL Scenegraph http://aviatrix3d.j3d.org/
Programming is essentially a markup language surrounding mathematical formulae and thus, should not be patentable.
Offline shaddam_IV

Junior Member




Java makes me happy the way C# doesn't!


« Reply #67 - Posted 2004-04-21 05:20:24 »

Quote
...abstracting away the dependency on AWT,SWT,LWJGL etc. make a lot of sense...

Although this sounds desirable, I wonder how feasible it is when it comes to implementation.  If each API has its own version of a native rendering surface, I think it will be very impractical to develop methods for handling every single custom API rendering surface.

IMHO, because the bindings are meant to be a part of the official Java platform, we should only have "official" support for the official Java platform APIs.  Namely, Swing and AWT.  If unofficial APIs, such as SWT, want to use the bindings they should conform to the official OpenGL bindings, not the other way around.

In any event, most (all?) non-standard APIs (including SWT) have methods for playing well with basic Swing or AWT components.  Since GLDrawables are derived from java.awt.Canvas, these APIs should work with JOGL anyways.

There are 10 kinds of people in the world.  Those that understand binary and those that don't.
Offline shaddam_IV

Junior Member




Java makes me happy the way C# doesn't!


« Reply #68 - Posted 2004-04-21 05:38:23 »

Quote
Get rid of lazy instantiation (or at least select a mode where it is immediate). Trying to do realtime graphics apps using offscreen buffers is impossible right now if you need to do one-off rendering to a buffer and synchronise it to the current frame.

I don't know the technical hurdles involved with this, but I totally agree.

Quote
*Pointer methods should take non-direct buffers

After having attended the excellent Java gaming technologies tutorial at GDC this year, I believe I understand the reasons for using direct buffers.  As I understand it, a native OS allocation is needed to protect the memory from getting munged by the GC.  This requires direct buffers, which allocate from system memory rather than VM memory.  Perhaps one of the gods of JOGL here can verify this summary.  This being the case, direct buffers are what we need.  Besides, direct buffers aren't hard to work with.

There are 10 kinds of people in the world.  Those that understand binary and those that don't.
Offline princec

JGO Kernel


Medals: 284
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #69 - Posted 2004-04-21 09:16:28 »

Non-direct buffer support is a waste of time.

Array support is probably a waste of time too, though it might look convenient.

I am still highly concerned about JOGL being touted as the "standard" J2SE GL binding, when so many voices are trying to pull it in so many directions and already people are worried about the glacial speed of development. Clarify all these issues in a clear project mission statement with discrete objectives and then set about presenting solutions to achieve those objectives.

Cas Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline TheBohemian

Junior Member




Java will rule them all!


« Reply #70 - Posted 2004-04-21 09:30:24 »

Quote
Posted by: Markus_Persson
2) Some way of making it work in an applet for someone who has installed a recent version of java without having to purchase a verisign certificate. Applets, suck, I know. But 3d on webpages = teh sexy.  


AFAIK you can do this with JNLP. It supports applet which you can self-sign and request the user has to accept them at least once.

Quote
shaddam_IV wrote:
IMHO, because the bindings are meant to be a part of the official Java platform, we should only have "official" support for the official Java platform APIs.  Namely, Swing and AWT.  If unofficial APIs, such as SWT, want to use the bindings they should conform to the official OpenGL bindings, not the other way around.


Don't say this aloud when cas reads that, a holy war far greater than the 'naming scheme djihad' breaks out ... Cheesy

Btw. cas has made suggestions already how this API independence could be achieved. As I have understood him it involves writing an SPI and let others implementing it. So its up the ones which really want SWT, lwjgl support to provide a SPI implementation.

In fact I think that the SPI approach is really a good one. I don't know about the implementors responsibilities but if it can bring JOGL to ANY JavaVM (like the SPI for javax.sound) then this should be the way to go.

(I am looking forward to see a JOGL implementation for my favorite OS. see signature Smiley )

-- EDIT: ah cas was faster than me.

cya

TheBohemian

---------------------------------------
my favorite OS: http://jnode.sf.net
Java 1.5 -> 1.4 converter: http://retroweaver.sf.net
Offline princec

JGO Kernel


Medals: 284
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #71 - Posted 2004-04-21 11:26:45 »

There now exists, in the CVS of the LWJGL, three new classes in org.lwjgl.util, which show how you can address all of the JOGL issues.

There's a GLI interface, which is an interface describing all the GL commands, including the ARB and EXT ones we support.

There's a GLImpl class, which is a class which implements GLI, and delegates all its calls to another utility class called GL, which is simply a static class which has all of LWJGL's GL methods in it from 1.1->1.5 and the EXT and ARB ones.

You might not necessarily agree with what commands are in GLI but the fact of the matter is it took 5 minutes with Eclipse and Textpad to make these classes and it shows everyone just how vacuous the whole GL naming argument actually is. Code to GLI and you can use both JOGL and LWJGL. Create a GLIWithNoGLs interface and you can rename all the methods to remove the gl prefix from the commands. Create a GLWithNoGLsAndCapsFirstLetter and rename all the methods to use no gl prefix and a caps first letter.

What's the cost? 5 minutes of your time.

The arguments about the GL bindings need to be about the consistent way in which the binding is interacted with, not about the naming of the commands.

By consistent interaction I mean:
- are arrays supported as parameters
- are non-direct buffers supported as parameters
- are buffer limits and positions respected
- are typesafe enums used or ints
- are doubles supported
- are methods which are pointlessly inefficient in Java supported
- which GL extensions are supported

If JOGL wants to become a standard I suggest it works on the principle of defining an interface like GLI and defining the answers to those questions.

Cas Smiley

Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #72 - Posted 2004-04-21 13:54:54 »

Quote

Although this sounds desirable, I wonder how feasible it is when it comes to implementation.


It has already been done in the field.  From what i've heard it is extremely simple.

Quote
If each API has its own version of a native rendering surface, I think it will be very impractical to develop methods for handling every single custom API rendering surface.


Yes, but that CAN'T be the case.  On each platform openGL works a certain way there is a native OpenGL context that the platforms openGL implementation must work with.  Since every OpenGL binding is ultimately forced to go through the platforms native OpenGL there is automatically a common data structure to represent the surface.  The abstractions that the individual implementations provide (AWT, Swing, SWT, LWJGL) can remain as it is.

Offline hdevaan

Senior Newbie




Java games kick @ss!


« Reply #73 - Posted 2004-04-21 14:38:43 »

Quote

If JOGL wants to become a standard I suggest it works on the principle of defining an interface like GLI and defining the answers to those questions.


This is pretty much what I meant by recognizing the difference between the public JSR 231 API (aka: the pure Java interface for the OpenGL world) and the implementation (how JOGL/LWJGL/wha'eva handles the API internally).

If the official API sticks to all the 'fancy' rules on Java design (which would include preventing C artefacts leaking into Java - that is not just a naming issue), then I couldn't care less about how an implementation deals with it internally (except I'd like it to be robust and fast, of course Tongue).

Quote

- are non-direct buffers supported as parameters


It seems people consider the garbage collector to be somewhat too hostile for this to be feasible. I guess having something like a 'programmable' garbage collector (ie: one that doesn't collect and delete at any moment it bloody well pleases) would have been nice. Perhaps that's just too close to C++?
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #74 - Posted 2004-04-21 16:17:32 »

Quote
By consistent interaction I mean:
- are arrays supported as parameters
- are non-direct buffers supported as parameters
- are buffer limits and positions respected
- are typesafe enums used or ints
- are doubles supported
- are methods which are pointlessly inefficient in Java supported
- which GL extensions are supported


Answers for JOGL, in order, are
- yes, where possible (i.e., where the OpenGL state machine doesn't require long-term "pinned" storage)
- no, all uses of buffers are direct buffers
- unclear what you mean; JOGL does not bounds-check buffers going out to OpenGL, as doing so would require semantic information about how much storage will be examined by the OpenGL state machine. Additionally, the base address of direct buffers is passed down to C, not base address + position. The user must slice their buffers to get interior pointers. I believe this is less confusing than other behavior, where put() operations may change results.
- ints, not typesafe enums
- yes, doubles are supported
- JOGL exposes all of the methods defined by the OpenGL standard
- all of the OpenGL extensions that were present the last time we updated JOGL's header files are supported, including ARB_vertex_buffer_object, ARB_vertex_program, and ARB_fragment_program. Full OpenGL 1.5 support is coming.

Quote
If JOGL wants to become a standard I suggest it works on the principle of defining an interface like GLI and defining the answers to those questions.


JOGL has always been designed around the use of interfaces to avoid tying the library and users' code to any particular implementation (and, in fact, to any particular window system). Its GL and GLDrawable interfaces have multiple implementations, and its GLEventListener interface is just that, an interface, not an abstract class, to give users flexibility in their interactions with the library.
Offline liminal

Senior Newbie




Java games rock!


« Reply #75 - Posted 2004-04-22 15:28:05 »

Method naming is obviously a sensitive topic for a lot of people. With the automatic generation of most of jogl from the C header files, I think it would be fairly easy to generate libraries with various naming conventions (gl.glVertex3f(...), gl.vertex3f(...), gl.vertex(...), etc.)

My request:

Please build a few different versions and actually TRY USING THEM before making this decision. Do a little usability testing with people of different skill levels (combinations of java and opengl experience) and see how they do. Try a few different popular development environments to see how modern autocomplete features affect productivity. In other words see what works.

Deciding this in the abstract is a surefire way to come up with a righteous position that just annoys people.

(my suspicion: no one will miss the extra 'gl' prefix on method names once they've tried it, but I'll let the tests decide)

(edited for spelling)
Offline MichaelLatta

Innocent Bystander




Java games rock!


« Reply #76 - Posted 2004-04-22 20:55:45 »

Our top prioirity is that JOGL be finalized by the end of the year.  We need a binding that is going to be stable for a release Q105.  Second is being able to access all ARB extensions without a need to revise the spec.  For example, the spec should state how the mapping is performed, rather than enumeratiing the current mapping.  We are assuming that it supports both Windows and Mac so that is a given, but prebuilt binaries for both would be a high priority.
Offline Raghar

Junior Member




Ue ni taete 'ru hitomi ni kono mi wa dou utsuru


« Reply #77 - Posted 2004-06-15 22:27:13 »

In my experience most easy is type:
gl.vertex(1.0, 2.0, 3.1);
second easiest is:
gl.vertex3f(1f, 2f. 3.3f);

Ihave moded JOGL a little and used it over two weeks, so...
Offline atze

Senior Newbie




It's just me.


« Reply #78 - Posted 2004-07-05 17:49:21 »

please add this to the GL class:

     final static int GL_TEXTURE_STORAGE_HINT_APPLE = 0x85BC;
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #79 - Posted 2004-07-19 22:36:00 »

Could you provide a pointer to a header file that contains this extension? Or if it's in the extension registry, what's the extension number?
Offline atze

Senior Newbie




It's just me.


« Reply #80 - Posted 2004-07-21 09:30:54 »

it's in glext.h among the GL_APPLE_texture_range extension.

#if GL_APPLE_texture_range
#define GL_TEXTURE_RANGE_LENGTH_APPLE      0x85B7
#define GL_TEXTURE_RANGE_POINTER_APPLE     0x85B8
#define GL_TEXTURE_STORAGE_HINT_APPLE      0x85BC
#define GL_TEXTURE_MINIMIZE_STORAGE_APPLE  0x85B6
#endif
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #81 - Posted 2004-07-21 17:18:41 »

This extension was never registered with the OpenGL Extension Registry at http://oss.sgi.com/projects/ogl-sample/registry/ so it isn't in any header files except Apple's. I don't mind adding it to JOGL's glext.h, but could you please file an Issue and attach the relevant portions of the header file? Thanks.
Pages: 1 2 [3]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (56 views)
2014-04-15 22:08:23

BurntPizza (54 views)
2014-04-15 07:46:01

UprightPath (67 views)
2014-04-14 21:39:50

UprightPath (50 views)
2014-04-14 21:35:47

Porlus (67 views)
2014-04-14 19:48:38

tom_mai78101 (91 views)
2014-04-10 08:04:31

BurntPizza (152 views)
2014-04-09 03:06:04

tom_mai78101 (248 views)
2014-04-05 17:34:39

trollwarrior1 (205 views)
2014-04-04 16:06:45

CJLetsGame (212 views)
2014-04-01 06:16:10
List of Learning Resources
by SHC
2014-04-18 07:17:39

List of Learning Resources
by Longarmx
2014-04-08 07:14:44

Good Examples
by matheus23
2014-04-05 17:51:37

Good Examples
by Grunnt
2014-04-03 19:48:46

Good Examples
by Grunnt
2014-04-03 19:48:37

Good Examples
by matheus23
2014-04-01 22:40:51

Good Examples
by matheus23
2014-04-01 22:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 19:22:30
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
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!