I am trying to call a method that is outside the classroom, I work with an open GL thread But I can not create a The program breaks @ heading in the thread which is not called Looper.prepare (). Runtime exceptions do anyone have a way to do this without putting the method in the same class Know the way Remove cam = Remove new ();
Draft on Public Zero (GL 10GL) {onDrawFrameCounter ++; Gl.glEnable (GL10.GL_TEXTURE_2D); Gl.glClear (GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); BindCameraTexture (GL); Println (Global.bearing); Float beer = global. Bearing; Gl.glLoadIdentity (); Gl.glNormal3f (0,0,1); System.out.println ("ARRAY!:" + GLCamTest.array.length); P = 0; Gl.glRotatef (bear, 1, 0, 0); Int q = 0; Int E = 0; If (q & lt; globalcube) {remove cam = new remove (); Bitmap image = cam.extractimage (q); Final integer TILE_WIDTH = 512; Final integer TILE_HEIGHT = 512; Final integer TILE_SIZE = TILE_WIDTH * TILE_HEIGHT; Int [] Pixel = new int [TILE_WIDTH]; Small [] RGB565 = new low [TILE_SIZE]; // Convert 8888 to 565, and the status of swap red and green channel: int i = 0; For (int y = 0; y & lt; TILE_HEIGHT; y ++) {image.getPixels (pixels, 0, TILE_WIDTH, 0, y, TILE_WIDTH, 1); For (int x = 0; x & lt; TILE_WIDTH; x ++) {int argb = pixels [x]; Int r = 0x1f & amp; (Argb>> 19;); // 23 to 12 bits .. 19 inch G = 0x3 F & amp; (Argb> 10); // 6 bits to 15..10 int b = 0x1f & amp; (Argob & gt; & gt; 3); Take 7 to 5 bits. 3 int RGB = (R & lt; <11). (G & LT; <5). B; Rgb_565 [i] = (small) RGB; ++ i; }} Shortbuffer Texture Buffer = Shortbuffer.Wap (RGB565, 0, TIELEISGEEG); Gl.glTexImage2D (GL10.GL_TEXTURE_2D, 0, GL10.GL_RGB, 48, 48, 0, GL 10.GL_RGB, GL10.GL_UNSIGNED_SHORT_5_6_5, Texturebuffer); Gl.glDrawArrays (GL10.GL_TRIANGLE_STRIP, E, 4); E = E + 4; Gl.glDrawArrays (GL10.GL_TRIANGLE_STRIP, E, 4); E = E + 4; Gl.glDrawArrays (GL10.GL_TRIANGLE_STRIP, E, 4); E = E + 4; Gl.glDrawArrays (GL10.GL_TRIANGLE_STRIP, E, 4); E = E + 4; Gl.glDrawArrays (GL10.GL_TRIANGLE_STRIP, E, 4); E = E + 4; Gl.glDrawArrays (GL10.GL_TRIANGLE_STRIP, E, 4); E = E + 4; Q ++; }}
The error indicates that you are calling some code to call Expects UI threads, but not. GL is not called from the UI thread at Dredfraem, so error.
The code is being done in this extract class constructor. What is the class full name?
Believing the extract method, an image loads or similar from the camera. I am "extracting" from the global thread, this code has to be forwarded, you probably want to limit your FPS by doing this conversion on the GL thread :-) It's doing "as fast as possible" on a different thread , And draw the latest GL.
If you need to make this work here, use it.
Comments
Post a Comment