🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2.programmer
Article #26

Normal PS woes.

#26
From: Stephen M. Lacy
Date: Wed, 28 Oct 1992 06:24
35 lines
1880 bytes
Hi there,

I'm writing a program that does lots of line-graphics animation type things.
There is some considerable amound of overhead for generating each frame,
so I thought I'd use the following scheme:

When my window is opened, create a Normal PS.  This PS has two segments,
kind of line double buffering.  When I generate the next view, I do it
retained, not drawn, then draw the other segment out the screen with
color CLR_BACKGROUND to erase it, then draw the new segment with
CLR_NEUTRAL, and delete the CLR_BACKGROUND segment.  (toggling which
segment is which as I go along)  The problem is that as the program
runs, my swapfile grows, and soon takes up my whole harddrive.  I'm
assuming that the problem is this: Since everything that I draw is in
retained mode, its saving everythin, not just the current two segments. 
I thought that GpiDeleteSegment would help, but it doesn't seem to. 

I know that a GpiResetPS would help, but I can't use it because I need
to have both segments in memory all the time...

Any ideas about how to do this efficiently?

Steve

p.s. I'm using the following stuff:
gcc-2.2.2
VNR "OS/2 Presentation Manager GPI, A programming Guide to Text..."
Petzold "Programming the OS/2 presentation manager"
header files.

Thats all the documentation I have, so RTFM is not good enough.


"Eight o'clock in the morning and the daylight makes me look and feel
like hell" -OMD
Technical Details
Message-ID: <UevfuY_00YUnQ6EHN7@andrew.cmu.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!ogicse!das-news.harvard.edu!cantaloupe.srv.cs.cmu.edu!crabapple.srv.cs.cmu.edu!andrew.cmu.edu!sl31+

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!ogicse!das-news.harvard.edu!cantaloupe.srv.cs.cmu.edu!crabapple.srv.cs.cmu.edu!andrew.cmu.edu!sl31+
From: sl31+@andrew.cmu.edu (Stephen M. Lacy)
Newsgroups: comp.os.os2.programmer
Subject: Normal PS woes.
Message-ID: <UevfuY_00YUnQ6EHN7@andrew.cmu.edu>
Date: 28 Oct 92 06:24:04 GMT
Article-I.D.: andrew.UevfuY_00YUnQ6EHN7
Organization: Junior, Math/Computer Science, Carnegie Mellon, Pittsburgh, PA
Lines: 35