C# 클래스 CSharpGL.Buffer

파일 보기 프로젝트 열기: bitzhuwei/CSharpGL

공개 메소드들

메소드 설명
Bind ( ) : void

Bind this buffer.

ClearBufferData ( uint internalFormat, uint format, uint type, IntPtr data, bool autoBind = true ) : bool

Fill a buffer object's data store with a fixed value.

ClearBufferData ( uint internalFormat, uint format, uint type, UnmanagedArrayBase data, bool autoBind = true ) : bool

Fill a buffer object's data store with a fixed value.

ClearBufferData ( vec3 data, bool autoBind = true ) : bool

Fill a buffer object's data store with a fixed value.

ClearBufferSubData ( int offset, uint size, vec3 data, bool autoBind = true ) : bool

Fill all or part of buffer object's data store with a fixed value.

ClearBufferSubData ( uint internalFormat, IntPtr offset, uint size, uint format, uint type, IntPtr data, bool autoBind = true ) : bool

Fill all or part of buffer object's data store with a fixed value.

ClearBufferSubData ( uint internalFormat, IntPtr offset, uint size, uint format, uint type, UnmanagedArrayBase data, bool autoBind = true ) : bool

Fill all or part of buffer object's data store with a fixed value.

Create ( IndependentBufferTarget target, Type elementType, int length, BufferUsage usage ) : Buffer

Creates a sub-type of Buffer object directly in server side(GPU) without initializing its value.

Create ( IndexBufferElementType type, int length, DrawMode mode, BufferUsage usage ) : OneIndexBuffer

Creates a OneIndexBuffer object directly in server side(GPU) without initializing its value.

Create ( Type elementType, int length, VBOConfig config, string varNameInVertexShader, BufferUsage usage, uint instanceDivisor, int patchVertexes ) : VertexBuffer

Creates a VertexBuffer object(actually an array) directly in server side(GPU) without initializing its value.

Create ( DrawMode mode, int firstVertex, int vertexCount, int primCount = 1 ) : ZeroIndexBuffer

Creates a ZeroIndexBuffer object directly in server side(GPU) without initializing its value.

Dispose ( ) : void

DumpBufferTexture ( uint internalFormat, bool autoDispose ) : Texture

Dump a Texture filled with this Buffer.

MapBuffer ( MapBufferAccess access, bool bind = true ) : IntPtr

Start to read/write buffer.

MapBufferRange ( int offset, int length, MapBufferRangeAccess access, bool bind = true ) : IntPtr

Start to read/write buffer.

Unbind ( ) : void

Unind this buffer.

UnmapBuffer ( bool unbind = true ) : bool

Stop reading/writing buffer.

보호된 메소드들

메소드 설명
Buffer ( uint bufferId, int length, int byteLength ) : System

位于服务器端(GPU内存)的定长数组。

An array at server side (GPU memory) with fixed length.

DisposeManagedResources ( ) : void

DisposeUnmanagedResources ( ) : void

비공개 메소드들

메소드 설명
Dispose ( bool disposing ) : void
GetSize ( IndexBufferElementType type ) : int

메소드 상세

Bind() 공개 메소드

Bind this buffer.
public Bind ( ) : void
리턴 void

Buffer() 보호된 메소드

位于服务器端(GPU内存)的定长数组。

An array at server side (GPU memory) with fixed length.

protected Buffer ( uint bufferId, int length, int byteLength ) : System
bufferId uint 用glGenBuffers()得到的VBO的Id。Id got from glGenBuffers();
length int 此VBO含有多少个元素?How many elements?
byteLength int 此VBO中的数据在内存中占用多少个字节?How many bytes in this buffer?
리턴 System

ClearBufferData() 공개 메소드

