35 milliseconds. 35 seconds would definitely make the updates "jump" (unless the user got bored and looked away before the screen got updated).
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
Anything less than 500 doesn't look good. In fact since i'm displaying a lot of text with different font levels, after a little while with the flickering suddenly the font changes all text to bold, and removes any italics existing on text.. Some stages aligns text incorrectly!
I suspect you are entering your WM_PAINT twice within a single draw.
So if less than 500 is not good, then you probably better stick with the jerky 1000 - not much difference if it's jerky twice as often.
Another thought would of course be to not update as much of the screen each time - perhaps you can draw just parts of it?
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
This is my messages switch statement
Code:switch (uMsg) { case WM_CREATE: { /* Create timer to refresh screen */ SetTimer(hwnd, IDT_REFRESH, REFRESHTIME,(TIMERPROC) NULL); /* Create edit controls */ EditBoxes(hwnd, cs); /* Create radio buttons */ RadioButtons(hwnd, cs); } return 0; case WM_PAINT: { hdc=BeginPaint(hwnd, &pntS); /* *** User Interface *** */ DrawArea(hwnd, hdc, colors); RadioButtonsText(hwnd, hdc, polarLbl, stdFont); TargetText(hwnd, targetLbl, sqm, mtrs, hdc, stdFont); GenParams(hwnd, genPara, fareRng, dpRng, hdc, stdFont); RadaAntennaText(hwnd, rdrAntenaLbl, deg, db, halfMin, mtrs, hdc, stdFont); DisplayResultsBox(hwnd, hdc, rdrTrans_recv, targetLbl, rsltFont); RadarReceiverText(hwnd, rdrTrans_recv, hz, mhz, mtrs, kw, usec, db, wvlnthFig, hdc, stdFont); // Calculate & show results output = ProcessData(hwnd); DisplayResults(hwnd, hdc, &output, rsltFont); EndPaint(hwnd, &pntS); } return 0; case WM_COMMAND: { // Listen to the input commands switch( LOWORD(wParam) ) { case ID_FILE_EXIT: { PostMessage(hwnd, WM_CLOSE, 0, 0); break; } case ID_EDIT_CLEAR01: { ClearEditControls(hwnd, indata); break; } case ID_FILE_OPEN01: { // Load data from file to edit controls DoFileOpen(hwnd); SetValues(hwnd, &indata); break; } case ID_FILE_SAVEAS: { // Save data on edit controls to file DoFileSaveAs(hwnd); break; } case ID_FILE_SAVE01: { // Save data on edit controls to file WriteToFile(hwnd, "RFSDataFile.dat"); break; } } } return 0; case WM_GETDLGCODE: { break; } case WM_TIMER: { // Refresh screen InvalidateRect (hwnd, NULL, TRUE); UpdateWindow(hwnd); } break; case WM_DESTROY: KillTimer(hwnd, IDT_REFRESH); PostQuitMessage(0); return 0; default: //let system deal with msg return DefWindowProc(hwnd,uMsg,wParam,lParam); }
That's not much help - I'm just asking if you need to redraw everything. I can't say from that what actually happens in your functions that do the actual drawing.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
Actually i need to redraw a portion of the window. I have five rectangles (4 have edit boxes, 1 has results table) in one window. Really i only need to update the results (the Fifth rectangle) every time thew user changes the values on the other 4 rectangles... Any suggestions on how to do this?