Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 73: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 74: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 75: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 76: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 77: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 78: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; import android.app.Activity; import android.opengl.GLU; import android.os.Bundle; /* imports for creating a SurfaceView */ import android.content.Context; import android.graphics.OpenGLContext; import android.view.SurfaceHolder; import android.view.SurfaceView; import javax.microedition.khronos.opengles.GL10; public class SquareActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(new DrawingSurfaceView(this)); } class DrawingSurfaceView extends SurfaceView implements SurfaceHolder.Callback { // this handles all the creation, destruction, etc. for getting a surface // and it does so asynchronously public SurfaceHolder mHolder; private OpenGLContext glc; // this thread will do the actual drawing public DrawingThread mThread; public DrawingSurfaceView(Context c) { super(c); init(); } public void init() { // This is defined in the Android Library mHolder = getHolder(); // by registering as a call back, we receive events from the SurfaceHolder // notifying us when a new surface is ready, or if the surface we were using was destroyed mHolder.addCallback(this); } public void surfaceCreated(SurfaceHolder holder) { // We have a new surface, so start a thread that will draw to it mThread = new DrawingThread(); mThread.start(); } public void surfaceDestroyed(SurfaceHolder holder) { // Our surface was destroyed, stop the thread drawing to it mThread.waitForExit(); mThread = null; } public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) { // The surface layout has changed // So change the size of our output window mThread.onWindowResize(w, h); } // Define the thread that will run to actually do the drawing on a surface class DrawingThread extends Thread { boolean stop; int w; int h; DrawingThread() { super(); stop = false; w = 0; h = 0; } @Override public void run() { // create a new opengl context OpenGLContext glc = new OpenGLContext( OpenGLContext.DEPTH_BUFFER ); // grab a reference to our parent's surface handle. SurfaceHolder holder = mHolder; // then assign the context to the parent's surface glc.makeCurrent(holder); // now grab in interface to opengl GL10 gl = (GL10)(glc.getGL()); // now set any other one-time settings for this context gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_FASTEST); // now draw forever until asked to stop while( ! stop ) { int W, H; // copies of the current width and height synchronized(this) { W = this.w; H = this.h; } drawFrame(gl, W, H); glc.post(); } // if we've been asked to stop // remove the reference to the surface glc.makeCurrent((SurfaceHolder)null); } // when a window is resized, adjust the size of the output public void onWindowResize(int w, int h) { synchronized(this) { this.w = w; this.h = h; } } public void waitForExit() { stop = true; try { join(); } catch (InterruptedException ex) { } } private void drawFrame(GL10 gl, int w, int h) { // do whatever drawing here. gl.glViewport(0, 0, w, h); /* * Set our projection matrix. This doesn't have to be done * each time we draw, but usualy a new projection needs to be set * when the viewport is resized. */ float ratio = (float)w / h; gl.glMatrixMode(GL10.GL_PROJECTION); gl.glLoadIdentity(); gl.glFrustumf(-ratio, ratio, -1, 1, 1, 10); /* * By default, OpenGL enables features that improve quality * but reduce performance. One might want to tweak that * especially on software renderer. */ /* * Usually, the first thing one might want to do is to clear * the screen. */ gl.glClearColor(1,1,1,1); // set the backgroudn to white gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); // start drawing float[] square = new float[] { 0.25f, 0.25f, 0.0f, 0.75f, 0.25f, 0.0f, 0.25f, 0.75f, 0.0f, 0.75f, 0.75f, 0.0f }; FloatBuffer squareBuff; ByteBuffer bb = ByteBuffer.allocateDirect(square.length*4); bb.order(ByteOrder.nativeOrder()); squareBuff = bb.asFloatBuffer(); squareBuff.put(square); squareBuff.position(0); gl.glMatrixMode(GL10.GL_PROJECTION); gl.glLoadIdentity(); GLU.gluOrtho2D(gl, 0.0f,1.2f,0.0f,1.0f); gl.glVertexPointer(3, GL10.GL_FLOAT, 0, squareBuff); gl.glEnableClientState(GL10.GL_VERTEX_ARRAY); gl.glClear(GL10.GL_COLOR_BUFFER_BIT); gl.glColor4f(0,1,1,1); gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4); glc.waitGL(); } } } }