Skip to content

Latest commit

 

History

History
78 lines (57 loc) · 2.5 KB

File metadata and controls

78 lines (57 loc) · 2.5 KB

platformize-oasis

[email protected]|[email protected] 专门适配

更加全面的适配可参考官方的适配库 oasis-engine/miniprogram-adapter 也欢迎 PR 集成到本仓库

使用

rollup.config.js注入特定配置

import { mergeRollupOptions } from 'platformize-oasis/dist-plugin';

export default mergeRollupOptions(
  {
    input: ['./miniprogram/pages/index/index.ts'],
    output: {
      format: 'cjs',
      dir: 'miniprogram/',
      entryFileNames: 'pages/[name]/[name].js',
    },
  },
  { minify: process.env.BUILD === 'production' },
);

自行组装版本见这里

import { PlatformManager, WechatPlatform } from 'platformize-oasis';

const width = canvasClientWidth;
const height = canvasClientHeight;
const wechatPlatform = new WechatPlatform(canvas, width, height);
PlatformManager.set(wechatPlatform);

window.innerWidth
window.innerHeight
window.devicePixelRatio
requestAnimationFrame();
cancelAnimationFrame();
const xhr = new XMLHttpRequest();
...等等
// 使用完毕后销毁资源
wechatPlatform.dispose();

详细例子

BUG

2022/8/6 发现微信小程序gl.texSubImage2D api有问题...目前只修复了GLTexture2D.setImageSource, setPixelBuffer依然有问题...

讨论

可通过飞书群里 DeepKolos 联系我, QQ群广告太多了

# 赞助

如果项目对您有帮助或者有适配需求,欢迎打赏

赞赏码

感谢各位支持~~