Path: chuka.playstation.co.uk!scea!greg_labrec@interactive.sony.com From: lee@voxware.com (Lee Stewart) Newsgroups: scea.yaroze.programming.2d_graphics Subject: Callback Question Date: Fri, 16 May 1997 22:13:52 GMT Organization: SCEA Net Yaroze News Lines: 27 Message-ID: <337cd925.34118960@news.scea.sony.com> NNTP-Posting-Host: 208.3.138.208 X-Newsreader: Forte Free Agent 1.11/32.235 I was using some of the sample code as the basis for testing and decided to get a little fancy. I set up a global variable that would be set to one every time a frame was rendered and the code was ready for a page flip. Next I created a callback function and made it look at this variable. If the variable is set, the swap buff function is called. The flag is set by my main rendering code and the callback is executed every vertical sync without fail. The problem is that the global variable can't be seen by the callback. I printed the address of the variable in my main() function and in the callback function and the memory locations are different. The main code is writing to a different address than the one that the callback is reading. Is there some way of fixing this? Does one of the CPU registers point at the data segment (like Intel)? (I've worked around this, but it would be neat to get it fixed. The callback counts how many times the rendering code is too slow to draw a frame during a single v-sync.)