I don't know what real difference between two type of using when I want to implement a class: (I run and see that they are same result)
first example: implement Renderer
directly to class.
second example: create a sub-class and make this class implements Renderer
The second that I usually meet when read document on internet/ebook. Maybe solution 2 has something more benefit that I don't know.
GLSurfaceView glView;
public class TriangleOpenGLTest implements Renderer{
public void onCreate(Bundle savedInstanceState){
glView = new GLSurfaceView(this);
glView.setRenderer(this); //this line
}
}
And:
GLSurfaceView glView;
public class TriangleOpenGLTest implements Renderer{
public void onCreate(Bundle savedInstanceState){
glView = new GLSurfaceView(this);
glView.setRenderer(new Render() ); //And this line
}
class Render() implements Renderer{
//Override function here
}
Please teach me.
thanks :)