Is their a faster Win32 function?
Is their a faster Win32 function?
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
Well, I've learned that DirectX is a 55 meg download and a 15 meg resident which - as MS so nonchalantly mentions: "CANNOT BE UNINSTALLED". C'mon guys, I wanted a lib to link to, not another friggin marriage of OS and software (ie: the IE 'Active Desktop'- also uninstallable!)
What I REALLY want is an ASM routine which does the same vid mem to vid mem transfers at those speed (or better ). Well I'll search around a bit till I break down
[edit] ...hmm..just food for thought, apparently someone has figured out how to uninstall it! --> X
...no, this doesn't mean I want it, either![/edit]
Last edited by Sebastiani; 07-29-2002 at 01:32 AM.
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
A seperate Graphics lib like DX will provide a far better method of painting the screen than GDI...but if you want to stick with GDI, then there are still things you can do to improve speed...BitBlt is probably the fasteset of all those Blt funcs...I'm no graphics guru but there are loads of little possibilities to get a better draw....
Post a quick example of what you have done so far, and lets see if we can change a few things to jump the speed a little....
BTW....there's no quick and easy way to access vid memory.......There are hacks (which would be buggy and probably platform dependant), but I wouldnt bother!....
ie:
Blit the eraser to the screen.
Move the object's coordinates in a specified direction.
Blit the screen to the eraser DC.
Blit the object to screen DC via SRCAND.
Invalidate the object's rectanglular region.
Every operation has been optimized by Blitting/Invalidating the objects rectangle solely, with exception to the moving op whereby a small portion of the previous area must be invalidated to reflect the new change. In the past, this worked fine for slower motions, but at 10 ops/sec or more the flicker becomes intolerable. Incidentally, I don't completely blame BitBlt(). I have a feeling InvalidateRect() may be the true culprit, but I ain't exactly sure.
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
I'm going to say, judging by the post on the other board, that you aren't double buffering. Here is a demo that I used back in the day that helped me learn how to do this. If this doesn't solve your problems you are going to have to go with directx. You could also go opengl, I think that is only a 10meg d/l.
Oh yeah, one other thing. If you are using InvalidateRect() you should pass FALSE in for the third parameter. This way you don't delete the square then draw, you just draw over what is already there.
Are you using GetUpdateRect() in your paint function to minimise the area drawn? (before the call to BeginPaint() validates the region)
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best
"If you are going through hell....keep going."
Winston Churchill
No!
But I will very shortly
I'll let you know how it turns out...thx for the tip man.
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }