Anti-aliasing of windowed graphics (DirectDraw)
wondered is someone could help me with this. I have followed the 2d direct draw tutorial (http://www.gamedev.net/reference/articles/article608.asp) and have my game running windowed now, but it appears to be anti-aliased all the time.
I am loading a 256 colour bitmap, but displaying onto a 32-bit display, dont know if this would cause windows to anti-alias.
NOTE: My gfx card is set to 'application specific' for anti-aliasing.
It looks kinda cool, but I would like to have control over it :)
appreciate any help anyone can give.
Any chance of a screenshot? Are you displaying the image at the same size it's loaded at, I.e. no resizing? Is your backbuffer the same size as your client area size (Not window size, which is what you pass into CreateWindow)?
sorry for the delay in responding to this.
Screenshot: -
http://www.slyproductions.net/images/scf_aa.bmp
Thanks for your help, read your post again and it clicked: I have realised what mistake I made, I didnt take into account the extra 25 pixels height, and 6 width when creating the window.
Cheers
Ryan
Screenshot: -
http://www.slyproductions.net/images/scf_aa.bmp
Thanks for your help, read your post again and it clicked: I have realised what mistake I made, I didnt take into account the extra 25 pixels height, and 6 width when creating the window.
Cheers
Ryan
Erm, I'm already seeing visions of code that has hardcoded stuff like "height -= 25". Please tell me you didn't do that? It would break really bad in systems that use different themes or are running at higher dpi.
You should use the client area like Evil Steve mentioned - GetClientRect will get you the size of the client area. If all else fails you can use GetSystemMetrics to get the width and heights of the various pieces of a window (borders, menu, title bar, etc).
You should use the client area like Evil Steve mentioned - GetClientRect will get you the size of the client area. If all else fails you can use GetSystemMetrics to get the width and heights of the various pieces of a window (borders, menu, title bar, etc).
Hi Mike,
thanks for the reply. I am a little confused, as this feels a bit chicken & egg. Does GetClientRect get the rect of a window which you have already created?
I did indeed adjust the code similar to what you mentioned, adding +=25 if its running windowed. You are correct that this would fall over with different themes though.
Here is my window creation routinue:-
CreateWindowEx(NULL,
WINDOW_CLASS_NAME, // class
"Ryan Lloyd's SCF", // title
WS_CAPTION | WS_BORDER | WS_POPUP | WS_VISIBLE,
100,5, // initial x,y
winwidth, winheight, // initial width, height
NULL, // handle to parent
NULL, // handle to menu
hinstance,// instance of this application
NULL))) // extra creation parms
appreciate any help you can give with regards to setting the width/height correctly.
Cheers
Ryan
thanks for the reply. I am a little confused, as this feels a bit chicken & egg. Does GetClientRect get the rect of a window which you have already created?
I did indeed adjust the code similar to what you mentioned, adding +=25 if its running windowed. You are correct that this would fall over with different themes though.
Here is my window creation routinue:-
CreateWindowEx(NULL,
WINDOW_CLASS_NAME, // class
"Ryan Lloyd's SCF", // title
WS_CAPTION | WS_BORDER | WS_POPUP | WS_VISIBLE,
100,5, // initial x,y
winwidth, winheight, // initial width, height
NULL, // handle to parent
NULL, // handle to menu
hinstance,// instance of this application
NULL))) // extra creation parms
appreciate any help you can give with regards to setting the width/height correctly.
Cheers
Ryan
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement