-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ada646a
commit b8a49d8
Showing
14 changed files
with
303 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ enum class WindowSystemType | |
Wayland, | ||
FBDev, | ||
Haiku, | ||
DRM, | ||
}; | ||
|
||
struct WindowSystemInfo | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// Copyright 2018 Dolphin Emulator Project | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
#include <unistd.h> | ||
|
||
#include "DolphinNoGUI/Platform.h" | ||
|
||
#include "Common/MsgHandler.h" | ||
#include "Core/ConfigManager.h" | ||
#include "Core/Core.h" | ||
#include "Core/State.h" | ||
#include "Core/System.h" | ||
|
||
#include <climits> | ||
#include <cstdio> | ||
#include <thread> | ||
|
||
#include <fcntl.h> | ||
#include <sys/types.h> | ||
|
||
namespace | ||
{ | ||
class PlatformDRM : public Platform | ||
{ | ||
public: | ||
void SetTitle(const std::string& string) override; | ||
void MainLoop() override; | ||
|
||
WindowSystemInfo GetWindowSystemInfo() const override; | ||
}; | ||
|
||
void PlatformDRM::SetTitle(const std::string& string) | ||
{ | ||
std::fprintf(stdout, "%s\n", string.c_str()); | ||
} | ||
|
||
void PlatformDRM::MainLoop() | ||
{ | ||
while (IsRunning()) | ||
{ | ||
UpdateRunningFlag(); | ||
Core::HostDispatchJobs(Core::System::GetInstance()); | ||
|
||
// TODO: Is this sleep appropriate? | ||
std::this_thread::sleep_for(std::chrono::milliseconds(1)); | ||
} | ||
} | ||
|
||
WindowSystemInfo PlatformDRM::GetWindowSystemInfo() const | ||
{ | ||
WindowSystemInfo wsi; | ||
wsi.type = WindowSystemType::DRM; | ||
wsi.display_connection = nullptr; // EGL_DEFAULT_DISPLAY | ||
wsi.render_window = nullptr; | ||
wsi.render_surface = nullptr; | ||
return wsi; | ||
} | ||
} // namespace | ||
|
||
std::unique_ptr<Platform> Platform::CreateDRMPlatform() | ||
{ | ||
return std::make_unique<PlatformDRM>(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.