-
November 4th, 2013, 05:48 AM
#1
Multiple drawing solution
Hi all. I want to ask you something: to share your experience and share me a solution to next issue: I had an SDI app, with CView based on CScrollView, where I render a bitmap, simple bitmap. Also, I had an CDialog, where I want to render the same bitmap like on CView, but on the second monitor (in fact it is a multimonitor arhitecture). But is really necesary that the drawing from CView an CDialog is being performed syncron, I mean in the same time.
For this, I want to implement an UIThread solution for CDialog, take it from here:
http://www.codeguru.com/cpp/misc/mis...onstration.htm
does not function properly, and some programmers suggerate to avoid UIThreads ...
Now, the issue remain: what solution whould use to render the same bitmap, on the two views, in the same time ? (On CView and CDialog on second monitor).
Kindly thank you.
-
November 4th, 2013, 07:26 AM
#2
Re: Multiple drawing solution
Originally Posted by mesajflaviu
But is really necesary that the drawing from CView an CDialog is being performed syncron, I mean in the same time.
Strictly speaking, I don't think that is possible. But the more important question is: why?
What's wrong with just bit-blitting the bitmap in the WM_PAINT handler?
Cheers, D Drmmr
Please put [code][/code] tags around your code to preserve indentation and make it more readable.
As long as man ascribes to himself what is merely a posibility, he will not work for the attainment of it. - P. D. Ouspensky
-
November 4th, 2013, 07:49 AM
#3
Re: Multiple drawing solution
The sistem is a blackbox monitor, which can compose an 3D image from 2 monitors and a mirror, so, if the rendering of CView::OnDraw methos is taking too long, and CDialog::OnPaint comes next, the user see the delay on compounded 3D image, and looks ugly ...
-
November 4th, 2013, 09:20 AM
#4
Re: Multiple drawing solution
Originally Posted by mesajflaviu
The sistem is a blackbox monitor, which can compose an 3D image from 2 monitors and a mirror, so, if the rendering of CView::OnDraw methos is taking too long, and CDialog::OnPaint comes next, the user see the delay on compounded 3D image, and looks ugly ...
I don't know of any method faster than BitBlt when you draw onto a window DC. If that's not fast enough, maybe you can try using DirectX or OpenGL to draw the image.
Did you measure (or observe) that the drawing is too slow? If so, can you post your painting code (with timings)?
Cheers, D Drmmr
Please put [code][/code] tags around your code to preserve indentation and make it more readable.
As long as man ascribes to himself what is merely a posibility, he will not work for the attainment of it. - P. D. Ouspensky
-
November 5th, 2013, 02:33 AM
#5
Re: Multiple drawing solution
I drawing with classic double-buffering code, nothing special, and timming is pretty good, on 1440X900 monitor, I had measure arround 14 - 16 ms ... but I would like to draw syncron on two of monitor though ...
-
November 5th, 2013, 07:52 AM
#6
Re: Multiple drawing solution
Only way you can do that reliably enough is going DirectX full screen and get a canvas for the 2 monitors.
Prepare both image parts assuming the same frame count.
Nomatter what you do, doing things via the desktop will incur a number of delays and other annoyances that will cause desynchronisation (GDI blits/conversions, the desktop manager, desktop composer, WM_PAINT's being inherently asynchronous, messaging delays if there are lots of hooks, background apps taking CPU time, ...).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|