LWJGL Forum

Programming => OpenGL => Topic started by: JoshuaD on May 02, 2006, 18:44:21

Title: From an SWT Image to OpenGL?
Post by: JoshuaD 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?
Title: hmmmmmmm...
Post by: Fool Running 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 (http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=06) for an example of putting a texture on a polygon.

Edit: If you are new to OpenGL then the NeHe tutorials (http://nehe.gamedev.net) are a good place to start. Just look for the LWJGL versions at the bottom. :D
Title: From an SWT Image to OpenGL?
Post by: JoshuaD on May 08, 2006, 15:17:48
Is there an easy work around for non-power of 2 textures?
Title: From an SWT Image to OpenGL?
Post by: Evil-Devil 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.