add shader plugin register
This commit is contained in:
parent
5ca6c19e20
commit
fe1a556ad8
@ -3,6 +3,8 @@
|
||||
|
||||
#include <QtPlugin>
|
||||
|
||||
#include "registry.h"
|
||||
|
||||
class Driver {
|
||||
|
||||
public:
|
||||
@ -12,6 +14,8 @@ public:
|
||||
virtual void invokeContextEntityMethod(int contextId, QString *method, ...) = 0;
|
||||
virtual void invokeDoricMethod(QString *method, ...) = 0;
|
||||
|
||||
virtual Registry *getRegistry() = 0;
|
||||
|
||||
virtual ~Driver() = default;
|
||||
};
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include <QDebug>
|
||||
|
||||
#include "stdarg.h"
|
||||
|
||||
#include "native_driver.h"
|
||||
@ -50,3 +52,7 @@ void NativeDriver::invokeContextEntityMethod(int contextId, QString *method, ...
|
||||
void NativeDriver::invokeDoricMethod(QString *method, ...) {
|
||||
|
||||
}
|
||||
|
||||
Registry* NativeDriver::getRegistry() {
|
||||
return jsEngine->registry;
|
||||
}
|
||||
|
@ -1,8 +1,6 @@
|
||||
#ifndef NATIVE_DRIVER_H
|
||||
#define NATIVE_DRIVER_H
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
#include "driver.h"
|
||||
#include "engine/js_engine.h"
|
||||
|
||||
@ -28,6 +26,8 @@ public:
|
||||
|
||||
void invokeContextEntityMethod(int contextId, QString *method, ...) override;
|
||||
void invokeDoricMethod(QString *method, ...) override;
|
||||
|
||||
Registry * getRegistry() override;
|
||||
};
|
||||
|
||||
#endif // NATIVE_DRIVER_H
|
||||
|
@ -7,12 +7,15 @@
|
||||
#include "native/native_empty.h"
|
||||
#include "native/native_log.h"
|
||||
#include "native/native_timer.h"
|
||||
#include "registry.h"
|
||||
|
||||
class JSEngine {
|
||||
|
||||
public:
|
||||
QJSEngine *engine = new QJSEngine();
|
||||
|
||||
Registry *registry = new Registry();
|
||||
|
||||
JSEngine();
|
||||
|
||||
void prepareContext(int contextId, QString *script);
|
||||
|
@ -8,4 +8,5 @@ Q_INVOKABLE void NativeBridge::function(int contextId, QString module, QString m
|
||||
"callbackId: " + callbackId + ", " +
|
||||
"arguments: " + jsValue.toString();
|
||||
Context *context = ContextManager::getInstance()->getContext(contextId);
|
||||
context->driver->getRegistry();
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include <QDebug>
|
||||
|
||||
#include "registry.h"
|
||||
#include "plugin/shader_plugin.h"
|
||||
|
||||
Registry::Registry() {
|
||||
registerNativePlugin(typeid(ShaderPlugin).name());
|
||||
|
@ -2,9 +2,6 @@
|
||||
#define REGISTRY_H
|
||||
|
||||
#include <QMap>
|
||||
#include <QSet>
|
||||
|
||||
#include "plugin/shader_plugin.h"
|
||||
|
||||
class Registry {
|
||||
|
||||
|
Reference in New Issue
Block a user