cocos-engine icon indicating copy to clipboard operation
cocos-engine copied to clipboard

Is it appropriate to use floating point to store the window size?

Open minggo opened this issue 3 years ago • 3 comments

As the title said, is there any situation that need float window size? If not, i think we should use integer to store window size.

minggo avatar Jul 20 '22 07:07 minggo

I have always used unsigned int to store window size. There are some graphics/system APIs which take float as input, but AFAIK they only use the integer part.

star-e avatar Jul 20 '22 08:07 star-e

In the end, it still needs to be converted to a int pixels, which feels unnecessary.

oahcy avatar Jul 20 '22 08:07 oahcy

I have always used unsigned int to store window size. There are some graphics/system APIs which take float as input, but AFAIK they only use the integer part.

Yep, unsigned int is better. As negative value is meaningless.

minggo avatar Jul 20 '22 08:07 minggo