From an SWT Image to OpenGL?

Started by JoshuaD, May 02, 2006, 18:44:21

Previous topic - Next topic

JoshuaD

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?

Fool Running

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

JoshuaD

Is there an easy work around for non-power of 2 textures?

Evil-Devil

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.