private void Awake() { maxIterations = PlayerPrefs.iteration; drawingMode = PlayerPrefs.drawingMode; colorMap = new ColorMap(drawingMode); texture = new Texture2D(PlayerPrefs.ScreenSize, PlayerPrefs.ScreenSize); GetComponent <Renderer>().material.mainTexture = texture; rowMax = (int)Mathf.Sqrt(2 * texture.height); }
public ColorMap(drawingMode mode) { colors = new List <Color>(); float step = 1 / 255f; if (mode.Equals(drawingMode.NORMAL)) { for (int i = 0; i < 127; i += 5) { for (int k = 0; k < 127; k += 5) { for (int j = 0; j < 127; j += 5) { colors.Add(new Color(i * step, k * step, j * step)); } } } } else if (mode.Equals(drawingMode.WTF)) { for (int i = 0; i < 255; i++) { colors.Add(new Color(i * step, 1 - (i * step), 1 - (i * step))); colors.Add(new Color(1 - (i * step), i * step, 1 - (i * step))); colors.Add(new Color(1 - (i * step), 1 - (i * step), i * step)); } } else if (mode.Equals(drawingMode.ANOTHER)) { for (int i = 0; i < 255; i++) { colors.Add(new Color(i * step, 0, 0)); colors.Add(new Color(0, i * step, 0)); colors.Add(new Color(0, 0, i * step)); } } }
private static extern int SetROP2( IntPtr hdc, // handle of device context drawingMode fnDrawMode // drawing mode );
public int SetROP2(drawingMode fnDrawMode) { return(SetROP2(hdc, fnDrawMode)); }
public static extern int SetROP2(IntPtr hdc, drawingMode fnDrawMode);
public int SetROP2(drawingMode fnDrawMode) { return SetROP2(hdc,fnDrawMode); }
public static extern int SetROP2( IntPtr hdc, // handle of device context drawingMode fnDrawMode // drawing mode );
public int SetROP2(drawingMode fnDrawMode) { return(GDI.SetROP2(this.hdc, fnDrawMode)); }