Original Post
So I decided to use FW1FontWrapper for showing some text in my small game.
The function:
[source lang="cpp"]void drawText(ID3D11Device *pDevice, ID3D11DeviceContext *pContext) {
IFW1Factory *pFW1Factory;
HRESULT hResult = FW1CreateFactory(FW1_VERSION, &pFW1Factory);
IFW1FontWrapper *pFontWrapper;
hResult = pFW1Factory->CreateFontWrapper(pDevice, L"Arial", &pFontWrapper);
pFontWrapper->DrawString(
pContext,
L"Text",// String
12.0f,// Font size
100.0f,// X position
50.0f,// Y position
0xff0099ff,// Text color, 0xAaBbGgRr
0// Flags
);
pFontWrapper->Release();
pFW1Factory->Release();
}[/source]
That function gets called every time a frame is being draw!
My game usually runs at 300+ fps,with that function being called every time a frame is being draw it gets down to 3-4FPS!
Any solution?
The function:
[source lang="cpp"]void drawText(ID3D11Device *pDevice, ID3D11DeviceContext *pContext) {
IFW1Factory *pFW1Factory;
HRESULT hResult = FW1CreateFactory(FW1_VERSION, &pFW1Factory);
IFW1FontWrapper *pFontWrapper;
hResult = pFW1Factory->CreateFontWrapper(pDevice, L"Arial", &pFontWrapper);
pFontWrapper->DrawString(
pContext,
L"Text",// String
12.0f,// Font size
100.0f,// X position
50.0f,// Y position
0xff0099ff,// Text color, 0xAaBbGgRr
0// Flags
);
pFontWrapper->Release();
pFW1Factory->Release();
}[/source]
That function gets called every time a frame is being draw!
My game usually runs at 300+ fps,with that function being called every time a frame is being draw it gets down to 3-4FPS!
Any solution?