Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!apple!agate!usenet.ins.cwru.edu!ysub!psuvm!cxt105 From: CXT105@psuvm.psu.edu (Christopher Tate) Newsgroups: comp.sys.mac.programmer Subject: Direct-to-screen drawing Message-ID: <91113.105146CXT105@psuvm.psu.edu> Date: 23 Apr 91 14:51:46 GMT Organization: Penn State University Lines: 30 I'm trying to figure out how to do direct-to-screen drawing, in the course of working on things like antialiasing. The problems I'm running into are strange, though.... If I open a CWindow, its baseAddr is the address of the main screen buffer. Okay; well, I guess I'll just draw directly onto the screen (since I'm not worried about being friendly to other apps just yet :-). Unfortunately I'm getting crashes when I try to write to the screen in certain ways that *look* like they should work... Example: base is an (unsigned char *) that points to the screen buffer. I can verify this by saying *base = 33, and seeing the pretty red dot appear in the top left corner of the screen. However, if I try to set up pointer arithmetic of the form *(base + x + rowBytes*y) = 33; a couple of different things happen. If x, y, and rowBytes are declared as type short, then it works -- sort of. I get strange wraparound to the top of the screen which I assume is because of overflow problems in the multiplication. If x, y, and rowBytes are declared long, it crashes. Every time. Anyone have any ideas why? Or, alternatively, has anyone already worked out the nitty-gritty of direct screen bit-twiddling to a color window? ------- Christopher Tate | "Hear perfect strangers call you by name, cxt105@psuvm.psu.edu | Pay good money to hear "Fire and Rain" ..!psuvax1!psuvm.bitnet!cxt105 | Again and again and again.... cxt105@psuvm.bitnet | That's why I'm here!" -- James Taylor