int height, width;
if(aRect==NULL){
SurfaceToBlit->Lock(NULL, &SurfaceDesc,0,0);
height = (int)SurfaceDesc.dwHeight;
width = (int)SurfaceDesc.dwWidth;
aRect = new RECT;
SetRect(aRect,0,0,height ,width );
}
The problem is that: width = -885.... something.
And I know that''s the problem because:
SetRect(aRect,0,0,640,480); works fine.
What could it be?
/MindWipe
"If it doesn''t fit, force it; if it breaks, it needed replacement anyway."
(int)SurfaceDesc.dwHeight = -885........... HUH??
"To some its a six-pack, to me it's a support group."
The fact that you''re casting it implies that it was something else before... an unsigned int? In which case, casting a large unsigned int to an int might cause a problem. Seems unlikely in this case, but there you go.
Maybe you should be checking the return value of Lock(), too. If Lock() failed, then any kind of garbage could be in SurfaceDesc.
Oh... and I hope you are deleting that ''new Rect'' that you allocate?
Maybe you should be checking the return value of Lock(), too. If Lock() failed, then any kind of garbage could be in SurfaceDesc.
Oh... and I hope you are deleting that ''new Rect'' that you allocate?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement