I've just checked in another SDL example,
examples/sdl/move_parrot_logl.imc.  This example uses the cursor keys to
move the logo around.  Hitting escape or closing the window exits the
program.

To make the image handling work (and it (ab)uses objects, so that
part'll need to change in the near future), I had to hard-code the image
size.

Applying the attached patch will demonstrate my current problem in keyed
access to a ManagedStruct.  It's not for checkin.  It's only here to
demonstrate the problem.

Bugfixes and advice warmly welcomed.

-- c


Index: library/sdl_types.imc
===================================================================
RCS file: /cvs/public/parrot/library/sdl_types.imc,v
retrieving revision 1.4
diff -u -u -r1.4 sdl_types.imc
--- library/sdl_types.imc	10 Feb 2004 04:58:19 -0000	1.4
+++ library/sdl_types.imc	10 Feb 2004 05:00:11 -0000
@@ -441,16 +441,30 @@
 .sub _SDL_Surface_height prototyped
 	.param pmc surface
 
+	.sym pmc layout
+	layout = _SDL_Surface_layout()
+	assign surface, layout
+
+	.sym int height
+	set height, surface['h']
+
 	.pcc_begin_return
-		.return 56
+		.return height
 	.pcc_end_return
 .end
 
 .sub _SDL_Surface_width prototyped
 	.param pmc surface
 
+	.sym pmc layout
+	layout = _SDL_Surface_layout()
+	assign surface, layout
+
+	.sym int width
+	set width, surface['w']
+
 	.pcc_begin_return
-		.return 100
+		.return width
 	.pcc_end_return
 .end
 

Reply via email to