OROCHI
 
Loading...
Searching...
No Matches
GxPrimitiveManager Class Reference

プリミティブの描画発行単位を管理します。 More...

#include <GxPrimitiveManager.h>

Inheritance diagram for GxPrimitiveManager:
Collaboration diagram for GxPrimitiveManager:

Classes

struct  GxCommandClear
 画面クリアコマンド More...
 
struct  GxCommandCopyRenderTargetToTexture
 レンダーターゲットをテクスチャにコピーするコマンド More...
 
struct  GxCommandDraw
 描画コマンド(アライメントの関係で、サイズは16の倍数である必要がある!) More...
 
struct  GxCommandSetRenderTarget
 レンダーターゲット設定コマンド More...
 
struct  GxCommandSetScissor
 シザリング矩形設定コマンド More...
 
struct  GxCommandSetScreenSize
 スクリーンサイズ設定コマンド More...
 
struct  GxCustomShaderCallbackParam
 カスタムシェーダコールバックパラメータ More...
 
struct  GxPacket
 描画パケット More...
 

Public Member Functions

初期化
 GxPrimitiveManager (void)
 デフォルトコンストラクタ
 
virtual b32 initialize (GxAllocator *pAllocator, u32 commandBufferSize, u32 vertexBufferSize, u32 indexBufferSize, RENDER_TYPE type, u32 maxProjection2DId, b32 use32bitIndex=false)
 初期化関数
 
void terminate (void)
 終了関数
 
- Public Member Functions inherited from GxClassBase
constexpr GxClassBase (void)
 コンストラクタ
 
constexpr GxClassBase (const GxClassBase &base)
 コピーコンストラクタ
 
 ~GxClassBase (void) override
 デストラクタ
 
- Public Member Functions inherited from GxClassBaseRoot
constexpr GxClassBaseRoot (void)
 コンストラクタ
 
constexpr GxClassBaseRoot (const GxClassBaseRoot &)
 コピーコンストラクタ
 
virtual ~GxClassBaseRoot (void)
 デストラクタ
 
constexpr GxClassBaseRootoperator= (const GxClassBaseRoot &)
 代入演算子
 
virtual GxRttigetRtti (void) const =0
 Rttiの取得
 
virtual GX_FORCE_INLINE const GxTypedObjectgetDefaultObject (void)
 デフォルトオブジェクトを取得
 
GX_FORCE_INLINE b32 isDefaultObject (void)
 デフォルトオブジェクト判定
 

定義

enum class  RENDER_TYPE { _2D , _3D , _2D_VIRTUAL }
 描画タイプ More...
 
enum class  COMMAND_TYPE {
  NOP , SET_SCREEN_SIZE , SET_SCISSOR_RECT , SET_RENDER_TARGET ,
  COPY_RENDER_TARGET_TO_TEXTURE , CLEAR , LINELIST_2D , LINESTRIP_2D ,
  TRIANGLELIST_2D , TRIANGLESTRIP_2D , TRIANGLEFAN_2D , QUADLIST_2D ,
  LINELIST_3D , LINESTRIP_3D , TRIANGLELIST_3D , TRIANGLESTRIP_3D ,
  TRIANGLEFAN_3D , QUADLIST_3D , CUSTOM_2D , CUSTOM_3D ,
  MAX
}
 コマンドタイプ More...
 
class GxPrimitiveContext
 
static constexpr u32 DRAW_LIST_MAX_VERTEX_NUM = GxMath::VALUE_1K
 drawXXYYList() 系で確保できる最大頂点数
 
GX_ALIGN16_BEGIN struct GxPrimitiveManager::GxCommandDraw GX_ALIGN16_END
 
GX_ALIGN16_BEGIN struct GxPrimitiveManager::GxCommandSetScreenSize GX_ALIGN16_END
 
GX_ALIGN16_BEGIN struct GxPrimitiveManager::GxCommandSetScissor GX_ALIGN16_END
 
GX_ALIGN16_BEGIN struct GxPrimitiveManager::GxCommandSetRenderTarget GX_ALIGN16_END
 
GX_ALIGN16_BEGIN struct GxPrimitiveManager::GxCommandCopyRenderTargetToTexture GX_ALIGN16_END
 
GX_ALIGN16_BEGIN struct GxPrimitiveManager::GxCommandClear GX_ALIGN16_END
 
GX_ALIGN16_BEGIN struct GxPrimitiveManager::GxPacket GX_ALIGN16_END
 

操作

void begin (void)
 パケット収集開始
 
constexpr void end (void)
 パケット収集完了
 
void beginRender (b32 isSort)
 描画開始
 
void render (GxRect *pRect=nullptr)
 描画実行
 
void endRender (void)
 描画終了
 

アクセサ

GxPrimitiveContextgetContext (u32 index)
 コンテキストを取得する
 
GX_FORCE_INLINE b32 isRenderType (RENDER_TYPE type) const
 描画タイプを判定
 
void setProjectionMatrix2D (u32 projectionId, const GxMatrix44 &matrix)
 2Dプリミティブの射影行列を設定する
 
const GxMatrix44getProjectionMatrix2D (u32 projectionId) const
 2Dプリミティブの射影行列を取得する
 
u32 allocateProjectionMatrix2DId (void)
 2Dプリミティブの射影行列のIDを予約する
 
void freeProjectionMatrix2DId (u32 projectionId)
 2Dプリミティブの射影行列のIDを返却する
 
GX_FORCE_INLINE const GxPoint2getOutputOffset2D (void) const
 2Dプリミティブ全体の位置オフセットを取得
 
GX_FORCE_INLINE void setOutputOffset2D (const GxPoint2 &offset)
 2Dプリミティブ全体の位置オフセットを設定
 
