initial work to re-implement FFI with background thread render loop
This commit is contained in:
@@ -1,53 +0,0 @@
|
||||
#ifndef UNLIT_MATERIAL_PROVIDER
|
||||
#define UNLIT_MATERIAL_PROVIDER
|
||||
|
||||
#include "material/standard.h"
|
||||
|
||||
namespace polyvox {
|
||||
class StandardMaterialProvider : public MaterialProvider {
|
||||
|
||||
const Material* _m;
|
||||
const Material* _ms[1];
|
||||
|
||||
const Engine* _engine;
|
||||
|
||||
public:
|
||||
StandardMaterialProvider(Engine* engine) {
|
||||
_engine = engine;
|
||||
_m = Material::Builder()
|
||||
.package( STANDARD_STANDARD_DATA, STANDARD_STANDARD_SIZE)
|
||||
.build(*engine);
|
||||
_ms[0] = _m;
|
||||
}
|
||||
|
||||
filament::MaterialInstance* createMaterialInstance(MaterialKey* config, UvMap* uvmap,
|
||||
const char* label = "material", const char* extras = nullptr) {
|
||||
MaterialInstance* d = (MaterialInstance*)_m->getDefaultInstance();
|
||||
return d;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a weak reference to the array of cached materials.
|
||||
*/
|
||||
const filament::Material* const* getMaterials() const noexcept {
|
||||
return _ms;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the number of cached materials.
|
||||
*/
|
||||
size_t getMaterialsCount() const noexcept {
|
||||
return (size_t)1;
|
||||
}
|
||||
|
||||
void destroyMaterials() {
|
||||
// TODO - do we need to do anything here?
|
||||
}
|
||||
|
||||
bool needsDummyData(filament::VertexAttribute attrib) const noexcept {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,12 +0,0 @@
|
||||
.global STANDARD_STANDARD_OFFSET;
|
||||
.global STANDARD_STANDARD_SIZE;
|
||||
|
||||
.global STANDARD_PACKAGE
|
||||
.section .rodata
|
||||
STANDARD_PACKAGE:
|
||||
.incbin "standard.bin"
|
||||
STANDARD_STANDARD_OFFSET:
|
||||
.int 0
|
||||
STANDARD_STANDARD_SIZE:
|
||||
.int 1031374
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
.global _STANDARD_STANDARD_OFFSET;
|
||||
.global _STANDARD_STANDARD_SIZE;
|
||||
|
||||
.global _STANDARD_PACKAGE
|
||||
.section __TEXT,__const
|
||||
_STANDARD_PACKAGE:
|
||||
.incbin "standard.bin"
|
||||
_STANDARD_STANDARD_OFFSET:
|
||||
.int 0
|
||||
_STANDARD_STANDARD_SIZE:
|
||||
.int 1031374
|
||||
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -1,13 +0,0 @@
|
||||
#ifndef STANDARD_H_
|
||||
#define STANDARD_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
extern "C" {
|
||||
extern const uint8_t STANDARD_PACKAGE[];
|
||||
extern int STANDARD_STANDARD_OFFSET;
|
||||
extern int STANDARD_STANDARD_SIZE;
|
||||
}
|
||||
#define STANDARD_STANDARD_DATA (STANDARD_PACKAGE + STANDARD_STANDARD_OFFSET)
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user