using JMCVideo in 2nd OPENGL screen
in
Contributed Library Questions
•
2 years ago
hi
i want to use the JMCVIDEO library into an other screen. How can i do this?
script:
i want to use the JMCVIDEO library into an other screen. How can i do this?
script:
- GLCanvas canvas;
Frame f;
JMCMovieGL intro;
void introScreenSetup() {
Frame f = new Frame("OPENGL frame");
GLCanvas canvas = new GLCanvas();
canvas.addGLEventListener(new GLRenderer());
f.add(canvas);
f.setSize(800, 800);
f.setLocation(-1280, 50);
f.setUndecorated(true);
f.show();
FPSAnimator animator = new FPSAnimator(canvas, 60);
animator.start();
intro = movieFromDataPath("player3.flv");
intro.loop();
}
class GLRenderer implements GLEventListener {
GL gl;
public void init(GLAutoDrawable drawable) {
this.gl = drawable.getGL();
gl.glClearColor(0, 0, 0, 0);
}
public void display(GLAutoDrawable drawable) {
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT );
gl.glColor3f(1, 1, 1);
image(intro, 0, 0); /// doesn't work. ...
}
public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
}
public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {
}
}
1