constexpr void setDefaultRenderTarget (GxRenderTexture *pRenderTarget, GxRenderTexture *pDepth)
 
static void setCustomShaderCallback (const GxCallback::GxHandlerBase &handler)
 カスタムシェーダコールバックの設定
 

Additional Inherited Members

- Static Public Member Functions inherited from GxClassBaseRoot
static GX_FORCE_INLINE GxRtti__getStaticRtti (void)
 Rttiの取得
 

Detailed Description

プリミティブの描画発行単位を管理します。

プリミティブマネージャクラス

Member Enumeration Documentation

◆ COMMAND_TYPE

enum class GxPrimitiveManager::COMMAND_TYPE
strongprotected

コマンドタイプ

Enumerator
NOP 

NOP.

SET_SCREEN_SIZE 

スクリーンサイズ設定

SET_SCISSOR_RECT 

シザリング矩形設定

SET_RENDER_TARGET 

レンダーターゲット設定

COPY_RENDER_TARGET_TO_TEXTURE 

レンダーターゲットをテクスチャにコピー

CLEAR 

画面クリア

LINELIST_2D 

2Dラインリスト

LINESTRIP_2D 

2Dラインストリップ

TRIANGLELIST_2D 

2Dトライアングルリスト

TRIANGLESTRIP_2D 

2Dトライアングルストリップ

TRIANGLEFAN_2D 

2Dトライアングルファン

QUADLIST_2D 

2Dクアッドリスト

LINELIST_3D 

3Dラインリスト

LINESTRIP_3D 

3Dラインストリップ

TRIANGLELIST_3D 

3Dトライアングルリスト

TRIANGLESTRIP_3D 

3Dトライアングルストリップ

TRIANGLEFAN_3D 

3Dトライアングルファン

QUADLIST_3D 

3Dクアッドリスト

CUSTOM_2D 

2Dカスタム

CUSTOM_3D 

3Dカスタム

MAX 

定義数

◆ RENDER_TYPE

描画タイプ

Enumerator
_2D 

2D描画

_3D 

3D描画

_2D_VIRTUAL 

2D仮想解像度描画

Member Function Documentation

◆ allocateProjectionMatrix2DId()

u32 GxPrimitiveManager::allocateProjectionMatrix2DId ( void )

2Dプリミティブの射影行列のIDを予約する

2Dプリミティブの射影行列のインデックスを予約

Returns
利用可能なインデックス
Here is the call graph for this function:
Here is the caller graph for this function:

◆ beginRender()

void GxPrimitiveManager::beginRender ( b32 isSort)

描画開始

Parameters
isSort[in] ソートを行うならtrue
Here is the caller graph for this function:

◆ freeProjectionMatrix2DId()

void GxPrimitiveManager::freeProjectionMatrix2DId ( u32 projectionId)

2Dプリミティブの射影行列のIDを返却する

2Dプリミティブの射影行列のインデックスを返却する

Parameters
projectionId[in] バッファのインデックス1以上 (0はデフォルトでスクリーンスペース)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getContext()

GxPrimitiveContext * GxPrimitiveManager::getContext ( u32 index)

コンテキストを取得する

Parameters
index[in] ワーカースレッドインデックス
Returns
コンテキスト
Here is the caller graph for this function:

◆ getProjectionMatrix2D()

const GxMatrix44 & GxPrimitiveManager::getProjectionMatrix2D ( u32 projectionId) const

2Dプリミティブの射影行列を取得する

2Dプリミティブの射影行列を取得

Parameters
projectionId[in] バッファのID0以上 (0はデフォルトでスクリーンスペース)
Returns
射影行列
Here is the caller graph for this function:

◆ initialize()

b32 GxPrimitiveManager::initialize ( GxAllocator * pAllocator,
u32 commandBufferSize,
u32 vertexBufferSize,
u32 indexBufferSize,
RENDER_TYPE type,
u32 maxProjection2DId,
b32 use32bitIndex = false )
virtual

初期化関数

Parameters
pAllocator[in] アロケータ
commandBufferSize[in] コマンドバッファサイズ
vertexBufferSize[in] 頂点バッファサイズ
indexBufferSize[in] インデックスバッファサイズ
type[in] 描画タイプ(2D or 3D)
maxProjection2DId[in] 射影行列の最大数
use32bitIndex[in] 32ビットインデックスを使うならtrue
Returns
成功ならtrue
Here is the call graph for this function:
Here is the caller graph for this function:

◆ render()

void GxPrimitiveManager::render ( GxRect * pRect = nullptr)

描画実行

Parameters
pRect[in] 描画枠
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setCustomShaderCallback()

void GxPrimitiveManager::setCustomShaderCallback ( const GxCallback::GxHandlerBase & handler)
static

カスタムシェーダコールバックの設定

Parameters
callback[in] コールバックハンドラ
Here is the caller graph for this function:

◆ setDefaultRenderTarget()

void GxPrimitiveManager::setDefaultRenderTarget ( GxRenderTexture * pRenderTarget,
GxRenderTexture * pDepth )
inlineconstexpr

Custom 描画でレンダーターゲットが切り替えられた場合、元に戻すため記録しておく。 これが描画先に設定されるわけではない。

Here is the caller graph for this function:

◆ setProjectionMatrix2D()

void GxPrimitiveManager::setProjectionMatrix2D ( u32 projectionId,
const GxMatrix44 & matrix )

2Dプリミティブの射影行列を設定する

2Dプリミティブの射影行列を設定

Parameters
projectionId[in] バッファのID1以上 (0はデフォルトでスクリーンスペース)
matrix[in] 射影行列
Here is the caller graph for this function:

The documentation for this class was generated from the following files: