slimsallem7 / droidar

Automatically exported from code.google.com/p/droidar
0 stars 0 forks source link

Use GL View using xml layouts #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi!

I think that if you want to use the xml layout, you should add this constructor 
to the CustomGLSurfaceView class, if no it will not compile

public CustomGLSurfaceView(Context context, AttributeSet attrs) {
        super(context, attrs);
        if (DEBUG_OUTPUT_ENABLED) {
            // Turn on error-checking and logging
            setDebugFlags(DEBUG_CHECK_GL_ERROR | DEBUG_LOG_GL_CALLS);
        }
        this.setFocusableInTouchMode(true);
        myGestureDetector = new GestureDetector(context,
                new CustomGestureListener(this));
    }

Original issue reported on code.google.com by joanpuig...@gmail.com on 15 May 2011 at 12:20

GoogleCodeExporter commented 9 years ago
I added the constructor, but i'm not sure what it is good for, can you explain 
it a little bit more in detail? the AttributeSet parameter is always needed if 
you define a view in xml?

Original comment by simon.heinen on 27 May 2011 at 8:12

GoogleCodeExporter commented 9 years ago

Original comment by Alexande...@gmail.com on 31 May 2011 at 6:33

GoogleCodeExporter commented 9 years ago
I know that if you whant to add this view using the xml files, android will 
call this method

Original comment by joanpuig...@gmail.com on 4 Jun 2011 at 9:57

GoogleCodeExporter commented 9 years ago
For the CameraView too:

public CameraView(Context context, AttributeSet attrs) {
        super(context, attrs);
        intiCameraView(context);

    }

    private void intiCameraView(Context context) {
        mHolder = getHolder();
        Log.d("Activity", "Camera holder created");
        mHolder.addCallback(this);
        mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
    }

Original comment by joanpuig...@gmail.com on 13 Jun 2011 at 5:05