Threading problems

"Anders Lyhagen" <[email protected]> Wed, 17 Mar 2004 13:07:16 +0100
Newsgroups gmane.comp.cybernetics.webot.contest
Message-ID <000701c40c18$649bb150$78467f3e@Anders>
Hi,

Does anyone know why this code yields a "cannot activate openGL context"
error?

import com.cyberbotics.webots.Controller;
public abstract class Judoka0 extends Controller {
    static int camera;

    public static void reset() {
        camera = robot_get_device("camera");
    }

    public static void main() {
        camera_enable(camera, 64);

        Sensors sensors = new Sensors();
        sensors.setPriority(Thread.MIN_PRIORITY);
        sensors.start();

        while(true)
            robot_step(64);
    }

    static class Sensors extends Thread {
         public void run() {
            while(true) {
                int[] img = camera_get_image(camera);
                try {
                    thread.sleep(200);
                }
                catch(Exception e){}
            }
        }
    }
}

Best regards,
Anders.L





------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/pU_rlB/TM
---------------------------------------------------------------------~->

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/webots-contest/

<*> To unsubscribe from this group, send an email to:
     [email protected]

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/