I make a game, and I created a separate thread for loading assets, 3d models, etc. So the UI thread will not block while it is loading. However, loading a stream requires an instance of GL10 to load and display textures correctly.
Here is an overview of the problem so that you can better understand my predicament:1. my Renderer class creates and starts the download thread.2. The boot thread loads the models and textures from the assets3. To load the textures, glGenTextures is required , but there is no GL10 instance in the load stream
I tried just providing the bootstrap with the GL10 instance specified by the Renderers onSurfaceCreated method, but it does not work. (I think it is deleted or messed up or something happens when the function is completed)
So how can I pass a working instance of GL10 to a loadable stream?
Your answer cannot.
In opengl android, the gl / context object exists only in the render loop. As far as I know, you cannot use gl functions outside this thread.
opengl - , , , - , , - , , -...
, , - , ( ...) if (- ) {...} , , , - .
iOS OSX, GL, , Android . , , . , ...
Source: https://habr.com/ru/post/1785815/More articles:How do they do it? ... avoiding the boring standard iPhone app with cookie cutter - iphoneshouldStartLoadWithRequest does not load links when clicking on UIWebView - iphonePrint or Submit iOS Icon - iosWIX XmlConfig action fails when rolling back patch - installerScript Eclipse to open a file in emacs - eclipseOptions for comet servers for rubies / rubies on rails? - ruby ββ| fooobar.comdrupal 7 Advertising (or: I donβt like the advertising module at all) - drupal-7How to list objects by extension from s3 api? - amazon-s3WxSlider floating point? - pythonJQuery Mobile: .val () not working - jqueryAll Articles