I have started programming for Symbian and 7650 a couple of days ago and now I have some questions concerning methods to create fast realtime graphics on 7650.
1) Is there any way to access screen buffer directly? Graphics example (the one provided with series60 SDK) draws everything to offscreen bitmap and then uses bitblt function to copy it to system graphics context. Is this the fastest way to get double buffered fullscreen graphics?
2) How fast is the screen of Nokia 7650? What is the maximum screen update frequency?
3) The graphics example uses CPeriodic class with period of 1 microsecond to update screen frequently. Is this a good way to do fast screen updating or should I create a whole new thread to update screen? In fact I already tried that and got some serious troubles with threads on Symbian. I just couldn't get it working.
4) Let's say I wanted to create a new thread to update the screen repeatedly. I have similar classes to graphics example in my application now: App, Doc, UI and View classes. Now I would like to change it not to use CPeriodic callback to update a screen but to launch a new thread to do that. The thread function would have endless while loop that would draw stuff to backbuffer bitmap and then blit it to system graphics context. Could someone tell me how to create a thread to do that and how to update the screen from thread function? I tried to do that but I couldn't get it done without errors. I created a new thread and passed the address of my view object to thread function as a parameter. Then I tried to update the screen repeatedly but the screen was updated only once and then I got KERN-EXEC 0 and WSERV 10. What's the problem?
5) Is there any function to pause current thread for specified time (like Thread.sleep() in Java)? How about a function that makes thread to give cpu time to other threads (like Thread.yield() in Java)?
6) Does anyone know any better and more advanced graphics tutorials or examples for 7650 than the one provided with the series60 SDK?
The EMame pointer is a good reference. A couple of other comments:
"1) Is there any way to access screen buffer directly?"
See also "What's the fastest way to draw to the screen? Can you by-pass WSERV?" in the Symbian knowledge base (http://www3.symbian.com/faq.nsf/0cdd168e685c71b1802569fc0051e782/0533ce246efcaf4580256a570051b8d0?OpenDocument ). On the 7650 you'll probably need to call CFbsScreenDevice::Update() or something similar to force the framebuffer changes on screen.
Using CWsBitmap bitmaps and blitting them on screen is pretty fast too, but you'll need to make sure that the bitmap format matches the screen format (EColor4K for the 7650).
"3) The graphics example uses CPeriodic class with period of 1 microsecond to update screen frequently. Is this a good way to do fast screen updating or should I create a whole new thread to update screen?"
The problem with using a separate thread is that the Window Server sessions are thread-specific, and you cannot access the default WSERV session (and related windows) from a new thread. If you draw directly to the frame buffer this probably won't be a problem. In general I recommend avoiding multiple threads.
"5) Is there any function to pause current thread for specified time (like Thread.sleep() in Java)?"
User::After(). It sleeps for a while and yields execution to other threads.