Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!dali.cs.montana.edu!milton!wiml From: wiml@milton.u.washington.edu (William Lewis) Newsgroups: comp.sys.next Subject: Re: dspwrap without the appkit Message-ID: <11920@milton.u.washington.edu> Date: 29 Nov 90 06:49:31 GMT References: <1990Nov28.234910.28347@murdoch.acc.Virginia.EDU> Distribution: na Organization: University of Washington, Seattle Lines: 58 In article <1990Nov28.234910.28347@murdoch.acc.Virginia.EDU> pts@mendel.acc.Virginia.EDU (Paul T. Shannon) writes: > ... What I don't understand, >however, is how to establish the proper context, which (I guess) >is a connection between my program and the Display Postscript Interpreter. DPSCreateContext() is what you want. I'm not very clear on what the PS*() routines think the "current context" is, but if you only have one context open I think it's usually that one. >For those curious, or skeptical, I want to do this so that I can >use the entire display, with as little interference and overhead as >possible, to present full-screen visual stimuli for experiments in >perceptual psychology. Well, if you *really* want as little interference and overhead (or help from the OS) as possible, check out the DKIOCGADDR ioctl, defined in (which only works on /dev/vid0). This will give you the address of the video RAM, to which you can directly write. Pretty fast, especially if the windowserver is quiescent or not running (ie. user is logged in from console). Beware that if you do this you'll get flakes of image all over your screen that you'll have to wipe off with your frontwindow, unless you create a fullscreen window in front of the screen first to use as a tarpaulin. (Actually, you'll almost certainly want to do that: any exposed portions of Retained windows that get overwritten in this way will *stay* overwritten -- no backing store, you see =8) and the image has effectively been blitted right into the window buffer. I'm still trying to think of a use for this. IMHO, there should be some way to map the windowserver's buffers for certain windows into your process's address space... on the other hand, all this circumvents all the wonderful things we all know love and use about PostScript. sigh, the price of portability is control) If you (or anyone else reading this message, since I do seem to be posting it to the net) want some sample code, I have some poorly- written stuff that puts PBMs on the screen and does sort of 2-entry CLUT animation with them. >A good example of the sort of full-screen use I'm after is in the file > /NextLibrary/Images/Scene_movies/snake.script.ps >But what I'd like to do is to take that (or similar) postscript code, >pswrap it, and run it from a fast-loading C program, rather than out >of Preview. Can anyone help me on this? Thanks. Also take a look at 'pft'. You should be able to do pft -f /full/path/name/myFunFile.ps -s to run a postscript program without invoking Preview. Note that the program run this way has to do its own window creation, but most movies seem to do that anyway. Flames about portability and philosophy to /dev/vid0. -- wiml@milton.acs.washington.edu Seattle, Washington (William Lewis) | 47 41' 15" N 122 42' 58" W "These 2 cents will cost the net thousands upon thousands of dollars to send everywhere. Are you sure you want to do this?"