Fill a buffer object's data store with a fixed value.
public ClearBufferData ( uint internalFormat, uint format, uint type, IntPtr data, bool autoBind = true ) : bool
internalFormat uint The sized internal format with which the data will be stored in the buffer object.
format uint Specifies the format of the pixel data. For transfers of depth, stencil, or depth/stencil data, you must use GL_DEPTH_COMPONENT​, GL_STENCIL_INDEX​, or GL_DEPTH_STENCIL​, where appropriate. For transfers of normalized integer or floating-point color image data, you must use one of the following: GL_RED​, GL_GREEN​, GL_BLUE​, GL_RG​, GL_RGB​, GL_BGR​, GL_RGBA​, and GL_BGRA​. For transfers of non-normalized integer data, you must use one of the following: GL_RED_INTEGER​, GL_GREEN_INTEGER​, GL_BLUE_INTEGER​, GL_RG_INTEGER​, GL_RGB_INTEGER​, GL_BGR_INTEGER​, GL_RGBA_INTEGER​, and GL_BGRA_INTEGER​.
type uint Specifies the data type of the pixel data. The following symbolic values are accepted: GL_UNSIGNED_BYTE​, GL_BYTE​, GL_UNSIGNED_SHORT​, GL_SHORT​, GL_UNSIGNED_INT​, GL_INT​, GL_FLOAT​, GL_UNSIGNED_BYTE_3_3_2​, GL_UNSIGNED_BYTE_2_3_3_REV​, GL_UNSIGNED_SHORT_5_6_5​, GL_UNSIGNED_SHORT_5_6_5_REV​, GL_UNSIGNED_SHORT_4_4_4_4​, GL_UNSIGNED_SHORT_4_4_4_4_REV​, GL_UNSIGNED_SHORT_5_5_5_1​, GL_UNSIGNED_SHORT_1_5_5_5_REV​, GL_UNSIGNED_INT_8_8_8_8​, GL_UNSIGNED_INT_8_8_8_8_REV​, GL_UNSIGNED_INT_10_10_10_2​, and GL_UNSIGNED_INT_2_10_10_10_REV​.
data System.IntPtr Specifies a pointer to a single pixel of data to upload. This parameter may not be IntPtr.Zero.
autoBind bool Automatically call glBindBuffer() inside this method.
리턴 bool

ClearBufferData() 공개 메소드

Fill a buffer object's data store with a fixed value.
public ClearBufferData ( uint internalFormat, uint format, uint type, UnmanagedArrayBase data, bool autoBind = true ) : bool
internalFormat uint The sized internal format with which the data will be stored in the buffer object.
format uint Specifies the format of the pixel data. For transfers of depth, stencil, or depth/stencil data, you must use GL_DEPTH_COMPONENT​, GL_STENCIL_INDEX​, or GL_DEPTH_STENCIL​, where appropriate. For transfers of normalized integer or floating-point color image data, you must use one of the following: GL_RED​, GL_GREEN​, GL_BLUE​, GL_RG​, GL_RGB​, GL_BGR​, GL_RGBA​, and GL_BGRA​. For transfers of non-normalized integer data, you must use one of the following: GL_RED_INTEGER​, GL_GREEN_INTEGER​, GL_BLUE_INTEGER​, GL_RG_INTEGER​, GL_RGB_INTEGER​, GL_BGR_INTEGER​, GL_RGBA_INTEGER​, and GL_BGRA_INTEGER​.
type uint Specifies the data type of the pixel data. The following symbolic values are accepted: GL_UNSIGNED_BYTE​, GL_BYTE​, GL_UNSIGNED_SHORT​, GL_SHORT​, GL_UNSIGNED_INT​, GL_INT​, GL_FLOAT​, GL_UNSIGNED_BYTE_3_3_2​, GL_UNSIGNED_BYTE_2_3_3_REV​, GL_UNSIGNED_SHORT_5_6_5​, GL_UNSIGNED_SHORT_5_6_5_REV​, GL_UNSIGNED_SHORT_4_4_4_4​, GL_UNSIGNED_SHORT_4_4_4_4_REV​, GL_UNSIGNED_SHORT_5_5_5_1​, GL_UNSIGNED_SHORT_1_5_5_5_REV​, GL_UNSIGNED_INT_8_8_8_8​, GL_UNSIGNED_INT_8_8_8_8_REV​, GL_UNSIGNED_INT_10_10_10_2​, and GL_UNSIGNED_INT_2_10_10_10_REV​.
data UnmanagedArrayBase Specifies a pointer to a single pixel of data to upload. This parameter may not be null.
autoBind bool Automatically call glBindBuffer() inside this method.
리턴 bool

ClearBufferData() 공개 메소드

Fill a buffer object's data store with a fixed value.
public ClearBufferData ( vec3 data, bool autoBind = true ) : bool
data vec3
autoBind bool Automatically call glBindBuffer() inside this method.
리턴 bool

