# My button gets mad in release mode!! D:

This topic is 2948 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Sorry for the Thread-Title, but I couldn't resist.

So, my problem can be explained in two pictures:

Debug-Mode:

Release-Mode:

Here is the code for setting the colors and creating the brush.
I don't see why only the top of it is red...

GUI_Color1=ColorF(0.4,0.4,0.4,1);GUI_Color2=ColorF(0.2,0.2,0.2,1);GUI_Color3=ColorF(0.1,0.1,0.1,1);

D2D1_GRADIENT_STOP GUISstops[4];	GUISstops[0].color = ColorF(GUI_Color1.r,GUI_Color1.g,GUI_Color1.b,GUI_Color1.a);	GUISstops[0].position = 0.0f;	GUISstops[1].color = ColorF(GUI_Color2.r,GUI_Color2.g,GUI_Color2.b,GUI_Color2.a);	GUISstops[1].position = 0.5f;	GUISstops[2].color = ColorF(GUI_Color3.r,GUI_Color3.g,GUI_Color3.b,GUI_Color3.a);	GUISstops[2].position = 1.0f;		ID2D1GradientStopCollection* pGUI_S_GradientStops; 	hr =  D2DObjects.RenderTarget->CreateGradientStopCollection(		GUISstops,		ARRAYSIZE(GUISstops),		&pGUI_S_GradientStops		);	D2DObjects.RenderTarget->CreateLinearGradientBrush(		D2D1::LinearGradientBrushProperties(		D2D1::Point2F(100, 0),		D2D1::Point2F(100, 200)		),		D2D1::BrushProperties(),		pGUI_S_GradientStops,		&D2DObjects.GUIStyleBrush		);	pGUI_S_GradientStops->Release();

Wired... I just wanted to run it in release mode to make some screenshots for a news-posting, and now THAT! Would be great if someone can tell me how to fix this.

##### Share on other sites
D2D1_GRADIENT_STOP GUISstops[4]; //<----- This.	GUISstops[0].color = ColorF(GUI_Color1.r,GUI_Color1.g,GUI_Color1.b,GUI_Color1.a);	GUISstops[0].position = 0.0f;	GUISstops[1].color = ColorF(GUI_Color2.r,GUI_Color2.g,GUI_Color2.b,GUI_Color2.a);	GUISstops[1].position = 0.5f;	GUISstops[2].color = ColorF(GUI_Color3.r,GUI_Color3.g,GUI_Color3.b,GUI_Color3.a);	GUISstops[2].position = 1.0f;

-I've got a problem
-I can't solve it
-I post it at gamedev
-I see the solution immediately after posting

meh.

##### Share on other sites
uninitialized variables? :)

##### Share on other sites
There have been dozen of times where I've written up a post only to solve my own problem by the time I'm down writing it. Filtering information through certain language centers in the brain really does wonders [smile]

##### Share on other sites
Hey! you should be happy! Now, you have two color themes!!
And I like the scrollbar skin.

##### Share on other sites
Quote:
 There have been dozen of times where I've written up a post only to solve my own problem by the time I'm down writing it. Filtering information through certain language centers in the brain really does wonders

Oh yes, it does! About 50% of my postings get solved by myself before I posted them [grin]

Quote:
 Hey! you should be happy! Now, you have two color themes!!

Damn, I like Debug<->Release bugs where the drawing fails, but in some cool way!

Quote:
 And I like the scrollbar skin.

Thanks [smile]

##### Share on other sites
Quote:
Original post by mind in a box
Quote:
 There have been dozen of times where I've written up a post only to solve my own problem by the time I'm down writing it. Filtering information through certain language centers in the brain really does wonders

Oh yes, it does! About 50% of my postings get solved by myself before I posted them [grin]

At work we actually have something called a 'Code Robot'. It's basically a CD/DVD storage case (shaped like a giant can of coke) with two arms made from rolled up paper and a face stuck on the front. The idea is that before you bother any one with your problem, you are supposed to explain the problem to the Code Robot, and in doing so you work out the solution yourself.

Obviously no one uses it because you look like an idiot - but it's a fun idea anyway [smile]

##### Share on other sites
That's why I can solve most of my problems! I always think as if I'm talking and explaining to a person, who is shaped like a giant can of coke with two arms made from rolled up paper and a face stuck on the front.

1. 1
2. 2
frob
20
3. 3
Rutin
17
4. 4
5. 5

• 12
• 13
• 10
• 9
• 18
• ### Forum Statistics

• Total Topics
632555
• Total Posts
3007039

×