Пример #1
0
void glfemMainLoop(char *theWindowName)
{	
    glfwInit();
    glfwOpenWindow(480,480,0,0,0,0,0,0,GLFW_WINDOW);    
    glfemSetRasterSize(480,480);
    glfwSetWindowTitle(theWindowName);
    glShadeModel(GL_SMOOTH);
    glMakeRasterFont();
     do { //glfwWaitEvents();
        
        int width, height;
        glfwGetWindowSize( &width, &height );
		
        glfemReshapeWindows(width,height);
    //   glfwSleep(10);
        thePlot.draw();         
        thePlot.animate();         
        glfwSwapBuffers();

        if (glfwGetKey('R') == GLFW_PRESS)    thePlot.key('r');
        if (glfwGetKey('U') == GLFW_PRESS)    thePlot.key('u');
        if (glfwGetKey('V') == GLFW_PRESS)    thePlot.key('v');
        if (glfwGetKey('E') == GLFW_PRESS)    thePlot.key('e');
        if (glfwGetKey('S') == GLFW_PRESS)    thePlot.key('s');
        if (glfwGetKey('N') == GLFW_PRESS)    thePlot.key('n');
		if (glfwGetKey(GLFW_KEY_ESC) == GLFW_PRESS) break;
		if (glfwGetWindowParam(GLFW_OPENED) == GL_FALSE) break;
    } while(1);
    
    glfwTerminate();    
    exit(EXIT_SUCCESS); 
}
Пример #2
0
GLFWwindow* glfemInit(char *theWindowName)
{
    glfwInit();
    GLFWwindow* window = glfwCreateWindow(480,480,"Simple example with graphics",NULL,NULL);    
    glfwMakeContextCurrent(window);
    glfemSetRasterSize(480,480);
    glfwSetWindowTitle(window,theWindowName);
    glShadeModel(GL_SMOOTH);
    glMakeRasterFont();
    return(window);
}
Пример #3
0
void glfemInit(char *theWindowName, femMesh *theMesh, femEdges *theEdges, double *theField, char *theMessage)
{
    thePlot.mesh = theMesh;
    thePlot.edges = theEdges;
    thePlot.field = theField;
    thePlot.message = theMessage;
    glfwInit();
    glfwOpenWindow(480,480,0,0,0,0,0,0,GLFW_WINDOW);    
    glfemSetRasterSize(480,480);
    glfwSetWindowTitle(theWindowName);
    glShadeModel(GL_SMOOTH);
    glMakeRasterFont();
    glfemSetViewPortMesh(theMesh);
}