Jump to content
  • Advertisement
Sign in to follow this  
spree

HBRUSH

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

I"m using hbrush=CreateSolidBrush(RGB(0,0,0)) to select the color of my graphical objects in my game. My questions is: When I desire to change the color of my hbrush, do I must use the CreateSolidBrush inorder to give my brush a new color? this function creats a new object, and I dont want to creat new brushes, I want to use the same brush to color my game elements, is there a function which alters the color of my brush? or I must delete the current brush and create a new one each time I wish to change the color?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Empirical
Or you can create as many brushes as you like and keep them until the end.


Although it is simpler to use, it is still not a good idea to do in practice. The number of GDI object that you can create is system-wide limited - the number is quite high, something like 32767, but it is still limited. Therefore, it is better to create a GDI object when needed and to destroy it when it is no more needed.

Regards,

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!