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

*** empty log message ***

parent a7b6b646
Branches
Tags
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 "Gmsh.h"
#include "GmshUI.h" #include "GmshUI.h"
...@@ -25,7 +25,6 @@ void myZoom(GLdouble X1, GLdouble X2, GLdouble Y1, GLdouble Y2, ...@@ -25,7 +25,6 @@ void myZoom(GLdouble X1, GLdouble X2, GLdouble Y1, GLdouble Y2,
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
void Init(void){ void Init(void){
//WID->make_current();
} }
void InitOverlay(void){ void InitOverlay(void){
...@@ -44,6 +43,22 @@ void DrawUI(void){ ...@@ -44,6 +43,22 @@ void DrawUI(void){
WID->check(); 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){ void Draw_String(char *s){
if(CTX.stream == TO_FILE){ 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 "Gmsh.h"
#include "GmshUI.h" #include "GmshUI.h"
...@@ -53,22 +53,6 @@ void Opengl_Window::draw() { ...@@ -53,22 +53,6 @@ void Opengl_Window::draw() {
Draw2d(); 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() { void Opengl_Window::clear_overlay() {
if(CTX.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 "Gmsh.h"
#include "GmshUI.h" #include "GmshUI.h"
...@@ -106,7 +106,7 @@ void CreateFile (char *name, int format) { ...@@ -106,7 +106,7 @@ void CreateFile (char *name, int format) {
Msg(WARNING, "Unable to Open File '%s'", name); Msg(WARNING, "Unable to Open File '%s'", name);
return; return;
} }
Replot(); DrawUpdate();
create_jpeg(fp, CTX.viewport[2]-CTX.viewport[0], create_jpeg(fp, CTX.viewport[2]-CTX.viewport[0],
CTX.viewport[3]-CTX.viewport[1], CTX.viewport[3]-CTX.viewport[1],
CTX.print.jpeg_quality); CTX.print.jpeg_quality);
...@@ -121,7 +121,7 @@ void CreateFile (char *name, int format) { ...@@ -121,7 +121,7 @@ void CreateFile (char *name, int format) {
Msg(WARNING, "Unable to Open File '%s'", name); Msg(WARNING, "Unable to Open File '%s'", name);
return; return;
} }
Replot(); DrawUpdate();
create_gif(fp, CTX.viewport[2]-CTX.viewport[0], create_gif(fp, CTX.viewport[2]-CTX.viewport[0],
CTX.viewport[3]-CTX.viewport[1], CTX.viewport[3]-CTX.viewport[1],
CTX.print.gif_dither, CTX.print.gif_dither,
...@@ -141,7 +141,7 @@ void CreateFile (char *name, int format) { ...@@ -141,7 +141,7 @@ void CreateFile (char *name, int format) {
Msg(WARNING, "Unable to Open File '%s'", name); Msg(WARNING, "Unable to Open File '%s'", name);
return; return;
} }
Replot(); DrawUpdate();
create_ppm(fp, CTX.viewport[2]-CTX.viewport[0], create_ppm(fp, CTX.viewport[2]-CTX.viewport[0],
CTX.viewport[3]-CTX.viewport[1]); CTX.viewport[3]-CTX.viewport[1]);
Msg(INFOS, "PPM Creation Complete '%s'", name); Msg(INFOS, "PPM Creation Complete '%s'", name);
...@@ -154,7 +154,7 @@ void CreateFile (char *name, int format) { ...@@ -154,7 +154,7 @@ void CreateFile (char *name, int format) {
Msg(WARNING, "Unable to Open File '%s'", name); Msg(WARNING, "Unable to Open File '%s'", name);
return; return;
} }
Replot(); DrawUpdate();
create_yuv(fp, CTX.viewport[2]-CTX.viewport[0], create_yuv(fp, CTX.viewport[2]-CTX.viewport[0],
CTX.viewport[3]-CTX.viewport[1]); CTX.viewport[3]-CTX.viewport[1]);
Msg(INFOS, "YUV Creation Complete '%s'", name); Msg(INFOS, "YUV Creation Complete '%s'", name);
...@@ -203,8 +203,7 @@ void CreateFile (char *name, int format) { ...@@ -203,8 +203,7 @@ void CreateFile (char *name, int format) {
GL2PS_SIMPLE_LINE_OFFSET | GL2PS_DRAW_BACKGROUND, GL2PS_SIMPLE_LINE_OFFSET | GL2PS_DRAW_BACKGROUND,
GL_RGBA, 0, NULL, size3d, fp); GL_RGBA, 0, NULL, size3d, fp);
CTX.stream = TO_FILE ; CTX.stream = TO_FILE ;
Init(); DrawUpdate();
Draw();
CTX.stream = TO_SCREEN ; CTX.stream = TO_SCREEN ;
res = gl2psEndPage(); res = gl2psEndPage();
} }
......
...@@ -40,6 +40,7 @@ void Draw2d(void); ...@@ -40,6 +40,7 @@ void Draw2d(void);
void DrawUI(void); void DrawUI(void);
void DrawOverlay(void); void DrawOverlay(void);
void Draw(void); void Draw(void);
void DrawUpdate(void);
void Draw_String(char *s); void Draw_String(char *s);
void Draw_Geom (Mesh *m); 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> #include <X11/IntrinsicP.h>
...@@ -64,6 +64,11 @@ void Draw(void){ ...@@ -64,6 +64,11 @@ void Draw(void){
if(CTX.db) glXSwapBuffers(XCTX.display,XtWindow(WID.G.glw)); if(CTX.db) glXSwapBuffers(XCTX.display,XtWindow(WID.G.glw));
} }
void DrawUpdate(void){
Init();
Draw();
}
void DrawOverlay(void){ void DrawOverlay(void){
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment