-
GDI+ Limitation?
Hi all, long time no see-
I'm developing a li'l app for advanced SodaConstructing (don't worry if you don't know the term, its not vital), and I've come to a point where I want to draw all my lines antialiased. So, I had a play with GDI+ to draw my lines, but it seems to have a major limitation as far as antialiasing goes. The Graphics::SetSmoothingMode method takes an item from the SmoothingMode enum as a parameter. The contents of the SmoothingMode enum as documented are as follows:
Code:
typedef enum {
SmoothingModeInvalid = QualityModeInvalid,
SmoothingModeDefault = QualityModeDefault,
SmoothingModeHighSpeed = QualityModeLow,
SmoothingModeHighQuality = QualityModeHigh,
SmoothingModeNone,
SmoothingModeAntiAlias8x4,
SmoothingModeAntiAlias = SmoothingModeAntiAlias8x4,
SmoothingModeAntiAlias8x8
} SmoothingMode;
However, this is not how it is defined in GdiPlusEnums.h:
Code:
enum SmoothingMode
{
SmoothingModeInvalid = QualityModeInvalid,
SmoothingModeDefault = QualityModeDefault,
SmoothingModeHighSpeed = QualityModeLow,
SmoothingModeHighQuality = QualityModeHigh,
SmoothingModeNone,
SmoothingModeAntiAlias
};
...which leaves me unable to use an 8x8 box filter for my antialiasing, instead limiting me to an 8x4 box filter (SmoothingModeAntiAlias) which draws horrible lines when they are close to horizontal.
Does this mean that this part of the GDI+ library is incomplete at this stage, or was it just never implemented? It seems odd to me that they'd document something which would (i presume) be so simple to implement, but never include it in the actual library...
Does anybody...
a: ...know a workaround (or tell me the stupid mistake i'm making :p) to get 8x8 box filter antialiasing using GDI+?
b: ...know why this apparent limitation exists in GDI+?
c: ...know a good method, third party library or any other way to get antialiased lines without GDI+?
Thanks all for your time!
-jEFF
-
Hey, I stumbled accross the sodaplayer web site yesterday. Looks interesting. Are you writing a SodaConstructor in C++?
If SmoothingModeAntiAlias8x8 did exist in the enum its value would be SmoothingModeAntiAlias + 1 so try passing this in the method call. If it is implemented in the dll it should work.
If not, you may want to ask how to implement antialiasing in the game forum as they are the experts on graphics.
P.S I couldn't get my model to move(at least not in any particular direction)!
-
"Hey, I stumbled accross the sodaplayer web site yesterday. Looks interesting. Are you writing a SodaConstructor in C++?"
Exactly, but with more features that constructors have been asking for, that Ed (the creator of SodaPlay) has not had time to build into the official applets.
"If SmoothingModeAntiAlias8x8 did exist in the enum its value would be SmoothingModeAntiAlias + 1 so try passing this in the method call. If it is implemented in the dll it should work."
Yeah, I tried that, and many other static numbers - they're all interpereted as "no antialiasing".
"If not, you may want to ask how to implement antialiasing in the game forum as they are the experts on graphics."
Ok- thanks, but I'm pretty sure that if there's no way to do it well through GDI+ i'm going to move over to OGL... after hearing it praised by my brother a few minutes ago while playing table tennis :p --he showed me some examples and it looks incredibly easy to use.
"P.S I couldn't get my model to move(at least not in any particular direction)!"
You might want to have a look at http://www.sodaplaycentral.com for tips on constructing, and http://www.sodarace.net to ask questions on the official forum.
Thanks!
-jEFF
-
Download the latest Core SDK if you want to have the latest headers.
gg
-
Thanks, but apparently that was last updated February 2003, and since I dowloaded it in March (right on my birthday as it were!) I think its safe to assume I have the latest version :P
-jEFF