Skip to content
Snippets Groups Projects
Commit 9e525c36 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

*** empty log message ***

parent a7b6b646
No related branches found
No related tags found
No related merge requests found
// $Id: Opengl.cpp,v 1.7 2001-01-10 20:14:34 geuzaine Exp $
// $Id: Opengl.cpp,v 1.8 2001-01-10 20:23:36 geuzaine Exp $
#include "Gmsh.h"
#include "GmshUI.h"
......@@ -25,7 +25,6 @@ void myZoom(GLdouble X1, GLdouble X2, GLdouble Y1, GLdouble Y2,
/* ------------------------------------------------------------------------ */
void Init(void){
//WID->make_current();
}
void InitOverlay(void){
......@@ -44,6 +43,22 @@ void DrawUI(void){
WID->check();
}
// one should not call Opengl_Window::draw() from the handle(), but
// rather the following:
void DrawUpdate(){
WID->make_current();
Orthogonalize(0,0);
glClearColor(UNPACK_RED(CTX.color.bg)/255.,
UNPACK_GREEN(CTX.color.bg)/255.,
UNPACK_BLUE(CTX.color.bg)/255.,
0.);
glClear(GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT);
Draw3d();
Draw2d();
WID->swap_buffers();
}
void Draw_String(char *s){
if(CTX.stream == TO_FILE){
......
// $Id: Opengl_Window.cpp,v 1.3 2001-01-10 20:14:34 geuzaine Exp $
// $Id: Opengl_Window.cpp,v 1.4 2001-01-10 20:23:36 geuzaine Exp $
#include "Gmsh.h"
#include "GmshUI.h"
......@@ -53,22 +53,6 @@ void Opengl_Window::draw() {
Draw2d();
}
// one should not call Opengl_Window::draw() from the handle(), but
// rather the following:
void DrawUpdate(){
WID->make_current();
Orthogonalize(0,0);
glClearColor(UNPACK_RED(CTX.color.bg)/255.,
UNPACK_GREEN(CTX.color.bg)/255.,
UNPACK_BLUE(CTX.color.bg)/255.,
0.);
glClear(GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT);
Draw3d();
Draw2d();
WID->swap_buffers();
}
void Opengl_Window::clear_overlay() {
if(CTX.overlay) {}
}
......
// $Id: CreateFile.cpp,v 1.6 2001-01-10 10:06:17 geuzaine Exp $
// $Id: CreateFile.cpp,v 1.7 2001-01-10 20:23:37 geuzaine Exp $
#include "Gmsh.h"
#include "GmshUI.h"
......@@ -106,7 +106,7 @@ void CreateFile (char *name, int format) {
Msg(WARNING, "Unable to Open File '%s'", name);
return;
}
Replot();
DrawUpdate();
create_jpeg(fp, CTX.viewport[2]-CTX.viewport[0],
CTX.viewport[3]-CTX.viewport[1],
CTX.print.jpeg_quality);
......@@ -121,7 +121,7 @@ void CreateFile (char *name, int format) {
Msg(WARNING, "Unable to Open File '%s'", name);
return;
}
Replot();
DrawUpdate();
create_gif(fp, CTX.viewport[2]-CTX.viewport[0],
CTX.viewport[3]-CTX.viewport[1],
CTX.print.gif_dither,
......@@ -141,7 +141,7 @@ void CreateFile (char *name, int format) {
Msg(WARNING, "Unable to Open File '%s'", name);
return;
}
Replot();
DrawUpdate();
create_ppm(fp, CTX.viewport[2]-CTX.viewport[0],
CTX.viewport[3]-CTX.viewport[1]);
Msg(INFOS, "PPM Creation Complete '%s'", name);
......@@ -154,7 +154,7 @@ void CreateFile (char *name, int format) {
Msg(WARNING, "Unable to Open File '%s'", name);
return;
}
Replot();
DrawUpdate();
create_yuv(fp, CTX.viewport[2]-CTX.viewport[0],
CTX.viewport[3]-CTX.viewport[1]);
Msg(INFOS, "YUV Creation Complete '%s'", name);
......@@ -203,8 +203,7 @@ void CreateFile (char *name, int format) {
GL2PS_SIMPLE_LINE_OFFSET | GL2PS_DRAW_BACKGROUND,
GL_RGBA, 0, NULL, size3d, fp);
CTX.stream = TO_FILE ;
Init();
Draw();
DrawUpdate();
CTX.stream = TO_SCREEN ;
res = gl2psEndPage();
}
......
......@@ -40,6 +40,7 @@ void Draw2d(void);
void DrawUI(void);
void DrawOverlay(void);
void Draw(void);
void DrawUpdate(void);
void Draw_String(char *s);
void Draw_Geom (Mesh *m);
......
// $Id: Opengl.cpp,v 1.2 2001-01-10 10:06:18 geuzaine Exp $
// $Id: Opengl.cpp,v 1.3 2001-01-10 20:23:38 geuzaine Exp $
#include <X11/IntrinsicP.h>
......@@ -64,6 +64,11 @@ void Draw(void){
if(CTX.db) glXSwapBuffers(XCTX.display,XtWindow(WID.G.glw));
}
void DrawUpdate(void){
Init();
Draw();
}
void DrawOverlay(void){
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment