| Revision | 50634c9b24b53797489d064f9e4b39011a47ee02 (tree) |
|---|---|
| Time | 2012-11-18 23:38:25 |
| Author | shom5xg <shom@.(no...> |
| Commiter | shom5xg |
FPSカウンタ
--フォント描画は請け負わないように変更
| @@ -13,21 +13,19 @@ | ||
| 13 | 13 | |
| 14 | 14 | #ifdef _DEBUG |
| 15 | 15 | |
| 16 | -#include "core/font/font.h" | |
| 17 | - | |
| 18 | -#include "core/app.h" //g_kFps | |
| 16 | +#include "core/font/Font_Def.h" | |
| 19 | 17 | |
| 20 | 18 | |
| 21 | 19 | ///-- グローバル変数,実体定義 |
| 22 | 20 | |
| 23 | 21 | namespace |
| 24 | 22 | { |
| 25 | - u32 s_uTimeBefore = timeGetTime(); | |
| 26 | - u32 s_uCounter = 0; | |
| 23 | + u32 s_uTimeBefore = timeGetTime(); | |
| 24 | + u32 s_uCounter = 0; | |
| 27 | 25 | |
| 28 | 26 | u32 s_uFps = 0; |
| 29 | 27 | |
| 30 | - font_def::font_context_t s_FontCntext; | |
| 28 | + font_def::FontContext_t s_FontCntext; | |
| 31 | 29 | } |
| 32 | 30 | |
| 33 | 31 | ///-- |
| @@ -38,9 +36,10 @@ namespace | ||
| 38 | 36 | */ |
| 39 | 37 | void fps_counter::fps_counter_init() |
| 40 | 38 | { |
| 41 | - s_FontCntext.v2_pos = mm::get_v( 10.f, 10.f ); | |
| 42 | - s_FontCntext.v2_size = mm::get_v2_all( 20.f ); | |
| 43 | - s_FontCntext.color = COLOR_WHITE; | |
| 39 | + s_FontCntext.uPosX = 10; | |
| 40 | + s_FontCntext.uPosY = 10; | |
| 41 | + s_FontCntext.v2Size = mm::get_v2_all( 20.f ); | |
| 42 | + s_FontCntext.uColor = COLOR_WHITE; | |
| 44 | 43 | } |
| 45 | 44 | |
| 46 | 45 | /** |
| @@ -78,17 +77,9 @@ void fps_counter::fps_counter_update() | ||
| 78 | 77 | /** |
| 79 | 78 | * FPSテキスト描画 |
| 80 | 79 | */ |
| 81 | -void fps_counter::fps_counter_draw() | |
| 80 | +u32 fps_counter::fps_counter_get() | |
| 82 | 81 | { |
| 83 | -#if 0 | |
| 84 | - if( s_uFps < app::g_kFps ) | |
| 85 | - { | |
| 86 | - char szMsg[256]; | |
| 87 | - sprintf_s( szMsg, 256, "FPS:%d", s_uFps ); | |
| 88 | - | |
| 89 | - in_pFont->Draw( szMsg, s_FontCntext ); | |
| 90 | - } | |
| 91 | -#endif | |
| 82 | + return s_uFps; | |
| 92 | 83 | } |
| 93 | 84 | |
| 94 | 85 | #endif |
| @@ -15,7 +15,7 @@ namespace fps_counter | ||
| 15 | 15 | { |
| 16 | 16 | extern void fps_counter_init(); |
| 17 | 17 | extern void fps_counter_update(); |
| 18 | - extern void fps_counter_draw(); | |
| 18 | + extern u32 fps_counter_get(); | |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | #endif |