Refresh Rate






Hello,

My application is required to draw to an X-window at a rate of at least 25
times per second.
I don't need any windows or widgets - I'm just using draw_gray_image() to
draw some grayscale bitmaps.
Unfortunately, I have tested a gtkmm program and it seems to take 40ms to
refresh the screen without me doing any extra work on top.
If I do some work in my program it becomes 130ms.

I tried to connect the refresh signal at 1ms but that isn't achievable.
m_RefreshPeriod = 1 ...

    Glib::signal_timeout().connect(sigc::mem_fun(*this,

&MyImageDisplay::refreshTimeoutCallback),
                                                 m_RefreshPeriod,
Glib::PRIORITY_HIGH);



bool MyImageDisplay::refreshTimeoutCallback()
{
RESET_GLOBAL_TIMER;
START_GLOBAL_TIMER;
//    GetImageArray(m_Image);                   // Transfer image matrix to
image array

    Glib::RefPtr<Gdk::Window> window = get_window();
    window->draw_gray_image(m_refGC, 0, 0, m_XRes, m_YRes,
                            Gdk::RGB_DITHER_NORMAL, (guchar*)m_Image,
m_XRes);
STOP_GLOBAL_TIMER;
DOUT("time taken :" << GET_GLOBAL_TIME_ELAPSED << std::endl);

    // never disconnect callback
    return true;
}



m_Image is declared as char m_Image[1000000] to cope with the expected
screen resolution (eg: 1024x768).

Have I picked the wrong library to use?  I realise gtkmm is probably
targeted at applications like Window Managers/GUIs.  Should I drop gtkmm
and use Xlib instead?

Thanks,

Duncan


*******************Internet Email Confidentiality Footer*******************
The contents of this e-mail message (including any attachments hereto) are
confidential to and are intended to be conveyed for the use of the
recipient to whom it is addressed only. If you receive this transmission in
error, please notify the sender of this immediately and delete the message
from your system. Any distribution, reproduction or use of this message by
someone other than recipient is not authorized and may be unlawful.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]