Hello Guest

From an SWT Image to OpenGL?

  • 3 Replies
  • 6565 Views
From an SWT Image to OpenGL?
« on: May 02, 2006, 18:44:21 »
I'm trying to draw an SWT Image in openGL.  I don't care how it gets to screen, I just want to draw a single "backround" image to screen for a 2d game.

The image is semi-static, it will get changed every 5 seconds or so.

I've been searching around google, but I can't find anything that works.  Anyone know how to do this?

hmmmmmmm...
« Reply #1 on: May 03, 2006, 02:14:35 »
The best way is to create a texture for the background and make a polygon the size of the entire screen.
See NeHe's tutorial #6 for an example of putting a texture on a polygon.

Edit: If you are new to OpenGL then the NeHe tutorials are a good place to start. Just look for the LWJGL versions at the bottom. :D
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

From an SWT Image to OpenGL?
« Reply #2 on: May 08, 2006, 15:17:48 »
Is there an easy work around for non-power of 2 textures?

From an SWT Image to OpenGL?
« Reply #3 on: May 08, 2006, 17:42:18 »
Depending on the native texture format you can easily read its content and draw it on a bufferedimage with power of 2 size. and use the bufferedimage as your new texture.

Or manipulate them in any graphic programm.