Показать сообщение отдельно

  #7  
Старый 07.09.2015, 21:49
Woofing Giraffe
Постоянный
Регистрация: 14.06.2015
Сообщений: 402
С нами: 5744580

Репутация: 28
По умолчанию

Цитата:
Сообщение от KYRLYK  

C++:





Код:
bool
CALLBACK
Present
(
CONST RECT
*
pSourceRect
,
CONST RECT
*
pDestRect
,
HWND hDestWindowOverride
,
CONST RGNDATA
*
pDirtyRegion
)
{
if
(
SUCCEEDED
(
SF
->
getRender
(
)
->
BeginRender
(
)
)
)
{
stFontInfo
*
pFont
;
SF
->
getRender
(
)
->
registerD3DCallback
(
eDirect3DDeviceMethods
::
D3DMETHOD_PRESENT
,
Present
)
;
pFont
=
SF
->
getRender
(
)
->
CreateNewFont
(
"Tahoma"
,
12
,
FCR_BORDER
)
;
pFont
->
Print
(
"10%"
,
D3DCOLOR_ARGB
(
255
,
255
,
255
,
0
)
,
500
,
500
,
false
)
;
pFont
->
Print
(
"20%"
,
D3DCOLOR_ARGB
(
255
,
255
,
255
,
0
)
,
500
,
500
,
false
)
;
pFont
->
Print
(
"30%"
,
D3DCOLOR_ARGB
(
255
,
255
,
255
,
0
)
,
500
,
500
,
false
)
;
pFont
->
Print
(
"40%"
,
D3DCOLOR_ARGB
(
255
,
255
,
255
,
0
)
,
500
,
500
,
false
)
;
pFont
->
Print
(
"50%"
,
D3DCOLOR_ARGB
(
255
,
255
,
255
,
0
)
,
500
,
500
,
false
)
;
pFont
->
Print
(
"60%"
,
D3DCOLOR_ARGB
(
255
,
255
,
255
,
0
)
,
500
,
500
,
false
)
;
pFont
->
Print
(
"70%"
,
D3DCOLOR_ARGB
(
255
,
255
,
255
,
0
)
,
500
,
500
,
false
)
;
pFont
->
Print
(
"80%"
,
D3DCOLOR_ARGB
(
255
,
255
,
255
,
0
)
,
500
,
500
,
false
)
;
pFont
->
Print
(
"90%"
,
D3DCOLOR_ARGB
(
255
,
255
,
255
,
0
)
,
500
,
500
,
false
)
;
pFont
->
Print
(
"100%"
,
D3DCOLOR_ARGB
(
255
,
255
,
255
,
0
)
,
500
,
500
,
false
)
;
pFont
->
Print
(
" Loaded!"
,
D3DCOLOR_ARGB
(
255
,
255
,
255
,
0
)
,
500
,
500
,
false
)
;
SF
->
getRender
(
)
->
EndRender
(
)
;
}
;
return
true
;
}
;
void
CALLBACK
mainloop
(
)
{
и
.
т
.
д
}


Чёт не так значит.
Код:





Код:
pFont = SF->getRender()->CreateNewFont("Tahoma", 12, FCR_BORDER);


Вот твоя ошибка. Этот callback является циклом, который выполняется несколько раз в секунду, а ты в нем регистрируешь новый шрифт. Поэтому и не запускается. Регистрируй в mainloop.

Цитата:
Сообщение от Спойлер  

//================================================== ================================================== =========

Код:





Код:
stFontInfo *pFont;


это после инклюдов пихаешь,

Код:





Код:
bool CALLBACK Present(CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion)
{
    if (SUCCEEDED(SF->getRender()->BeginRender()))
    {    
        pFont->Print("10%", D3DCOLOR_ARGB(255, 255, 255, 0), 500, 500, false);
        pFont->Print("20%", D3DCOLOR_ARGB(255, 255, 255, 0), 500, 500, false);
        pFont->Print("30%", D3DCOLOR_ARGB(255, 255, 255, 0), 500, 500, false);
        pFont->Print("40%", D3DCOLOR_ARGB(255, 255, 255, 0), 500, 500, false);
        pFont->Print("50%", D3DCOLOR_ARGB(255, 255, 255, 0), 500, 500, false);
        pFont->Print("60%", D3DCOLOR_ARGB(255, 255, 255, 0), 500, 500, false);
        pFont->Print("70%", D3DCOLOR_ARGB(255, 255, 255, 0), 500, 500, false);
        pFont->Print("80%", D3DCOLOR_ARGB(255, 255, 255, 0), 500, 500, false);
        pFont->Print("90%", D3DCOLOR_ARGB(255, 255, 255, 0), 500, 500, false);
        pFont->Print("100%", D3DCOLOR_ARGB(255, 255, 255, 0), 500, 500, false);
        pFont->Print(" Loaded!", D3DCOLOR_ARGB(255, 255, 255, 0), 500, 500, false);
        SF->getRender()->EndRender();
    };
    return true;
};


Это куда тебе надо.

Код:





Код:
SF->getRender()->registerD3DCallback(eDirect3DDeviceMethods::D3DMETHOD_PRESENT, Present);
        pFont = SF->getRender()->CreateNewFont("Tahoma", 12, FCR_BORDER);


А это в мэйн. У меня работает.
 
Ответить с цитированием