lispgames / cl-sdl2

Common Lisp bindings for SDL2 using C2FFI.
MIT License
308 stars 82 forks source link

Get an opengl ES 2.0 context #124

Closed noloop closed 4 years ago

noloop commented 5 years ago

How do I get an opengl ES 2.0 context with cl-sdl2?

I thought of using as in C:

SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);

But I don't find any key for "SDL_GL_CONTEXT_PROFILE_ES":

(sdl2:gl-set-attr :context-profile-mask ?)
(sdl2:gl-set-attr :context-major-version 2)
(sdl2:gl-set-attr :context-minor-version 0) 
nsrahmad commented 4 years ago

The value you are looking for is sdl2-ffi:+sdl-gl-context-profile-es+.