On Tue, Feb 3, 2009 at 2:40 PM, felix winkelmann
<address@hidden> wrote:
On Tue, Feb 3, 2009 at 2:08 PM, Koen Weddepohl <
address@hidden> wrote:
> Greetings,
>
> I'm interested in using Chicken for homebrew game development.
>
> Anyway, I've been trying to get the SDL egg to work with the OpenGL egg.
> However, I can't get any OpenGL graphics to display. I think this is because
> I can't find an equivalent for SDL_GL_SwapBuffers() in the SDL bindings. Am
> I correct in thinking this is function is not implemented in the SDL egg?
>
Hi, Koen!
This may very well be the case. I'll try to add this, ASAP.
Note that you can get access to this function quickly using
#>
#include <SDL/SDL.h>
<#
(define sdl:gl-swap-buffers
(foreign-lambda void "SDL_GL_SwapBuffers"))
It's been a while since I've last tried using SDL with OpenGL, but that's not the only function that's missing. I had to set a few more things to get the program to display anything. Too bad I lost my modified SDL egg.
Here's the initalization code I was using:
(define (open-viewport width height)
(initialize-video-mode width height 0 (+ SDL_OPENGL)))
(define (initialize-video-mode width height bpp flags)
(sdl-wm-set-caption "OpenGL Window" "OpenGL Window")
(sdl-set-video-mode width height bpp flags)
(sdl-gl-set-attribute SDL_GL_DOUBLEBUFFER 1)
(sdl-gl-set-attribute SDL_GL_RED_SIZE 5)
(sdl-gl-set-attribute SDL_GL_GREEN_SIZE 5)
(sdl-gl-set-attribute SDL_GL_BLUE_SIZE 5)
(sdl-gl-set-attribute SDL_GL_DEPTH_SIZE 16))
For some reason I still cannot understand, the program didn't work without setting those flags first.
--Stephen
programmer, n:
A red eyed, mumbling mammal capable of conversing with inanimate monsters.
cheers,
felix
_______________________________________________
Chicken-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/chicken-users