If the Quality forced to 2, then the virtual function line_draw() is never
called. I changed to 4, and really debugged into the opengl drawing code. but
still it doesn't work.
Can anyone correct me?? Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In v.2.* all drawing take place in Finish() function. There is the only
exception -- Quality&4!=0. Usually Finish() function is called internally each
time when you save picture, update it a window or access to RGB values. So,
you don't need to call Finish() until you are using pure OpenGL mode.
Unfortunately, I forgot to provide a public interface for this function. I
just do it in SVN rev.547. Thank you for the error.
So, you can update from SVN and add call gr->Finish() at the end of plotting
function.
I found a strange thing. The code " gr->Label(’y’,"axis 1",0); " draws nothing
to the screen in OpenGL mode. So I cannot add label the axis. However, the
code " gr->Puts(mglPoint(0,1.2),"Normal scale"); " works.
Could you verify that?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The reason I prefer to using OpenGL is the drawing is much faster. Someone
firstly draws to a bitmap in memory, then copies the bitmap to screen. It
works fine, but consumes a lot of CPU time. So the frame rate for animation is
not good enough.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I tried the latest mathgl-2.0.3. Drawing with OpenGL is not working both on
Linux and Windows. The screen is blank after drawing.
I tracked down the code and found:
void SetQuality(int =0) { Quality=2; }
define MGL_LINE_PLOT if(Quality&4) line_draw(p1,p2,&dd);else \
{ mglPrim a(1); a.n3=PDef; a.s = pPos; \
a.n1 = p1; a.n2 = p2; a.w = pw; add_prim(a); }
If the Quality forced to 2, then the virtual function line_draw() is never
called. I changed to 4, and really debugged into the opengl drawing code. but
still it doesn't work.
Can anyone correct me?? Thanks!
Hi,
In v.2.* all drawing take place in Finish() function. There is the only
exception -- Quality&4!=0. Usually Finish() function is called internally each
time when you save picture, update it a window or access to RGB values. So,
you don't need to call Finish() until you are using pure OpenGL mode.
Unfortunately, I forgot to provide a public interface for this function. I
just do it in SVN rev.547. Thank you for the error.
So, you can update from SVN and add call gr->Finish() at the end of plotting
function.
Or you can use following hint right now
But keep in mind that this hint is not guarantee to be binary compatible with
further MathGL version.
Thanks abalakin
I make the pure OpenGL mode work with MFC.
I found a strange thing. The code " gr->Label(’y’,"axis 1",0); " draws nothing
to the screen in OpenGL mode. So I cannot add label the axis. However, the
code " gr->Puts(mglPoint(0,1.2),"Normal scale"); " works.
Could you verify that?
Yes, there is a problem with text drawing in OpenGL mode. I'll try to fix it.
Thank you
I hope that I fix it in svn rev.553.
You'r so nice.
The reason I prefer to using OpenGL is the drawing is much faster. Someone
firstly draws to a bitmap in memory, then copies the bitmap to screen. It
works fine, but consumes a lot of CPU time. So the frame rate for animation is
not good enough.