c++ - Odd results using glTexImage2D -
c++ - Odd results using glTexImage2D - i've been trying figure out how glteximage2d works , seeing odd results pretty clear-cut code. code draws rough circle 256*256 length unsigned array , sends info out become texture. texture displayed turning out variations of reddish , orange no matter combinations select within image creation loop: unsigned* info = new unsigned[256*256]; (int y = 0; y < 256; ++y) (int x = 0; x < 256; ++x) if ((x - 100)*(x - 100) + (y - 156)*(y - 156) < 75*75) data[256*y + x] = ((156 << 24) | (256 << 16) | (156 << 8) | (200 << 0)); else data[256*y + x] = 0; // i'd expect transparent , above transparent , green, it's reddish somehow. glbindtexture(gl_texture_2d, texid); gltexparameteri(gl_texture_2d, gl_texture_min_filter, gl_linear); gltexparameteri(gl_texture_2d, gl_texture_mag_filter, gl_linear); glteximage2d(gl_texture_2d, 0, gl_rgba8, 256, 256, 0, gl_rgba...