Step-by-step displaying

Mmmm, As I said - Preloading image is NOT good for user, and for me too, for example I MUST wait, while my program is loading 1600x1200 image (or bigger ?), and I can’t interrupt it.
No, this is not what I said. But wait… is that your problem? Look, what I said is that you can a) load and display your image incrementally using the default Qt/X way to do. This should be fast and incremental. Then when the user wants to manipulate it in real time switch to GL and when the user is done switch back to Qt. But if incremental displaying is not important, just incremental loading then you can do the following:

for(i = 0 ; i < width * height * depth ; i ++) {
    read_next_byte_into_buffer(file, buffer);
    check_for_user_interaction();
}

/* so now we have the image in a buffer in memory */
load_buffer_into_texture(buffer, texture);
 

As I said, what really hurts you is the fact that you call gl(Sub)TexImage() so many times. If you do it this way, you’ll call it just once (inside load_buffer_into_texture()) which will hopefully be fast enough. You won’t get incremental displaying though.

some time ago I wrote code like that, but I want To display whilr decoding, like any good viewer (ACDSee, GQview, etc.). But it seemed that is no solvation for my problem :frowning:

Maybe you can adjust the rasterizing position with RasterPos at each update and call Drawpixels. This will avoid the (sub)texture upload,polygon rasterizing and a number of fragment tests.

If you want to see incrimental updates you will have to use a single buffered display or a double buffered display with drawbuffer set to GL_FRONT and a flush or finish after drawing.

After the image is completely decoded, store it in a texture using CopyTexImage to use it for further processing.

N.

But it seemed that is no solvation for my problem

Look, the problem is that you consider loading/displaying and manipulating the image as beeing one and the same thing or at least very closely related. They are two different problems though (in fact one could argue whether they belong in the same application). Just use Qt for the first and the GL for the second (see previous posts for details) and you’ll be fine.

Originally posted by -NiCo-:
If you want to see incrimental updates you will have to use a single buffered display or a double buffered display with drawbuffer set to GL_FRONT and a flush or finish after drawing.

Hm, how can I update viewport after DrawPixels ?

Many thanks! It works ! Soon you can test it at http://ksquirrel.sf.net :slight_smile: )

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.