public CubeMap(int size, TextureFormat format) { Size = size; Format = format; id = GL.GenTexture(); WrapX = Texture.DefaultWrapX; WrapY = Texture.DefaultWrapY; MinFilter = Texture.DefaultMinFilter; MagFilter = Texture.DefaultMagFilter; MakeCurrent(); var pixelFormat = format.PixelFormat(); for (int i = 0; i < 6; ++i) { sides[i] = new CubeMapTexture(this, (CubeMapSide)((int)CubeMapSide.PosX + i)); sides[i].SetPixels(null as byte[], 1, pixelFormat); } }
public Texture2D(int width, int height, TextureFormat format) : this(format) { Width = width; Height = height; SetPixels(null as byte[], 1, format.PixelFormat()); }