openFrameworks
openFrameworks copied to clipboard
[W.I.P.] suppress warning about implicit type conversions
related: #6929
@dimitre
I try to supress warnings, but I can't decide what is correct way in many situations. I think, rest of warnings are from gaps between C++ types and OpenGL (or other third-party library) types.
Maybe, we have to do force cast, but is it fundamental solution...?
for example, ofTexture::allocate
:
- many
ofTexture::allocate
methods delegating to otherallocate
method with size_t arguments likeallocate(pix.getWidth(), pix.getHeight(), ...)
- but width and height arguments of
ofTexture::allocate
is typed asint
- and allocate method that is finally called,
w
andh
will assinged totexData.width
,texData.height
are typed asfloat
I can't decide what is right type to allocate
.
what do you think...?
I suppose texData is float for a reason, like the tex hack to remove artifacts, so maybe ofTexture allocate should use float parameters? What do you think @ofTheo ?
What is the problem with implicit conversion other than the annoying warnings?
@roymacdonald I think the warnings are there so we can make decision about control of the types. This specific one already brings the question : should a texture be allocated with float? if yes should ofTexture receive float parameters too ?