Hi,

I've written a simple macro that places a vecto image at the centre of 
the SDL *default-display*, calculating the co-ordinates based upon the 
size of the *default-display* and the size of the vecto image. I am 
trying to get the size of the *default-display* using sdl-base:surf-w 
and sdl:base:surf-h rather than hard-coding the values, but when I do 
so, I get the following error:

code c0000005  flags 00000000 address 21D31F4CEIP 21d31f4c  ESP 20cc614c 
  EBP 20cc6150
Error: Exception C0000005 [flags 0] at 21D31F4C {inside #<Function 
SURF-W 21D31F2A>}
eax 8FC000C6 ebx 200B8C90 ecx 201C01CA edx 8020807E
esp 20CC614C ebp 20CC6150 esi 200D92B7 edi 800000C6
   1 (abort) Return to the idle process top-loop.

Type :b for backtrace, :c <option number> to proceed,  or :? for other 
options

My macro (which is called from inside a vecto:with-canvas macro) looks 
like this:

(defmacro vecto->centre ()
   `(sdl:vecto->surface
     vecto::*graphics-state*
     sdl:*default-display*
     (- (/ (sdl-base:surf-w sdl:*default-display*) 2)
        (/ (slot-value vecto::*graphics-state* 'vecto::width) 2))
     (- (/ (sdl-base:surf-h sdl:*default-display*) 2)
        (/ (slot-value vecto::*graphics-state* 'vecto::height) 2))))

What could be going wrong here?

Thanks,
Tony.
_______________________________________________
application-builder mailing list
[email protected]
http://www.lispniks.com/mailman/listinfo/application-builder

Reply via email to