Re: For anyone interested in OpenGL

"lcluke" <[email protected]> Mon, 12 May 2003 23:27:52 -0000
Newsgroups gmane.lisp.corman
Message-ID <[email protected]>
--- In [email protected], John Pallister <john@s...> wrote:
> Cool! I was wondering though, in the "SDL_keysym.h" section, there 
seem to 
> be a lot of unmatched '/*'s and repetitions of '#LISP 
(win:defwinconstant 
> SDLK_TAB 9)'. Is that correct?
> 

I haven't finished converting all the key constants to FFI :) This 
has to be done manually unfortunately, the C->lisp translator in CCL 
won't work here. I have only added a few keys to make sure I am 
handling keyboard events correctly. In fact, looking at it now I 
have only "SPACE", "ESCAPE", "ENTER/RETURN" and a couple other keys 
defined. No alpha/numberic or function keys are defined. I plan to 
get to this when I move from mouse handling to keyboard handling.

As far as the unmatched '/*'s go, I think I have one '*/' as a catch-
all. I couldn't bring myself to add a corresponding '*/'.

> Good stuff, though. Do you have further plans for this?

Thanks. Yes, I plan to continue working on the SDL FFI definitions 
as time permits. I haven't added anything to SDL.lisp for a few 
weeks as I have been hammering on what I have done to make sure it 
works and is stable. (The OpenGL stuff especially).

One *huge* gotcha is that all structures in SDL.dll are integer-
aligned. This means that any values you pull out of most of the 
strucs will be just plain wrong. The C->Lisp translator doesn't 
handle byte alignment, so 'int buffer;' has to be added where 
necessary to most structs. I have only done this to the structs 
related to handling events.

For example:

/* The "window resized" event
   When you get this event, you are responsible for setting a new 
video
   mode with the new width and height.
 */
typedef struct {
	Uint8 type;	/* SDL_VIDEORESIZE */
	Uint8 buffer1;
	Uint8 buffer2;
	Uint8 buffer3;
	int w;		/* New width */
	int h;		/* New height */
} SDL_ResizeEvent;

I had to add buffer1 to buffer3 to get w and h ligned up correctly.

I suppose this should be placed on the webpage.

If anyone runs into any bugs, or has anything to add, please email 
me know and I'll update the FFI definitions.

-Luke


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Rent DVDs from home.
Over 14,500 titles. Free Shipping
& No Late Fees. Try Netflix for FREE!
http://us.click.yahoo.com/BVVfoB/hP.FAA/uetFAA/SyjtlB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
[email protected]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/