proj home

Files   Classes   Functions   Hierarchy  

visenv Class Reference

Note: I have not separated the state from the graphics, which may be a risk and need a re-write to get the power of separation. More...

#include <visenv.h>

Collaboration diagram for visenv:
Collaboration graph

List of all members.

Public Member Functions

 visenv (int argc, char **argv, boolc graphics=true)
 Interpret string expecting three numbers.
void defaultsettings ()
void defaultgraphics (int argc, char **argv)
void graphicsloop ()
 Infinite graphics loop.

Static Public Member Functions

static void keyboard (unsigned char key, int x, int y)
static void display ()
 Displays the gobj::global with double buffering.

Public Attributes

gobjContainer xGraphics
 Global graphics stream.
vector< pt3pi
 Global points.

Detailed Description

Note: I have not separated the state from the graphics, which may be a risk and need a re-write to get the power of separation.

Definition at line 22 of file visenv.h.


Constructor & Destructor Documentation

visenv::visenv ( int  argc,
char **  argv,
boolc  graphics = true 
)

Interpret string expecting three numbers.

Construct in good state.

Definition at line 6 of file visenv.cpp.

References defaultgraphics(), and defaultsettings().

00007 {
00008   defaultsettings();
00009 
00010   if (graphics)
00011     defaultgraphics(argc,argv);
00012 }


Member Function Documentation

void visenv::defaultgraphics ( int  argc,
char **  argv 
)

Definition at line 29 of file visenv.cpp.

References display(), gobjpush, keyboard(), gobjContainer::set(), and xGraphics.

Referenced by visenv().

00030 {
00031   glutInit(&argc,argv);
00032   glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
00033   glutInitWindowSize(800,600);
00034   glutCreateWindow("");
00035   glutDisplayFunc(display);
00036   glutKeyboardFunc(keyboard);
00037 
00038   OpenGLinitialisation();
00039   glEnable(GL_CULL_FACE);
00040   glEnable(GL_NORMALIZE);
00041 
00042   xGraphics.set();
00043 
00044 /*
00045   sphere01 = new gobjQuadric();
00046 
00047   sphere01->radius = 0.05;
00048   sphere01->slices = 30;
00049   sphere01->loops = 7;
00050 */
00051 
00052   gobjpush(new myaxes(1.0));
00053 
00054 //  pointdisplay=true;
00055 }

void visenv::defaultsettings (  ) 

Definition at line 68 of file visenv.cpp.

References pi, and visoperator::set().

Referenced by visenv().

00069 {
00070   visoperator::set(*this);
00071 
00072   pi.clear();
00073   pi.push_back(point3<double>());
00074 
00075   //pointdisplay=false;
00076 }

void visenv::display (  )  [static]

Displays the gobj::global with double buffering.

Definition at line 57 of file visenv.cpp.

References gobjContainer::draw(), glerrordisplay(), and gobj::global.

Referenced by defaultgraphics().

00058 { 
00059   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
00060 
00061   gobj::global->draw();
00062   glerrordisplay();
00063   
00064   glutSwapBuffers();
00065 }

void visenv::graphicsloop (  ) 

Infinite graphics loop.

Definition at line 101 of file visenv.cpp.

References zpr::update().

Referenced by vistest::test02().

00102 {
00103   zpr zz;
00104   zz.update();
00105 
00106   glutMainLoop();
00107 }

void visenv::keyboard ( unsigned char  key,
int  x,
int  y 
) [static]

Definition at line 16 of file visenv.cpp.

Referenced by defaultgraphics().

00021 {
00022   switch (key)
00023   {
00024     case 27: exit(0); break;
00025 
00026   }
00027 }


Member Data Documentation

vector< pt3 > visenv::pi

Global graphics stream.

Definition at line 29 of file visenv.h.

Referenced by defaultgraphics(), and vistest::test02().


The documentation for this class was generated from the following files:

Generated on 27 Nov 2012 for Chelton Evans Source by  doxygen 1.6.1