-
Notifications
You must be signed in to change notification settings - Fork 0
/
menuProcess.cpp
65 lines (45 loc) · 1.17 KB
/
menuProcess.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include "menuProcess.h"
#include <cstdio>
#include "dxfunc.h"
#include "image.h" // background
#include "mouse.h"
#include "menu.h"
#include "debug.h"
MenuProcess::MenuProcess()
: Process(new Mouse()), /*mouse(new Mouse()), */menu(new Menu())
{
g_mouse = mouse;
}
MenuProcess::~MenuProcess(){}
/*
void MenuProcess::Init(int){
// impl
return;
}
*/
void MenuProcess::Init(){
// impl
return;
}
void MenuProcess::Loop() const{
sprintf_s(debug->sz_fps, "%02.2fFPS", debug->CalcFPS());
sprintf_s(debug->sz_pxl_x, "pxl.x: %4d", mouse->get_pxloc().x);
sprintf_s(debug->sz_pxl_y, "pxl.y: %4d", mouse->get_pxloc().y);
sprintf_s(debug->sz_temp1, "%d %d", Menu::TITLE_LOC_X, Menu::TITLE_LOC_Y);
if (Device){
Device->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_ARGB(0,0,0,0), 1.0f, 0);
if (SUCCEEDED(Device->BeginScene())){
Sprite->Begin(D3DXSPRITE_ALPHABLEND);
DrawTexture(image->Background_Texture, 0, 0, 1.0f, 0.0f);
RECT rc = {0, 0, WindowWidth, WindowHeight};
debug->PrintFPS(rc);
debug->PrintValue(rc);
menu->DrawTitle();
menu->Draw();
Sprite->End();
Device->EndScene();
}
Device->Present(0, 0, 0, 0);
}
return;
}