LWJGL in a JFrame

Started by CaseyB, July 18, 2005, 13:20:52

Previous topic - Next topic

CaseyB

I am trying to put an OpenGL "panel" in a JFrame so that I can have other Swing controls around it, but I am running into trouble.  I have a class that extends JPanel and implements the OpenGL stuff, but it throws weird errors when I try to run it this way.  Any suggestions?

Matzon

do take a look at the org.lwjgl.test.opengl.awt examples

CaseyB

I didn't know those examples were there, They are very helpful!  Thank you! :D

CaseyB

This has more to do with OpenGL than LWJGL, but here it goes.  Now that I can add an OpenGL pane to my application is there anyway to have OpenGL render the background as transparent so you can still see the window under what I am drawing?  :roll:  I know that it's very unlikely, but I thought I'd ask.  glClearColor has takes an alpha value, that's what made me think of it, but I just can't seem to get it to work.  I can alpha blend the stuff I draw, but I can't get any transparency in the background.

Orangy Tang

You can't do that I'm afraid, as heavyweight components don't allow transparent regions. The alpha param in glClear applies to the alpha bits in the framebuffer (which are never visible, and only usually used in blending operations).

CaseyB

I thought it would be something like that!  Thank you for such a quick reply!

CaseyB