c# - Colors in SDL acting very weird -


i'm making program in sdl.net, need draw filled polygon. figured might reuse polygon surface instead of remaking every time need draw, make surface this, , save dictionary afterwards:

polysur = video.screen.createcompatiblesurface(70, 70, true); polysur.transparentcolor = color.magenta; polysur.fill(color.magenta); polysur.transparent = true; poly.draw(polysur, color.lightgreen, false, true); 

poly polygon object i've created beforehand.

you might think draw light green polygon when surface blitted screen; doesn't. resulting polygon cyan! discovered through experimentation if make color color.fromargb, r channel becomes red, g channel becomes cyan, , b channel becomes black.

however, if set second boolean in draw call false (disabling filling), light green outline. obviously, fill operation causing colors mess up.

any ideas?

it's bug: http://sourceforge.net/tracker/index.php?func=detail&aid=3127181&group_id=52340&atid=466516

line 196 of polygon uses color rgg fill instead of rgb. make sit impossible blue color, , tends tint color other red.

frustrating, yes. when game hinges on being able draw polygons.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -