nanogui: Thread: What am I doing wrong? Images not displayed....


[<<] [<] Page 1 of 1 [>] [>>]
Subject: What am I doing wrong? Images not displayed....
From: Yan Seiner ####@####.####
Date: 7 Dec 2005 14:53:49 +0000
Message-Id: <4396F764.7000707@seiner.com>

I've go the following piece of code:

        window_id = GrNewWindowEx(GR_WM_PROPS_APPWINDOW, title,
                GR_ROOT_WINDOW_ID, 0, 0, w, h, GREEN);

        GrSelectEvents(window_id,
                GR_EVENT_MASK_CLOSE_REQ|GR_EVENT_MASK_EXPOSURE);

        GrMapWindow(window_id);

        gc_id = GrNewGC();
        GrDrawImageToFit(window_id, gc_id, sx,sy, w,h, image_id);
        sleep(SLEEPTIME);
        GrDestroyWindow(window_id);
        GrDestroyGC(gc_id);
        GrFreeImage(image_id);
        GrClose();
        exit(0);

What is supposed to happen is that the image is displayed for SLEEPTIME, 
then the viewer exits.

What is happening is that the viewer sleeps for SLEEPTIME on the green 
screen, then updates the screen displaying the picture, and then exits....

I must be missing some sort of magical update screen function, but I 
can't find it...
Subject: Re: [nanogui] What am I doing wrong? Images not displayed....
From: Alex Holden ####@####.####
Date: 7 Dec 2005 15:37:16 +0000
Message-Id: <BEE72FFC-2549-46C3-BA3B-4F8E85E01527@linuxhacker.org>

On 7 Dec 2005, at 14:53, Yan Seiner wrote:
>        GrDrawImageToFit(window_id, gc_id, sx,sy, w,h, image_id);
>        sleep(SLEEPTIME);
>        GrDestroyWindow(window_id);
> What is happening is that the viewer sleeps for SLEEPTIME on the  
> green screen, then updates the screen displaying the picture, and  
> then exits....

Do a GrFlush() to force the client to flush its command queue to the  
server before you sleep().

-- 
------------ Alex Holden - http://www.alexholden.net/ ------------
If it doesn't work, you're not hitting it with a big enough hammer



[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.