ClearBufferSubData() 공개 메소드

Fill all or part of buffer object's data store with a fixed value.
public ClearBufferSubData ( int offset, uint size, vec3 data, bool autoBind = true ) : bool
offset int The offset, in basic machine units into the buffer object's data store at which to start filling.
size uint The size, in basic machine units of the range of the data store to fill.
data vec3 Specifies a pointer to a single pixel of data to upload. This parameter may not be null.
autoBind bool Automatically call glBindBuffer() inside this method.
리턴 bool

ClearBufferSubData() 공개 메소드

Fill all or part of buffer object's data store with a fixed value.
public ClearBufferSubData ( uint internalFormat, IntPtr offset, uint size, uint format, uint type, IntPtr data, bool autoBind = true ) : bool
internalFormat uint The sized internal format with which the data will be stored in the buffer object.
offset System.IntPtr The offset, in basic machine units into the buffer object's data store at which to start filling.
size uint The size, in basic machine units of the range of the data store to fill.
format uint Specifies the format of the pixel data. For transfers of depth, stencil, or depth/stencil data, you must use GL_DEPTH_COMPONENT​, GL_STENCIL_INDEX​, or GL_DEPTH_STENCIL​, where appropriate. For transfers of normalized integer or floating-point color image data, you must use one of the following: GL_RED​, GL_GREEN​, GL_BLUE​, GL_RG​, GL_RGB​, GL_BGR​, GL_RGBA​, and GL_BGRA​. For transfers of non-normalized integer data, you must use one of the following: GL_RED_INTEGER​, GL_GREEN_INTEGER​, GL_BLUE_INTEGER​, GL_RG_INTEGER​, GL_RGB_INTEGER​, GL_BGR_INTEGER​, GL_RGBA_INTEGER​, and GL_BGRA_INTEGER​.
type uint Specifies the data type of the pixel data. The following symbolic values are accepted: GL_UNSIGNED_BYTE​, GL_BYTE​, GL_UNSIGNED_SHORT​, GL_SHORT​, GL_UNSIGNED_INT​, GL_INT​, GL_FLOAT​, GL_UNSIGNED_BYTE_3_3_2​, GL_UNSIGNED_BYTE_2_3_3_REV​, GL_UNSIGNED_SHORT_5_6_5​, GL_UNSIGNED_SHORT_5_6_5_REV​, GL_UNSIGNED_SHORT_4_4_4_4​, GL_UNSIGNED_SHORT_4_4_4_4_REV​, GL_UNSIGNED_SHORT_5_5_5_1​, GL_UNSIGNED_SHORT_1_5_5_5_REV​, GL_UNSIGNED_INT_8_8_8_8​, GL_UNSIGNED_INT_8_8_8_8_REV​, GL_UNSIGNED_INT_10_10_10_2​, and GL_UNSIGNED_INT_2_10_10_10_REV​.
data System.IntPtr Specifies a pointer to a single pixel of data to upload. This parameter may not be IntPtr.Zero.
autoBind bool Automatically call glBindBuffer() inside this method.
리턴 bool

ClearBufferSubData() 공개 메소드

