proj home

Files   Classes   Functions   Hierarchy  

Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
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

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().

{
if (graphics)
defaultgraphics(argc,argv);
}

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().

{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize(800,600);
glutCreateWindow("");
glutDisplayFunc(display);
glutKeyboardFunc(keyboard);
glEnable(GL_CULL_FACE);
glEnable(GL_NORMALIZE);
/*
sphere01 = new gobjQuadric();
sphere01->radius = 0.05;
sphere01->slices = 30;
sphere01->loops = 7;
*/
gobjpush(new myaxes(1.0));
// pointdisplay=true;
}
void visenv::defaultsettings ( )

Definition at line 68 of file visenv.cpp.

References pi, and visoperator::set().

Referenced by visenv().

{
pi.clear();
pi.push_back(point3<double>());
//pointdisplay=false;
}
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().

{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glutSwapBuffers();
}
void visenv::graphicsloop ( )

Infinite graphics loop.

Definition at line 101 of file visenv.cpp.

References zpr::update().

Referenced by vistest::test02().

{
zpr zz;
zz.update();
glutMainLoop();
}
void visenv::keyboard ( unsigned char  key,
int  x,
int  y 
)
static

Definition at line 16 of file visenv.cpp.

Referenced by defaultgraphics().

{
switch (key)
{
case 27: exit(0); break;
}
}

Member Data Documentation

vector< pt3 > visenv::pi
gobjContainer visenv::xGraphics

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: