DriveHQ Start Menu
Cloud Drive Mapping
Folder Sync
Cloud Backup
True Drop Box
FTP/SFTP Hosting
Group Account
DriveHQ Start Menu
Online File Server
My Storage
|
Manage Shares
|
Publishes
|
Drop Boxes
|
Group Account
WebDAV Drive Mapping
Cloud Drive Home
|
WebDAV Guide
|
Drive Mapping Tool
|
Drive Mapping URL
Complete Data Backup
Backup Guide
|
Online Backup Tool
|
Cloud-to-Cloud Backup
FTP, Email & Web Service
FTP Home
|
FTP Hosting FAQ
|
Email Hosting
|
EmailManager
|
Web Hosting
Help & Resources
About
|
Enterprise Service
|
Partnership
|
Comparisons
|
Support
Quick Links
Security and Privacy
Download Software
Service Manual
Use Cases
Group Account
Online Help
Blog
Contact
Cloud Surveillance
Sign Up
Login
Features
Business Features
Online File Server
FTP Hosting
Cloud Drive Mapping
Cloud File Backup
Email Backup & Hosting
Cloud File Sharing
Folder Synchronization
Group Management
True Drop Box
Full-text Search
AD Integration/SSO
Mobile Access
IP Camera & DVR Solution
More...
Personal Features
Personal Cloud Drive
Backup All Devices
Mobile APPs
Personal Web Hosting
Sub-Account (for Kids)
Home/PC/Kids Monitoring
More...
Software
DriveHQ Drive Mapping Tool
DriveHQ FileManager
DriveHQ Online Backup
DriveHQ Mobile Apps
Pricing
Business Plans & Pricing
Personal Plans & Pricing
Price Comparison with Others
Feature Comparison with Others
Install Mobile App
Sign up
Creating account...
Invalid character in username! Only 0-9, a-z, A-Z, _, -, . allowed.
Username is required!
Invalid email address!
E-mail is required!
Password is required!
Password is invalid!
Password and confirmation do not match.
Confirm password is required!
I accept
Membership Agreement
Please read the Membership Agreement and check "I accept"!
Free Quick Sign-up
Sign-up Page
Log in
Signing in...
Username or e-mail address is required!
Password is required!
Keep me logged in
Quick Login
Forgot Password
Up
Upload
Download
Share
Publish
New Folder
New File
Copy
Cut
Delete
Paste
Rate
Upgrade
Rotate
Effect
Edit
Slide
History
#pragma once //#include "DXUT.h" #include "DarkPuzzle.h" #include "GameUI.h" #include "ScriptEngine.h" namespace DarkBattle{ //extern ScriptEngine* theScriptEngine; GameUI* GameUI::theGameUI = NULL; GameUI::GameUI(IDirect3DDevice9* pd3dDevice):GameScreen(pd3dDevice){ isEditing = false; lastElapseTime=0; dialog.Init(&resourceManager); dialog.SetCallback(GameUI::myCallback); dialog.AddStatic(0,L"FrameRate: ",10,50,200,20); dialog.AddButton(1,L"ReloadCons",10,70,100,30); dialog.AddButton(3,L"ReInit",110,70,200,30); //dialog.AddEditBox(2,L"lua code here",10,10,300,40); CDXUTIMEEditBox* pCommandEditBox; CDXUTIMEEditBox::InitDefaultElements( &dialog ); HRESULT hr = CDXUTIMEEditBox::CreateIMEEditBox(&dialog,2,L"lua code here",10,10,300,40,false,&pCommandEditBox); assert(SUCCEEDED(hr)); dialog.AddControl(pCommandEditBox); CDXUTIMEEditBox::SetImeEnableFlag( true ); //create the device resource resourceManager.OnD3D9CreateDevice(pd3dDevice); GameUI::theGameUI = this; }; void GameUI::OnFrameMove(float elapsedTime){ lastElapseTime = elapsedTime; wchar_t* buf = new wchar_t[100]; swprintf(buf,L"%f",DXUTGetFPS()); wstring str= L"Framerate: "; #ifdef _DEBUG wchar_t* buf2 = new wchar_t[100]; PROCESS_MEMORY_COUNTERS pmc; assert(GetProcessMemoryInfo(GetCurrentProcess(),&pmc,sizeof(pmc))==true); swprintf(buf2,L"%d",pmc.WorkingSetSize/1024); #endif // _DEBUG str.append(buf); #ifdef _DEBUG str.append(wstring(L" mem: ")); str.append(buf2); #endif // _DEBUG ((CDXUTStatic*)dialog.GetControl(0))->SetText(str.c_str()); SAFE_DELETE_ARRAY(buf); #ifdef _DEBUG SAFE_DELETE_ARRAY(buf2); #endif // _DEBUG }; LPSTR UnicodeToAnsi(LPCWSTR s) { if (s==NULL) return NULL; int cw=lstrlenW(s); if (cw==0) {CHAR *psz=new CHAR[1];*psz='\0';return psz;} int cc=WideCharToMultiByte(CP_ACP,0,s,cw,NULL,0,NULL,NULL); if (cc==0) return NULL; CHAR *psz=new CHAR[cc+1]; cc=WideCharToMultiByte(CP_ACP,0,s,cw,psz,cc,NULL,NULL); if (cc==0) {delete[] psz;return NULL;} psz[cc]='\0'; return psz; } VOID CALLBACK GameUI::myCallback ( UINT nEvent, int nControlID, CDXUTControl* pControl, void* pUserContext ){ if (nControlID==1){ if (nEvent==EVENT_BUTTON_CLICKED){ ScriptEngine::GetInstance()->ReLoadConstants(); } }else if (nControlID==2){ if (nEvent==EVENT_EDITBOX_STRING){ char* command = UnicodeToAnsi(((CDXUTEditBox*)pControl)->GetText()); ScriptEngine::GetInstance()->ExecuteString(command); SAFE_DELETE_ARRAY(command); GameUI::GetInstance()->isEditing = false; }else if (nEvent==EVENT_EDITBOX_CHANGE){ GameUI::GetInstance()->isEditing = true; } }else if (nControlID==3){ if (nEvent==EVENT_BUTTON_CLICKED){ ScriptEngine::GetInstance()->Initialize(); } } } GameUI* GameUI::GetInstance(){ return GameUI::theGameUI; } }
GameUI.cpp
Page URL
File URL
Prev
46/65
Next
Download
( 2 KB )
Note: The DriveHQ service banners will NOT be displayed if the file owner is a paid member.
Comments
Total ratings:
0
Average rating:
Not Rated
Would you like to comment?
Join DriveHQ
for a free account, or
Logon
if you are already a member.