Lock() static private method

static private Lock ( ) : ContextLock
return ContextLock
示例#1
0
		public void Draw(Primitive primitive, int vertexCount, GraphicsBuffer elementBuffer, ElementType elementType, int elementOffsetInBytes) {
			if (elementBuffer == null)
				throw new ArgumentNullException("elementBuffer");
			Device.DrawStart(this);
			using (Device.Lock()) {
				GL.BindBuffer(BufferTarget.ElementArrayBuffer, elementBuffer.Id);
				CheckError();
				GL.DrawElements((BeginMode)primitive, vertexCount, (DrawElementsType)elementType, elementOffsetInBytes);
				CheckError();
				GL.BindBuffer(BufferTarget.ElementArrayBuffer, 0);
			}
		}
示例#2
0
		public void Draw(Primitive primitive, int firstVertex, int vertexCount) {
			Device.DrawStart(this);
			using (Device.Lock())
				GL.DrawArrays((PrimitiveType)primitive, firstVertex, vertexCount);
		}