initial interface setup for platform

This commit is contained in:
amer cerkic 2019-05-02 15:50:35 -07:00
parent 06dc9fc39f
commit f09f6ebd08
8 changed files with 1069 additions and 992 deletions

View file

@ -209,7 +209,7 @@ link_hifi_libraries(
model-networking model-baker entities avatars trackers
audio audio-client animation script-engine physics
render-utils entities-renderer avatars-renderer ui qml auto-updater midi
controllers plugins image trackers
controllers plugins image trackers platform
ui-plugins display-plugins input-plugins
# Platform specific GL libraries
${PLATFORM_GL_BACKEND}

File diff suppressed because it is too large Load diff

View file

@ -79,6 +79,8 @@
#include "Sound.h"
class GLCanvas;
class FaceTracker;
class MainWindow;
@ -172,6 +174,7 @@ public:
void raise();
void showCursor(const Cursor::Icon& cursor);
void InitializePlatform();
bool isThrottleRendering() const;

View file

@ -0,0 +1,3 @@
set(TARGET_NAME platform)
setup_hifi_library()
link_hifi_libraries(shared)

View file

@ -0,0 +1,23 @@
//
// Created by Amer Cerkic 05/02/2019
// Copyright 2019 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include "WINPlatform.h"
using namespace platform;
bool WINInstance::enumerateProcessors() {
return true;
}
std::string WINInstance::getProcessor(int index) {
return "Fake processor";
}

View file

@ -0,0 +1,21 @@
//
// Created by Amer Cerkic 05/02/2019
// Copyright 2019 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#pragma once
#include "platform.h"
namespace platform {
class WINInstance : public Instance {
public:
bool enumerateProcessors();
std::string getProcessor(int index);
};
} // namespace platform

View file

@ -0,0 +1,39 @@
//
// Created by Amer Cerkic 05/02/2019
// Copyright 2019 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include "platform.h"
#include <QtGlobal>
#ifdef Q_OS_WIN
#include "WINPlatform.h"
#endif
#ifdef Q_OS_MACOS
#include "MACPlatform.h"
#endif
#ifdef Q_OS_LINUX
#endif
using namespace platform;
void platform::create() {
#ifdef Q_OS_WIN
_instance =new WINInstance();
#elif Q_OS_MAC
#endif
}
std::string platform::getProcessor(int index) {
return _instance->getProcessor(index);
}
bool platform::enumerateProcessors() {
return _instance->enumerateProcessors();
}

View file

@ -0,0 +1,33 @@
//
// Created by Amer Cerkic 05/02/2019
// Copyright 2019 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#pragma once
#include <string>
#include <vector>
namespace platform {
class Instance {
public:
std::string virtual getProcessor(int index) = 0;
bool virtual enumerateProcessors() = 0;
private:
std::vector<std::string> _processors;
};
static Instance *_instance;
void create();
std::string getProcessor(int index);
bool enumerateProcessors();
}