C# 클래스 Sparrow.Core.RenderSupport

파일 보기 프로젝트 열기: fmotagarcia/sparrow-sharp 1 사용 예제들

공개 메소드들

메소드 설명
AddDrawCalls ( int count ) : void

Raises the number of draw calls by a specific value. Call this method in custom render methods to keep the statistics display in sync.

ApplyBlendMode ( bool premultipliedAlpha ) : void

Activates the current blend mode.

BatchQuad ( Quad quad ) : void

Adds a quad or image to the current batch of unrendered quads. If there is a state change, all previous quads are rendered at once, and the batch is reset. Note that the values for alpha and blend mode are taken from the current render state, not the quad.

CheckForOpenGLError ( ) : uint

Checks for an OpenGL error. If there is one, it is logged an the error code is returned.

Clear ( uint color, float alpha = 0.0f ) : void

Clears OpenGL's color buffer with a specified color.

FinishQuadBatch ( ) : void

Renders the current quad batch and resets it.

NextFrame ( ) : void

Resets the render state stack to the default.

PopClipRect ( ) : void

Restores the clipping rectangle that was last pushed to the stack.

PopState ( ) : void

Restores the previous render state.

PurgeBuffers ( ) : void

Clears all vertex and index buffers, releasing the associated memory. Useful in low-memory situations. Don't call from within a render method!

PushClipRect ( Rectangle clipRect ) : Rectangle

The clipping rectangle can be used to limit rendering in the current render target to a certain area. This method expects the rectangle in stage coordinates. Internally, it uses the 'glScissor' command of OpenGL, which works with pixel coordinates. Any pushed rectangle is intersected with the previous rectangle; the method returns that intersection.

PushState ( Matrix matrix, float alpha, uint blendMode ) : void

Adds a new render state to the stack. The passed matrix is prepended to the modelview matrix; the alpha value is multiplied with the current alpha; the blend mode replaces the existing mode (except 'BlendMode.Auto', which will cause the current mode to prevail).

RenderSupport ( ) : System
SetupOrthographicProjection ( float left, float right, float top, float bottom ) : void

Sets up the projection matrix for ortographic 2D rendering.

비공개 메소드들

메소드 설명
ApplyClipRect ( ) : void

Updates the scissor rectangle using the current clipping rectangle. This method is called automatically when either the projection matrix or the clipping rectangle changes.

메소드 상세

AddDrawCalls() 공개 메소드

Raises the number of draw calls by a specific value. Call this method in custom render methods to keep the statistics display in sync.
public AddDrawCalls ( int count ) : void
count int
리턴 void

ApplyBlendMode() 공개 메소드

Activates the current blend mode.
public ApplyBlendMode ( bool premultipliedAlpha ) : void
premultipliedAlpha bool
리턴 void

BatchQuad() 공개 메소드

Adds a quad or image to the current batch of unrendered quads. If there is a state change, all previous quads are rendered at once, and the batch is reset. Note that the values for alpha and blend mode are taken from the current render state, not the quad.
public BatchQuad ( Quad quad ) : void
quad Quad
리턴 void

CheckForOpenGLError() 공개 정적인 메소드

Checks for an OpenGL error. If there is one, it is logged an the error code is returned.
public static CheckForOpenGLError ( ) : uint
리턴 uint

Clear() 공개 메소드

Clears OpenGL's color buffer with a specified color.
public Clear ( uint color, float alpha = 0.0f ) : void
color uint
alpha float
리턴 void

FinishQuadBatch() 공개 메소드

Renders the current quad batch and resets it.
public FinishQuadBatch ( ) : void
리턴 void

NextFrame() 공개 메소드

Resets the render state stack to the default.
public NextFrame ( ) : void
리턴 void

PopClipRect() 공개 메소드

Restores the clipping rectangle that was last pushed to the stack.
public PopClipRect ( ) : void
리턴 void

PopState() 공개 메소드

Restores the previous render state.
public PopState ( ) : void
리턴 void

PurgeBuffers() 공개 메소드

Clears all vertex and index buffers, releasing the associated memory. Useful in low-memory situations. Don't call from within a render method!
public PurgeBuffers ( ) : void
리턴 void

PushClipRect() 공개 메소드

The clipping rectangle can be used to limit rendering in the current render target to a certain area. This method expects the rectangle in stage coordinates. Internally, it uses the 'glScissor' command of OpenGL, which works with pixel coordinates. Any pushed rectangle is intersected with the previous rectangle; the method returns that intersection.
public PushClipRect ( Rectangle clipRect ) : Rectangle
clipRect Sparrow.Geom.Rectangle
리턴 Sparrow.Geom.Rectangle

PushState() 공개 메소드

Adds a new render state to the stack. The passed matrix is prepended to the modelview matrix; the alpha value is multiplied with the current alpha; the blend mode replaces the existing mode (except 'BlendMode.Auto', which will cause the current mode to prevail).
public PushState ( Matrix matrix, float alpha, uint blendMode ) : void
matrix Matrix
alpha float
blendMode uint
리턴 void

RenderSupport() 공개 메소드

public RenderSupport ( ) : System
리턴 System

SetupOrthographicProjection() 공개 메소드

Sets up the projection matrix for ortographic 2D rendering.
public SetupOrthographicProjection ( float left, float right, float top, float bottom ) : void
left float
right float
top float
bottom float
리턴 void