Springhead Users Manual

8.10 レンダラ

レンダラの機能を項目別に説明します. レンダラは提供するプリミティブな描画機能は非常に多岐に渡りますが,これらのほとんどの関数は特別な描画処理を必要としない限りユーザが直接呼び出すことはありません. 個々の関数を詳しく説明していくと膨大な量になり ますので,ここでは一覧程度にとどめます. 詳細な仕様はソースコードのコメントを参照してください.

基本機能

描画時のお決まりの処理です. 8.3節を参照してください.

GRRenderIf

void

GetClearColor(Vec4f&)

背景色の取得

void

SetClearColor(const Vec4f&)

背景色の設定

void

ClearBuffer()

描画バッファをクリア

void

BeginScene()

描画の開始

void

EndScene()

描画の完了

void

SwapBuffers()

描画バッファのスワップ

ディスプレイリスト

ディスプレイリストに関係する機能です. GRMeshが内部で使用します.

GRRenderIf

int

StartList()

ディスプレイリスト作成開始

void

EndList()

ディスプレイリスト作成完了

void

DrawList(int)

ディスプレイリストの描画

void

ReleaseList(int)

ディスプレイリストの解放

デプステスト,アルファブレンディング,ライティング

描画機能を切り替えるための関数です.

GRRenderIf

void

SetDepthWrite(bool)

デプスバッファへの書き込みOn/Off

void

SetDepthTest(bool)

デプステストのOn/Off

void

SetDepthFunc(TDepthFunc)

デプスバッファの判定条件

void

SetAlphaTest(bool)

アルファブレンディングのOn/Off

void

SetAlphaMode(TBlendFunc, TBlendFunc)

アルファブレンディングのモード

void

SetLighting(bool)

ライティングのOn/Off

テクスチャ

GRRenderIf

int

LoadTexture(UTString)

テクスチャのロード

void

SetTextureImage(UTString, int, int, int, int, char*)

テクスチャの設定

シェーダ

GRRenderIf

void

InitShader()

シェーダの初期化

void

SetShaderFormat(ShaderType)

シェーダフォーマットの設定

bool

CreateShader(UTString, UTString, GRHandler&)

シェーダオブジェクトの作成

GRHandler

CreateShader()

シェーダオブジェクトの作成

bool

ReadShaderSource(GRHandler, UTString)

シェーダプログラムをロード

void

GetShaderLocation(GRHandler, void*)

ロケーション情報の取得

直接描画

GRRenderIf

void

SetVertexFormat(const GRVertexElement*)

頂点フォーマットの指定

void

SetVertexShader(void*)

頂点シェーダーの指定

void

DrawDirect(TPrimitiveType, void*, size_t, size_t)

頂点を指定してプリミティブを描画

void

DrawIndexed(TPrimitiveType, size_t*, void*, size_t, size_t)

頂点とインデックスを指定してプリミティブを描画

void

DrawArrays(TPrimitiveType, GRVertexArray*, size_t)

頂点の成分ごとの配列を指定して,プリミティブを描画

void

DrawArrays(TPrimitiveType, size_t*, GRVertexArray*, size_t)

インデックスと頂点の成分ごとの配列を指定して,プリミティブを描画

基本形状描画

GRRenderIf

void

DrawLine(Vec3f, Vec3f)

線分を描画

void

DrawArrow(Vec3f, Vec3f, float, float, float, int, bool)

矢印を描画

void

DrawBox(float, float, float, bool)

直方体を描画

void

DrawSphere(float, int, int, bool)

球体を描画

void

DrawCone(float, float, int, bool)

円錐の描画

void

DrawCylinder(float, float, int, bool)

円筒の描画

void

DrawCapsule(float, float, int, bool)

カプセルの描画

void

DrawRoundCone(float, float, float, int, bool)

球円錐の描画

void

DrawGrid(float, int, float)

グリッドを描画

void

SetFont(const GRFont&)

フォントの設定

void

DrawFont(Vec2f, UTString)

2次元テキストの描画

void

DrawFont(Vec3f, UTString)

3次元テキストの描画

void

SetLineWidth(float)

線の太さの設定

カメラ

GRRenderIf

void

SetCamera(const GRCameraDesc&)

カメラの設定

const GRCameraDesc&

GetCamera()

カメラの取得

ライト

GRRenderIf

void

PushLight(const GRLightDesc&)

ライトをプッシュ

void

PushLight(const GRLightIf*)

ライトをプッシュ

void

PopLight()

ライトをポップ

int

NLights()

ライトの数

座標変換

GRRenderIf

void

Reshape(Vec2f, Vec2f)

ウィンドウサイズの変更

void

SetViewport(Vec2f, Vec2f)

ビューポートの設定

Vec2f

GetViewportPos()

ビューポート原点の取得

Vec2f

GetViewportSize()

ビューポートサイズの取得

Vec2f

GetPixelSize()

1ピクセルの物理サイズを取得

Vec3f

ScreenToCamera(int, int, float, bool)

スクリーン座標からカメラ座標への変換

void

EnterScreenCoordinate()

スクリーン座標系へ切り替える

void

LeaveScreenCoordinate()

スクリーン座標系から戻る

GRRenderIf

void

SetViewMatrix(const Affinef&)

視点行列の設定

void

GetViewMatrix(Affinef&)

視点行列の取得

void

SetProjectionMatrix(const Affinef&)

投影行列の設定

void

GetProjectionMatrix(Affinef&)

投影行列の取得

void

SetModelMatrix(const Affinef&)

モデル行列の設定

void

GetModelMatrix(Affinef&)

モデル行列の取得

void

MultModelMatrix(const Affinef&)

モデル行列に変換をかける

void

PushModelMatrix()

モデル行列をプッシュ

void

PopModelMatrix()

モデル行列をポップ

void

ClearBlendMatrix()

ブレンド変換行列のクリア

bool

SetBlendMatrix(const Affinef&, int)

ブレンド変換行列の設定