Having such a simple code:
struct OurVertex
{
float x, y, z; // pozycja
float rhw; // komponent rhw
int color; // kolor
};
OurVertex verts[] = {
{ 20.0f, 20.0f, 0.5f, 1.0f, 0xffff0000, },
{ 40.0f, 20.0f, 0.5f, 1.0f, 0xff00ff00, },
{ 20.0f, 40.0f, 0.5f, 1.0f, 0xff00ff55, },
{ 40.0f, 40.0f, 0.5f, 1.0f, 0xff0000ff},
};
I'm getting an error:
};
^
main.cpp:47:1: error: narrowing conversion of ‘4278255360u’ from ‘unsigned int’ to ‘int’ inside { } [-Wnarrowing]
main.cpp:47:1: error: narrowing conversion of ‘4278255445u’ from ‘unsigned int’ to ‘int’ inside { } [-Wnarrowing]
main.cpp:47:1: error: narrowing conversion of ‘4278190335u’ from ‘unsigned int’ to ‘int’ inside { } [-Wnarrowing]
the most disturbing for me is the }; error line. What's wrong with the code provided?
pozycja == position– not sure if I had gotten that without the variable namesx, y, z). Then avoid commenting the obvious, comments not providing additional information just make reading the code harder; compareint color; // colorvs.int color; // as RGB with alpha channel, R at byte 0