Newbie nees help on textured quads

I can’t seem to get started with textured quads. Have read about texturing and it seems there is so much infomation about it that I can’t seem to get my foot in the door for a simple example. I’m not interested in 3d … everything in my project is 2d at the moment.

I have been using gldrawpixels to draw many small rectangle png images on the screen (I’m writing an analysis tool so the position of the rectangles is ultra critical) but the tool seems slow and jerky when the user keeps their finger on a key and the screen is rapidly making calls to display() which make several thousand calls to gldrawpixels(). So, I’d like to try textured quads instead.

Also is it possible to have 2 or more images side by side (or on top of each other) on one texture? I believe this would be useful for me, if it could be done (I’d like to have an array of textures, all with different combinations of my original images - and then use a look up table to speed up the drawing process - I’m sure this would help my speed issue).

Any examples, tips or useful links would be much appreciated as I’m struggling at the moment. :’(

Regards,

Sally

Hi, first of all you can reduce the number of redraws (even if the user try to crush the key…)
And maybe PBuffer are a good solution to mix different images in a single texture.

Hope it helps a bit…

Thanks for your reply.

Reducing the number of redraws isn’t an option in my case. All the redraws are essential, as the user’s eyes will be looking for specific patterns as he/she holds the key down and watches the screen change. The whole thing does work by drawing small rectangles all over the canvas but I’d love to improve the speed considerably. I have read the chapter on texture in the red opengl programmer’s guide but I’d like to find some simple 2d examples (for jogl) but can’t find them on the web.

Also, could anybody give me an idea of 1. how much faster textured quads are over gldrawpixels? and 2. Why are they faster?

Rgds,

Sally

[quote]Thanks for your reply.

Reducing the number of redraws isn’t an option in my case. All the redraws are essential, as the user’s eyes will be looking for specific patterns as he/she holds the key down and watches the screen change.
[/quote]
Even in such a situation i think you can limit your updates to 25 per second… Or you are trying to challenge them…

For the 2D texturing, for me it’s really like 3D texturing.

If I remember well there is a thread named “Another pBuffer Thread” that gives an example which may be useful for you.

I’m not very affirmative but i hope it will help you.

25 per second? Oooh that would be fantastic. :stuck_out_tongue: At the moment I’m only getting about 11 (and it’s jerky). But I’m sure I’m going to improve upon this once I get into using textured quads. I shall check out that thread. Thanks.

Regards,

Sally

When I run that pbuffer example I get the following:

Initialized GUI
INIT GL IS: net.java.games.jogl.impl.x11.X11GLImpl
PBUFFER NOT SUPPORTED

(followed by a lot of exception messages)

Does this mean I can’t write to off-screen memory? ???

I’m far from an expert in pBuffers but it seens that your video card doesn’t support pBuffers…

You can still use textures read from images, but you’ll have to make your combinaisons yourself…