2013-03-10 23:08:57 +01:00
|
|
|
// Copyright (c) 2012- PPSSPP Project.
|
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, version 2.0 or later versions.
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
// Official git repository and contact information can be found at
|
|
|
|
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
|
|
|
|
2012-11-01 16:19:01 +01:00
|
|
|
#include "../Core/Host.h"
|
2012-11-12 17:32:35 +00:00
|
|
|
#include "InputDevice.h"
|
2013-07-06 19:08:59 +02:00
|
|
|
#include "KeyboardDevice.h"
|
2012-11-12 17:32:35 +00:00
|
|
|
#include <list>
|
|
|
|
#include <memory>
|
2012-11-01 16:19:01 +01:00
|
|
|
|
2017-01-16 19:08:26 +07:00
|
|
|
extern float g_mouseDeltaX;
|
|
|
|
extern float g_mouseDeltaY;
|
2013-08-12 23:26:01 +02:00
|
|
|
|
2015-12-31 16:59:40 +01:00
|
|
|
class GraphicsContext;
|
|
|
|
|
2014-09-20 21:55:58 +02:00
|
|
|
class WindowsHost : public Host {
|
2012-11-01 16:19:01 +01:00
|
|
|
public:
|
2015-12-31 16:59:40 +01:00
|
|
|
WindowsHost(HINSTANCE hInstance, HWND mainWindow, HWND displayWindow);
|
2014-06-29 22:13:53 +02:00
|
|
|
|
2014-09-20 21:55:58 +02:00
|
|
|
~WindowsHost() {
|
2013-06-26 00:32:49 -07:00
|
|
|
UpdateConsolePosition();
|
|
|
|
}
|
|
|
|
|
2014-09-20 21:55:58 +02:00
|
|
|
void UpdateMemView() override;
|
|
|
|
void UpdateDisassembly() override;
|
|
|
|
void UpdateUI() override;
|
|
|
|
void SetDebugMode(bool mode) override;
|
|
|
|
|
2015-12-31 16:59:40 +01:00
|
|
|
// If returns false, will return a null context
|
|
|
|
bool InitGraphics(std::string *error_message, GraphicsContext **ctx) override;
|
2017-03-14 22:01:18 -07:00
|
|
|
void PollControllers() override;
|
2014-09-20 21:55:58 +02:00
|
|
|
void ShutdownGraphics() override;
|
|
|
|
|
2015-01-11 12:02:49 +01:00
|
|
|
void InitSound() override;
|
2014-09-20 21:55:58 +02:00
|
|
|
void UpdateSound() override;
|
|
|
|
void ShutdownSound() override;
|
|
|
|
|
|
|
|
bool IsDebuggingEnabled() override;
|
|
|
|
void BootDone() override;
|
|
|
|
bool AttemptLoadSymbolMap() override;
|
|
|
|
void SaveSymbolMap() override;
|
|
|
|
void SetWindowTitle(const char *message) override;
|
|
|
|
|
|
|
|
bool GPUDebuggingActive() override;
|
|
|
|
void GPUNotifyCommand(u32 pc) override;
|
|
|
|
void GPUNotifyDisplay(u32 framebuf, u32 stride, int format) override;
|
|
|
|
void GPUNotifyDraw() override;
|
|
|
|
void GPUNotifyTextureAttachment(u32 addr) override;
|
|
|
|
void ToggleDebugConsoleVisibility() override;
|
|
|
|
|
|
|
|
bool CanCreateShortcut() override;
|
|
|
|
bool CreateDesktopShortcut(std::string argumentPath, std::string title) override;
|
|
|
|
|
2016-05-27 22:00:14 -07:00
|
|
|
void NotifyUserMessage(const std::string &message, float duration = 1.0f, u32 color = 0x00FFFFFF, const char *id = nullptr) override;
|
|
|
|
|
2014-09-20 21:55:58 +02:00
|
|
|
void GoFullscreen(bool) override;
|
2013-10-13 13:24:49 -04:00
|
|
|
|
2013-07-06 19:08:59 +02:00
|
|
|
std::shared_ptr<KeyboardDevice> keyboard;
|
|
|
|
|
2015-12-31 16:59:40 +01:00
|
|
|
GraphicsContext *GetGraphicsContext() { return gfx_; }
|
|
|
|
|
2012-11-01 16:19:01 +01:00
|
|
|
private:
|
2013-06-26 00:32:49 -07:00
|
|
|
void SetConsolePosition();
|
|
|
|
void UpdateConsolePosition();
|
|
|
|
|
2015-12-31 16:59:40 +01:00
|
|
|
HINSTANCE hInstance_;
|
2014-06-29 22:13:53 +02:00
|
|
|
HWND displayWindow_;
|
|
|
|
HWND mainWindow_;
|
2015-12-31 16:59:40 +01:00
|
|
|
GraphicsContext *gfx_;
|
2013-07-06 19:08:59 +02:00
|
|
|
|
2012-11-12 17:32:35 +00:00
|
|
|
std::list<std::shared_ptr<InputDevice>> input;
|
2013-08-06 19:38:54 -04:00
|
|
|
};
|