mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-24 03:40:34 +05:00
togl: gluPerspective moved to draw function
This commit is contained in:
parent
047107e0c9
commit
113771b7fa
23
ng/ngpkg.cpp
23
ng/ngpkg.cpp
@ -1877,6 +1877,24 @@ namespace netgen
|
|||||||
if (nodisplay)
|
if (nodisplay)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
int w = Togl_Width (togl);
|
||||||
|
int h = Togl_Height (togl);
|
||||||
|
|
||||||
|
glViewport(0, 0, w, h);
|
||||||
|
|
||||||
|
glMatrixMode(GL_PROJECTION);
|
||||||
|
glLoadIdentity();
|
||||||
|
|
||||||
|
// OpenGL near and far clipping planes
|
||||||
|
double pnear = 0.1;
|
||||||
|
double pfar = 10;
|
||||||
|
|
||||||
|
gluPerspective(20.0f, double(w) / h, pnear, pfar);
|
||||||
|
glMatrixMode(GL_MODELVIEW);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Tcl_Interp * interp = Togl_Interp(togl);
|
Tcl_Interp * interp = Togl_Interp(togl);
|
||||||
|
|
||||||
SetVisualScene (interp);
|
SetVisualScene (interp);
|
||||||
@ -1910,14 +1928,14 @@ namespace netgen
|
|||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
// gluLookAt (0, 0, 6, 0, 0, 0, 0, 1, 0);
|
// gluLookAt (0, 0, 6, 0, 0, 0, 0, 1, 0);
|
||||||
vs->DrawScene();
|
vs->DrawScene();
|
||||||
|
|
||||||
Togl_SwapBuffers(togl);
|
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
Togl_SwapBuffers(togl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void reshape( struct Togl *togl)
|
static void reshape( struct Togl *togl)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
if (nodisplay)
|
if (nodisplay)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -1937,6 +1955,7 @@ namespace netgen
|
|||||||
glMatrixMode(GL_MODELVIEW);
|
glMatrixMode(GL_MODELVIEW);
|
||||||
|
|
||||||
draw (togl);
|
draw (togl);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user