Skip to content

Commit

Permalink
状態を保存する処理を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
oigami committed Nov 14, 2016
1 parent d254ff2 commit 079555e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions EffekseerForMMD/effekseer_dll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,17 @@ namespace efk

now_present = true;

// Effekseerライブラリがリストアしてくれないので自前でバックアップしてる
float constant_data[256 * 4];
device->GetVertexShaderConstantF(0, constant_data, sizeof(constant_data) / sizeof(float) / 4);

UINT stride;
IDirect3DVertexBuffer9* stream_data;
UINT offset;
device->GetStreamSource(0, &stream_data, &offset, &stride);

IDirect3DIndexBuffer9* index_data;
device->GetIndices(&index_data);

// エフェクトの描画開始処理を行う。
if ( g_renderer->BeginRendering() )
Expand All @@ -163,6 +174,13 @@ namespace efk
g_renderer->EndRendering();
}

device->SetStreamSource(0, stream_data, offset, stride);
if ( stream_data ) stream_data->Release();

device->SetIndices(index_data);
if ( index_data ) index_data->Release();

device->SetVertexShaderConstantF(0, constant_data, sizeof(constant_data) / sizeof(float) / 4);

now_present = false;
}
Expand Down

0 comments on commit 079555e

Please sign in to comment.