LWJGL Forum

Programming => OpenGL => Topic started by: CaseyB on July 18, 2005, 13:20:52

Title: LWJGL in a JFrame
Post by: CaseyB on July 18, 2005, 13:20:52
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?
Title: LWJGL in a JFrame
Post by: Matzon on July 18, 2005, 15:26:12
do take a look at the org.lwjgl.test.opengl.awt examples
Title: Thank You!
Post by: CaseyB on July 18, 2005, 17:02:31
I didn't know those examples were there, They are very helpful!  Thank you! :D
Title: Another Question
Post by: CaseyB on July 21, 2005, 16:31:00
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.
Title: LWJGL in a JFrame
Post by: Orangy Tang on July 21, 2005, 16:34:30
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).
Title: Thanks!
Post by: CaseyB on July 21, 2005, 16:39:31
I thought it would be something like that!  Thank you for such a quick reply!

CaseyB