Fill all or part of buffer object's data store with a fixed value.
public ClearBufferSubData ( uint internalFormat, IntPtr offset, uint size, uint format, uint type, UnmanagedArrayBase data, bool autoBind = true ) : bool
internalFormat uint The sized internal format with which the data will be stored in the buffer object.
offset System.IntPtr The offset, in basic machine units into the buffer object's data store at which to start filling.
size uint The size, in basic machine units of the range of the data store to fill.
format uint Specifies the format of the pixel data. For transfers of depth, stencil, or depth/stencil data, you must use GL_DEPTH_COMPONENT​, GL_STENCIL_INDEX​, or GL_DEPTH_STENCIL​, where appropriate. For transfers of normalized integer or floating-point color image data, you must use one of the following: GL_RED​, GL_GREEN​, GL_BLUE​, GL_RG​, GL_RGB​, GL_BGR​, GL_RGBA​, and GL_BGRA​. For transfers of non-normalized integer data, you must use one of the following: GL_RED_INTEGER​, GL_GREEN_INTEGER​, GL_BLUE_INTEGER​, GL_RG_INTEGER​, GL_RGB_INTEGER​, GL_BGR_INTEGER​, GL_RGBA_INTEGER​, and GL_BGRA_INTEGER​.
type uint Specifies the data type of the pixel data. The following symbolic values are accepted: GL_UNSIGNED_BYTE​, GL_BYTE​, GL_UNSIGNED_SHORT​, GL_SHORT​, GL_UNSIGNED_INT​, GL_INT​, GL_FLOAT​, GL_UNSIGNED_BYTE_3_3_2​, GL_UNSIGNED_BYTE_2_3_3_REV​, GL_UNSIGNED_SHORT_5_6_5​, GL_UNSIGNED_SHORT_5_6_5_REV​, GL_UNSIGNED_SHORT_4_4_4_4​, GL_UNSIGNED_SHORT_4_4_4_4_REV​, GL_UNSIGNED_SHORT_5_5_5_1​, GL_UNSIGNED_SHORT_1_5_5_5_REV​, GL_UNSIGNED_INT_8_8_8_8​, GL_UNSIGNED_INT_8_8_8_8_REV​, GL_UNSIGNED_INT_10_10_10_2​, and GL_UNSIGNED_INT_2_10_10_10_REV​.
data UnmanagedArrayBase Specifies a pointer to a single pixel of data to upload. This parameter may not be null.
autoBind bool Automatically call glBindBuffer() inside this method.
리턴 bool

Create() 공개 정적인 메소드

Creates a sub-type of Buffer object directly in server side(GPU) without initializing its value.
public static Create ( IndependentBufferTarget target, Type elementType, int length, BufferUsage usage ) : Buffer
target IndependentBufferTarget
elementType System.Type
length int
usage BufferUsage
리턴 Buffer

Create() 공개 정적인 메소드

Creates a OneIndexBuffer object directly in server side(GPU) without initializing its value.
public static Create ( IndexBufferElementType type, int length, DrawMode mode, BufferUsage usage ) : OneIndexBuffer
type IndexBufferElementType
length int How many indexes are there?(How many uint/ushort/bytes?)
mode DrawMode
usage BufferUsage
리턴 OneIndexBuffer

Create() 공개 정적인 메소드

Creates a VertexBuffer object(actually an array) directly in server side(GPU) without initializing its value.
public static Create ( Type elementType, int length, VBOConfig config, string varNameInVertexShader, BufferUsage usage, uint instanceDivisor, int patchVertexes ) : VertexBuffer
elementType System.Type element's type of this 'array'.
length int How many elements are there?
config VBOConfig mapping to vertex shader's 'in' type.
varNameInVertexShader string mapping to vertex shader's 'in' name.
usage BufferUsage
instanceDivisor uint
patchVertexes int
리턴 VertexBuffer

Create() 공개 정적인 메소드

Creates a ZeroIndexBuffer object directly in server side(GPU) without initializing its value.
public static Create ( DrawMode mode, int firstVertex, int vertexCount, int primCount = 1 ) : ZeroIndexBuffer
mode DrawMode
firstVertex int
vertexCount int
primCount int
리턴 ZeroIndexBuffer

Dispose() 공개 메소드

public Dispose ( ) : void
리턴 void

DisposeManagedResources() 보호된 메소드

protected DisposeManagedResources ( ) : void
리턴 void

DisposeUnmanagedResources() 보호된 메소드

protected DisposeUnmanagedResources ( ) : void
리턴 void

DumpBufferTexture() 공개 메소드

Dump a Texture filled with this Buffer.
public DumpBufferTexture ( uint internalFormat, bool autoDispose ) : Texture
internalFormat uint
autoDispose bool Dispose this buffer when disposing returned texture.
리턴 Texture

MapBuffer() 공개 메소드

Start to read/write buffer.
public MapBuffer ( MapBufferAccess access, bool bind = true ) : IntPtr
access MapBufferAccess
bind bool
리턴 IntPtr

MapBufferRange() 공개 메소드

Start to read/write buffer.
public MapBufferRange ( int offset, int length, MapBufferRangeAccess access, bool bind = true ) : IntPtr
offset int
length int
access MapBufferRangeAccess
bind bool
리턴 IntPtr

Unbind() 공개 메소드

Unind this buffer.
public Unbind ( ) : void
리턴 void

UnmapBuffer() 공개 메소드

Stop reading/writing buffer.
public UnmapBuffer ( bool unbind = true ) : bool
unbind bool
리턴 bool