OpenSiv3D  v0.6.5
C++20 framework for creative coding
s3d::Graphics2D Namespace Reference

Functions

Float4 GetColorMul ()
 現在適用されている乗算カラーを返します。 More...
 
Float4 GetColorAdd ()
 現在適用されている加算カラーを返します。 More...
 
BlendState GetBlendState ()
 現在適用されているブレンドステートを返します。 More...
 
RasterizerState GetRasterizerState ()
 現在適用されているラスタライザーステートを返します。 More...
 
SamplerState GetSamplerState (ShaderStage shaderStage=ShaderStage::Pixel, uint32 slot=0)
 現在適用されているサンプラーステートを返します。 More...
 
void SetScissorRect (const Rect &rect)
 シザー矩形を設定します。 More...
 
Rect GetScissorRect ()
 現在設定されているシザー矩形を返します。 More...
 
Optional< RectGetViewport ()
 現在適用されているビューポートを返します。 More...
 
Optional< VertexShaderGetCustomVertexShader ()
 現在適用されている頂点シェーダを返します。 More...
 
Optional< PixelShaderGetCustomPixelShader ()
 現在適用されているピクセルシェーダを返します。 More...
 
const Mat3x2GetLocalTransform ()
 現在適用されているローカル座標変換を返します。 More...
 
const Mat3x2GetCameraTransform ()
 現在適用されている 2D カメラ座標変換を返します。 More...
 
float GetMaxScaling () noexcept
 現在適用されている座標変換による縦横の拡大縮小倍率のうち大きいほうを返します。 More...
 
Optional< RenderTextureGetRenderTarget ()
 現在のレンダーターゲットになっているレンダーテクスチャを返します。 More...
 
Size GetRenderTargetSize ()
 現在のレンダーターゲットのサイズ(ピクセル)を返します More...
 
void SetVSTexture (uint32 slot, const Optional< Texture > &texture)
 2D 描画の頂点シェーダのテクスチャスロットにテクスチャをアタッチします。 More...
 
void SetPSTexture (uint32 slot, const Optional< Texture > &texture)
 2D 描画のピクセルシェーダのテクスチャスロットにテクスチャをアタッチします。 More...
 
void Flush ()
 現在までの 2D 描画を実行します。 More...
 
void DrawTriangles (uint32 count)
 頂点情報を設定せずに 2D 三角形を描画します。 More...
 
void SetSDFParameters (const TextStyle &textStyle)
 SDF 描画用のパラメータを設定します。 More...
 
void SetMSDFParameters (const TextStyle &textStyle)
 MSDF 描画用のパラメータを設定します。 More...
 
template<class Type >
void SetVSConstantBuffer (uint32 slot, const ConstantBuffer< Type > &buffer)
 頂点シェーダの定数バッファを設定します。 More...
 
template<class Type >
void SetPSConstantBuffer (uint32 slot, const ConstantBuffer< Type > &buffer)
 ピクセルシェーダの定数バッファを設定します。 More...
 
template<class Type >
void SetConstantBuffer (ShaderStage stage, uint32 slot, const ConstantBuffer< Type > &buffer)
 定数バッファを設定します。 More...
 

Function Documentation

◆ DrawTriangles()

void s3d::Graphics2D::DrawTriangles ( uint32  count)

頂点情報を設定せずに 2D 三角形を描画します。

Remarks
頂点シェーダを使って、各三角形に適切な頂点情報を与える必要があります。
Parameters
count描画する三角形の個数

◆ Flush()

void s3d::Graphics2D::Flush ( )

現在までの 2D 描画を実行します。

Remarks
MSRenderTexture のリゾルブ前に必要です。

◆ GetBlendState()

BlendState s3d::Graphics2D::GetBlendState ( )

現在適用されているブレンドステートを返します。

Returns
現在適用されているブレンドステート

◆ GetCameraTransform()

const Mat3x2& s3d::Graphics2D::GetCameraTransform ( )

現在適用されている 2D カメラ座標変換を返します。

Returns
現在適用されている 2D カメラ座標変換

◆ GetColorAdd()

Float4 s3d::Graphics2D::GetColorAdd ( )

現在適用されている加算カラーを返します。

Returns
現在適用されている加算カラー

◆ GetColorMul()

Float4 s3d::Graphics2D::GetColorMul ( )

現在適用されている乗算カラーを返します。

Returns
現在適用されている乗算カラー

◆ GetCustomPixelShader()

Optional<PixelShader> s3d::Graphics2D::GetCustomPixelShader ( )

現在適用されているピクセルシェーダを返します。

Returns
現在適用されているピクセルシェーダ。デフォルトの場合は none

◆ GetCustomVertexShader()

Optional<VertexShader> s3d::Graphics2D::GetCustomVertexShader ( )

現在適用されている頂点シェーダを返します。

Returns
現在適用されている頂点シェーダ。デフォルトの場合は none

◆ GetLocalTransform()

