Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

visualThread.h File Reference

#include "misc.h"

Go to the source code of this file.

Functions

void* VisualizationThread ( void* targs )
 The Visualization Thread. More...


Function Documentation

void * VisualizationThread ( void * targs)

The Visualization Thread.

Author(s):
xandi
Date:
130400
Parameters:
targz   passes the arguments which came from main

Definition at line 1019 of file visualThread.cpp.

01020 {
01021     ThreadArgs* targs = (ThreadArgs*) targz;
01022     myInBuffer  = targs->in;
01023 
01024     fprintf(stderr,"[vT] Visualization Thread started... %p\n",targs->in);
01025 
01026     /* i sometimes forget to export the correct DISPLAY.*/
01027     if (getenv("DISPLAY") == NULL)
01028         {
01029         cerr << "[display-environment-check] DISPLAY not set...\tcontinuing\n"<<endl;
01030 
01031         if (putenv("DISPLAY=0:0"))
01032         cerr << "[display-environment-check]\tsetting DISPLAY environement-var to 0:0 failed\n";
01033         cerr << "[display-environment-check]\tsetting DISPLAY=0:0\n";
01034         }
01035 
01036     devfreq.tv_usec = 1000000 / 26;
01037 
01038 
01039     while ( !myInBuffer ) usleep (10000); //useless actually
01040     while ( !coreBufferIn ) usleep (10000);
01041 
01042     extern Buffer* outputBufferIn;
01043     qObj = new QuartzClass ( outputBufferIn, PROT_GET_ALL_CHANGED, 25 );
01044     pthread_t qThread;
01045     pthread_create (&qThread, NULL, QuartzThread, qObj);
01046 
01047     glutInit(&targs->argc,targs->argv);
01048     WINDOWX = 640;
01049     WINDOWY = 480;
01050 
01051     glutInitDisplayMode (GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
01052     glutInitWindowSize ( WINDOWX, WINDOWY );
01053     glutInitWindowPosition ( 0, 0);
01054     glutCreateWindow ( "[3Dsia] Reference Client" );
01055 
01056     Init ();
01057 
01058     cerr << devices.addDevicePlugIn ("client/plugins/deviceMouse.so") << "\n";
01059     devices.connect (0, 0, MOVE_FORWARD);
01060     devices.connect (0, 1, MOVE_BACKWARD);
01061     devices.connect (0, devices.getDeviceButtons (0), ROTATE_UP);
01062     devices.connect (0, devices.getDeviceButtons (0) + 1, ROTATE_DOWN);
01063     devices.connect (0, devices.getDeviceButtons (0) + 2, ROTATE_LEFT);
01064     devices.connect (0, devices.getDeviceButtons (0) + 3, ROTATE_RIGHT);
01065 
01066     cerr << devices.addDevicePlugIn ("client/plugins/deviceKeyboard.so") << "\n";
01067     devices.connect (1, 0, MOVE_FORWARD);
01068     devices.connect (1, 1, MOVE_BACKWARD);
01069     devices.connect (1, 2, EXIT_CLIENT);
01070     devices.connect (1, 3, INC_SPEED);
01071     devices.connect (1, 4, DEC_SPEED);
01072     devices.connect (1, devices.getDeviceButtons (1), ROTATE_UP);
01073     devices.connect (1, devices.getDeviceButtons (1) + 1, ROTATE_DOWN);
01074     devices.connect (1, devices.getDeviceButtons (1) + 2, ROTATE_LEFT);
01075     devices.connect (1, devices.getDeviceButtons (1) + 3, ROTATE_RIGHT);
01076     devices.connect (1, devices.getDeviceButtons (1) + 4, CHAT_MODE);
01077 
01078         glutDisplayFunc (display);
01079         glutReshapeFunc (reshape);
01080         glutIdleFunc (idlefunc);
01081     glutMainLoop ();
01082 
01083     return targz;
01084     }

Generated at Sat May 13 13:50:24 2000 for 3Dsia by doxygen 1.1.2 written by Dimitri van Heesch, © 1997-2000