> On Tuesday 20 February 2001 05:42, Joe & Bobbey Huwaldt wrote:
>> Sven,
>>
>> Is there a method by which I can draw on top of a GLCanvas using the
>> regular AWT methods? For example, I would like to render a 3D scene using
>> GL4Java, then draw some items on top of part of that scene using a regular
>> AWT graphics context. My first thought was that I would override paint(),
>> but I see that you have prevented that. Did you provide any other way to
>> do the same thing? Is it even possible (I haven't looked at the source
>> code, so I don't know how the implementation works)?
>>
>
> well .. you can try Graphics g = this.getGraphics() !
> And awt-render _after_ swapping the buffer,
> if you use double-buffering.
>
> This will not work in the current GL4Java up to 2.5.0-test2
> if an new native window is created (see the native debug out info's) !
>
> In the upcoming 2.5.0-test3 this should work, if you use the new factory api,
> because the java window itself will have all the capabilities needed
> while using the JDK 1.3 class GraphicsConfiguration internaly
> (-> no more new native window will be created) !
Well, what you have suggested here works for my particular problem, but I
have not tested it everywhere yet. I only have one OpenGL window open at a
time and I am able to draw onto it without any problems using Java 1.2.2 on
Windows 98 and Java 1.1 on MacOS 9.
Here is what I was trying to do:
http://www.babst.org/~jhuwaldt/3DStuff/VSphere/VSphere.html
It's an implementation of the virtual sphere algorithm for intuitive 3D
rotation using a 2D input device (mouse). I could have rendered the virtual
sphere feedback using OpenGL, but it was so much easier to do it using the
AWT.
IMHO, my theory is you should try to minimize the usage of OpenGL in your
Java programs since it is not very object oriented, isn't 100% portable, is
more difficult to support, and I find it generally messy.
> well, this is true, e.g. for an overlayed textual info ..
Especially for 2D text! Using OpenGL for text is just plain painful.
> may be you have to wait for the new version ...
I'm a patient man. As long as your doing the work, I'm content to wait. ;-)
Ad astra,
Joe Huwaldt
|