It seems strange that plinit is so slow. What you're doing in your application is very similar to what I'm doing in my windows app - main difference is that my repaints are due to zoom operations. I do call plinit each repaint, and that all happens pretty fast - at least subjectively. I'd say its less than 1/2 second to update the buffer and BLT to screen. Maybe your perception that its slow is also considering the drawing time - which I would think would be constant even if you find a way to avoid calling plinit. Having stepped through plinit for debugging purposes before, it seems pretty short.
Aaron
Sent from XFINITY Connect Mobile App
-----Original Message-----
From: p...@dietmar-nowack.de
To: plplot-general@lists.sourceforge.net
Cc:
Sent: 2015-03-26 13:19:31 GMT
Subject: [Plplot-general] plplot - mem/memcairo repeated render-to-memory?
Hello all.
After having tried quite a few different different options I feel I'm
running out of ideas how to achive my goal, so I decided to ask around.
Apologies if this is a trivial issue ...
What I'm trying to do is get plplot to render a graph into a memory
buffer, which is then blitted to a window whenver i) that window changes
in size, ii) the window needs to be updated after being invalidated or
iii) the data underlying the graph changes.
A small test application I prepared (platform: Windows X64) worked well
enough, I set the driver to "memcairo", passed a frame buffer memory
block via plsmem(), issued the plotting commands and then dumped the
buffer to inspect its contents. Right enough, it was rendered just the
way I need it, ready to be displayed.
But my attempts to incorporate that approach into the real application
failed. I was planning to have one plstream per window, created and
initialized upon window creation. A new memory buffer is passed in by
plsmem() whenever the window size changes, to reflect the current
drawing surface. In the window paint routine, I'm trying to simply
render the plot, then blit the buffer.
However that only works exactly once, all subsequent paint calls fail
with an access violation in a pl...() command.
The rendering commands were stripped down to
plenv0(...)
plline()
But that doesn't seem to make any difference. Basically any call to
plenv() seems to change something in an unwanted way, causing subsequent
calls to write to invalid memory.
Do I need to skip plenv(), and replace it with individual calls for
drawing a box and setting a viewport?
I played with pladv(), but to no avail.
calling plinit(...) for each render cycle to set up a new enviroment
seems to work, but that is so slow as to be unusable, so that's no option.
Is there anything I'm doing wrong, or are there some examples I failed
to notice? Help is appreciated.
TIA
best,
Dietmar
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Plplot-general mailing list
Plplot-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-general
------------------------------------------------------------------------------ Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________ Plplot-general mailing list Plplot-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-general