const Mat3x2& s3d::Graphics2D::GetLocalTransform ( )

現在適用されているローカル座標変換を返します。

Returns
現在適用されているローカル座標変換

◆ GetMaxScaling()

float s3d::Graphics2D::GetMaxScaling ( )
noexcept

現在適用されている座標変換による縦横の拡大縮小倍率のうち大きいほうを返します。

Returns
現在適用されている座標変換による縦横の拡大縮小倍率のうち大きいほう
Remarks
線の太さをこの値で除算すれば、どのような拡大縮小倍率でも一定の太さになる線を描けます。

◆ GetRasterizerState()

RasterizerState s3d::Graphics2D::GetRasterizerState ( )

現在適用されているラスタライザーステートを返します。

Returns
現在適用されているラスタライザーステート

◆ GetRenderTarget()

Optional<RenderTexture> s3d::Graphics2D::GetRenderTarget ( )

現在のレンダーターゲットになっているレンダーテクスチャを返します。

Returns
現在のレンダーターゲットになっているレンダーテクスチャ。デフォルトのシーンの場合 none

◆ GetRenderTargetSize()

Size s3d::Graphics2D::GetRenderTargetSize ( )

現在のレンダーターゲットのサイズ(ピクセル)を返します

Returns
現在のレンダーターゲットのサイズ(ピクセル)

◆ GetSamplerState()

SamplerState s3d::Graphics2D::GetSamplerState ( ShaderStage  shaderStage = ShaderStage::Pixel,
uint32  slot = 0 
)

現在適用されているサンプラーステートを返します。

Parameters
shaderStageシェーダステージ
slotテクスチャスロット
Returns
現在適用されているサンプラーステート

◆ GetScissorRect()

Rect s3d::Graphics2D::GetScissorRect ( )

現在設定されているシザー矩形を返します。

Returns
現在設定されているシザー矩形

◆ GetViewport()

Optional<Rect> s3d::Graphics2D::GetViewport ( )

現在適用されているビューポートを返します。

Returns
現在適用されているビューポート。シーンと一致する場合は none

◆ SetConstantBuffer()

template<class Type >
void s3d::Graphics2D::SetConstantBuffer ( ShaderStage  stage,
uint32  slot,
const ConstantBuffer< Type > &  buffer 
)
inline

定数バッファを設定します。

Template Parameters
Type定数バッファの構造体
Parameters
stageシェーダステージ
slotスロット
buffer定数バッファ
Remarks
予約されているスロットは使用できません。詳しくはドキュメントを読んでください

◆ SetMSDFParameters()

void s3d::Graphics2D::SetMSDFParameters ( const TextStyle textStyle)

MSDF 描画用のパラメータを設定します。

Parameters
textStyleテキストスタイル

◆ SetPSConstantBuffer()

template<class Type >
void s3d::Graphics2D::SetPSConstantBuffer ( uint32  slot,
const ConstantBuffer< Type > &  buffer 
)
inline

ピクセルシェーダの定数バッファを設定します。

Template Parameters
Type定数バッファの構造体
Parameters
slotスロット
buffer定数バッファ
Remarks
予約されているスロットは使用できません。詳しくはドキュメントを読んでください。

◆ SetPSTexture()

void s3d::Graphics2D::SetPSTexture ( uint32  slot,
const Optional< Texture > &  texture 
)

2D 描画のピクセルシェーダのテクスチャスロットにテクスチャをアタッチします。

Parameters
slotスロット。最大 (SamplerState::MaxSamplerCount - 1)
textureアタッチするテクスチャ。none の場合テクスチャのアタッチを解除します。

◆ SetScissorRect()

void s3d::Graphics2D::SetScissorRect ( const Rect rect)

シザー矩形を設定します。

Parameters
rectシザー矩形
Remarks
シザー矩形は RasterizerState で scissorEnable を true にすることで有効になります。

◆ SetSDFParameters()

void s3d::Graphics2D::SetSDFParameters ( const TextStyle textStyle)

SDF 描画用のパラメータを設定します。

Parameters
textStyleテキストスタイル

◆ SetVSConstantBuffer()

template<class Type >
void s3d::Graphics2D::SetVSConstantBuffer ( uint32  slot,
const ConstantBuffer< Type > &  buffer 
)
inline

頂点シェーダの定数バッファを設定します。

Template Parameters
Type定数バッファの構造体
Parameters
slotスロット
buffer定数バッファ
Remarks
予約されているスロットは使用できません。詳しくはドキュメントを読んでください。

◆ SetVSTexture()

void s3d::Graphics2D::SetVSTexture ( uint32  slot,
const Optional< Texture > &  texture 
)

2D 描画の頂点シェーダのテクスチャスロットにテクスチャをアタッチします。

Parameters
slotスロット。最大 (SamplerState::MaxSamplerCount - 1)
textureアタッチするテクスチャ。none の場合テクスチャのアタッチを解除します。