Comments (9)
Hmm, first off - the TextureType and TextureSubmitTarget function as Int
, meaning you can use GL_TEXTURE_EXTERNAL_OES (0x8D65)
in place of a typed value as an Int and it will work just fine. Secondly, submit is only called in new, you haven't described the usage pattern enough to see the problem yet.
So if you call submit yourself with the right arguments, they don't have to be part of the enum to be passed in, what is the issue? Are you calling new
every time or something?
from alpha.
ok, I didn't investigate thoroughly before posting. Here it is "real problem"
Basically the offending code is as simple as:
renderTexture = new RenderTexture({
id: 'rt',
width: 512,
height: 512,
type: 0x8D65, // GL_TEXTURE_EXTERNAL_OES
});
In the constructor of RenderTexture, it calls submit(null)
And then fails here
Basically the options.texture == null
check is useless, because one is always created in the super()
call.
And there is no way to make it call submit with a the correct target, which is the problem.
Point 1 & 3 of OP can be mitigated by user code. But point 2 is not, as described above.
from alpha.
right so, the texture handle needs to exist, so the call to super is ok. Call submit yourself immediately after new?
from alpha.
I'm trying to understand the actual problem you see, not the conceptual issue in the code, but the side effect of it.
from alpha.
The actual problem is, write this piece of code, then it crashes.
new RenderTexture({
id: 'rt',
width: 512,
height: 512,
type: 0x8D65, // GL_TEXTURE_EXTERNAL_OES
});
from alpha.
I tidied up the submit in this branch but since I can't test it with that texture type you'll have to test
from alpha.
Sure I will test it. Thanks!
But I also wonder isn't adding a submitTarget
field to TextureOption more convenient?
from alpha.
Not really, the type is meant to be inferred from the TextureType, and TextureType is supposed to be (but isn't yet) an abstraction, which would mean that having GL concepts hardcoded in the API which I was trying to avoid
from alpha.
I tidied up the submit in this branch but since I can't test it with that texture type you'll have to test
Yes I can confirm it works now, thanks!
from alpha.
Related Issues (20)
- States: possible to accidentally run multiple states at once
- Contributing Feature/Tutorial Guides HOT 5
- Invalid Field Access HOT 35
- Position of audiohandle doesn't work on web HOT 3
- wiki HOT 4
- Right mouse button isn't working HOT 2
- Web browser that doesn't support webkit audio HOT 3
- use a custom cursor
- Shutdown fails HOT 2
- Camera; size_mode doesn't handle position offset
- Calling destroy in Entity update function crash the game HOT 4
- render; add use_device_pixels flag HOT 2
- refactor phoenix rendering
- failed compilation of sample HOT 21
- docs; update docs on website HOT 4
- Tiled Importer "Collection of Images" Tileset support
- Spine runtime integration HOT 5
- Multiple components overriding mouse events not always getting called HOT 1
- VSCode Extension HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alpha.