public void SetTexCoords(UsageHint usage, coord[] texCoords) { Contract.Requires <ObjectDisposedException>(!IsDisposed); GL.BindBuffer(BufferTarget.ArrayBuffer, _texCoordBuffer); GL.BufferData(BufferTarget.ArrayBuffer, new IntPtr(sizeof(coord) * texCoords.Length), texCoords, (BufferUsageHint)usage); _Graphics.ErrorCheck(); }
public override string ToString() { return(string.Concat( nameof(Handle) + "=", Handle.ToString(), ", " + nameof(StorageLengthInBytes) + "=", StorageLengthInBytes.ToString(), ", " + nameof(UsageHint) + "=", UsageHint.ToString() )); }
public SamplerBuffer(byte[] data, UsageHint usageHint = UsageHint.StaticRead) { this._bufferId = GL.GenBuffer(); GL.BindBuffer(BufferTarget.TextureBuffer, _bufferId); GL.BufferData(BufferTarget.TextureBuffer, new IntPtr(data.Length), data, (BufferUsageHint)usageHint); this._textureId = GL.GenTexture(); }
public void SetVertices(UsageHint usage, params GraphicsPoint[] vertices) { Contract.Requires <ObjectDisposedException>(!IsDisposed); GL.BindBuffer(BufferTarget.ArrayBuffer, _vertexBuffer); GL.BufferData(BufferTarget.ArrayBuffer, new IntPtr(GraphicsPoint.Size * vertices.Length), vertices, (BufferUsageHint)usage); _vertexCount = vertices.Length; _Graphics.ErrorCheck(); }
public void TriangleStripCoords(UsageHint usage, int count) { Contract.Requires <ObjectDisposedException>(!IsDisposed); Contract.Requires <ArgumentOutOfRangeException>(count >= 0); GL.BindBuffer(BufferTarget.ArrayBuffer, _texCoordBuffer); GL.BufferData(BufferTarget.ArrayBuffer, new IntPtr(8 * sizeof(coord) * count), Enumerable.Repeat(defaultTriangleStripCoords, count).ToArray(), (BufferUsageHint)usage); _Graphics.ErrorCheck(); }
public void SetColors(UsageHint usage, Color[] colors) { // @TODO Select colors for each primitive? (e.g. when drawing PrimitiveType.Triangles, allow colors.Length == vertices.Length / 3) Contract.Requires <ObjectDisposedException>(!IsDisposed); GL.BindBuffer(BufferTarget.ArrayBuffer, _colorBuffer); GL.EnableVertexAttribArray(1); GL.BufferData(BufferTarget.ArrayBuffer, new IntPtr(4 * colors.Length), colors, (BufferUsageHint)usage); _Graphics.ErrorCheck(); }
public void SetVertices(UsageHint usage, params coord[] vertices) { Contract.Requires <ObjectDisposedException>(!IsDisposed); Contract.Requires <ArgumentException>(vertices.Length % 2 == 0); GL.BindBuffer(BufferTarget.ArrayBuffer, _vertexBuffer); GL.BufferData(BufferTarget.ArrayBuffer, new IntPtr(sizeof(coord) * vertices.Length), vertices, (BufferUsageHint)usage); _vertexCount = vertices.Length / 2; _Graphics.ErrorCheck(); }
void OnTriggerExit2D(Collider2D collider) { if (collider.tag == "Player") { if (!autoStart) { hot = false; UsageHint.Hide(); } } }
void OnTriggerEnter2D(Collider2D collider) { if (collider.tag == "Player") { if (autoStart) { StartConversation(); } else { hot = true; UsageHint.Show(); } } }
public void StartConversation() { onStart.Invoke(); opened = true; bubble = Instantiate(bubblePrefab).GetComponent <SpeechBubble>(); bubble.transform.SetParent(gameObject.transform, false); PlayerInput.instance.enabled = false; currentPhrase = 0; bubble.phrase.text = phrases[currentPhrase].text; bubble.portrait.sprite = phrases[currentPhrase].portrait; if (!autoStart) { UsageHint.Hide(); } }
void Start() { instance = this; text = GetComponent<Text> (); }
void Start() { instance = this; text = GetComponent <Text> (); }
public void WriteData(byte[] data, UsageHint usageHint = UsageHint.DynamicRead) { Contract.Requires <ObjectDisposedException>(!IsDisposed); GL.BindBuffer(BufferTarget.TextureBuffer, _bufferId); GL.BufferData(BufferTarget.TextureBuffer, new IntPtr(data.Length), data, (BufferUsageHint)usageHint); }