How do i use clippers in direct draw i cannot find a tutorial on it ne wer, ne1 know how to use or know tutorials?
Thnx
Printable View
How do i use clippers in direct draw i cannot find a tutorial on it ne wer, ne1 know how to use or know tutorials?
Thnx
Clippers does actually not do anything else then changing the source rect. You can easily do that your self. And clippers dosn't work as they should in Windowed mode anyway.
So if i change the source in blt that will work, can u giv me an example Plz
thnx
Never done any 2D in DX with C++ sorry....but if you have the code to Blt it to the screen, I can see if I can do something with it...
Give me a sec I'll have a look, I should have an example.....
BTW if you are using scaling then it makes things easier when using a clipper ;).
Here you go, ScreenX is the XResolution and ScreenY is the YResolution.
This will trim off the src and dest RECTs so that they fit on the backbuffer and therefore the normal blt call will not fail ;).
BTW you do know the games section on this site is also for C++, not just VB (even though its in the VB section :rolleyes: )Code:// Top
if (dest.Top < 0)
{
src.Top = -dest.Top;
dest.Top = 0;
}
// Left
if (dest.Left < 0)
{
src.Left = -dest.Left;
dest.Left = 0;
}
// Right
if (dest.Right > ScreenX)
{
src.Right = src.Right - (dest.Right - ScreenX);
dest.Right = ScreenX;
}
// Bottom
if (dest.Bottom > ScreenY)
{
src.Bottom = src.Bottom - (dest.Bottom - ScreenY);
dest.Bottom = ScreenY;
}
:D
He probably ment:
Code://Top
If (dest.Top < 0){
src.Top = -dest.Top;
dest.Top = 0;
}
//Left
If (dest.Left < 0){
src.Left = -dest.Left;
dest.Left = 0;
}
//Right
If (dest.Right > ScreenX){
src.Right = src.Right - (dest.Right - ScreenX);
dest.Right = ScreenX;
}
//Bottom
If (dest.Bottom > ScreenY){
src.Bottom = src.Bottom - (dest.Bottom - ScreenY);
dest.Bottom = ScreenY;
}
I was lost for a minute there :rolleyes:.Quote:
Posted by NoteMe
He probably ment:
Code:....
BTW Note you are using VB comments in your code ;).
Quote:
Originally posted by Electroman
I was lost for a minute there :rolleyes:.
BTW Note you are using VB comments in your code ;).
At least I remembered all the ;;;;;;;s...;)
:ehh: Its an easy mistake :blush:
Thnx alot its workin fine now. :thumb: