Hello Guest

LWJGL in a JFrame

  • 5 Replies
  • 9542 Views
*

Offline CaseyB

  • ***
  • 118
LWJGL in a JFrame
« 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?

*

Offline Matzon

  • *****
  • 2242
LWJGL in a JFrame
« Reply #1 on: July 18, 2005, 15:26:12 »
do take a look at the org.lwjgl.test.opengl.awt examples

*

Offline CaseyB

  • ***
  • 118
Thank You!
« Reply #2 on: July 18, 2005, 17:02:31 »
I didn't know those examples were there, They are very helpful!  Thank you! :D

*

Offline CaseyB

  • ***
  • 118
Another Question
« Reply #3 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.

LWJGL in a JFrame
« Reply #4 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).

*

Offline CaseyB

  • ***
  • 118
Thanks!
« Reply #5 on: July 21, 2005, 16:39:31 »
I thought it would be something like that!  Thank you for such a quick reply!

CaseyB