[aquaria] SDL2 patches...
Jonas Kulla
nyocurio at gmail.com
Wed Jul 17 06:07:15 EDT 2013
2013/7/17 Ryan C. Gordon <icculus at icculus.org>
>
> Long overdue, here are the SDL2 patches I promised.
>
> This is just diff'd against the original GPL release and cleaned up as
> appropriate, so if it doesn't apply correctly, you'll have to poke at it.
> Ask questions if you need to.
>
> Not in this patch: The SDL2 headers (get them from SDL, instead of me
> inflating this patch massively) or prebuilt libraries (let me know if you
> want them).
>
> This is what we're shipping on Steam in the linuxbeta depot, and I'm about
> to make it live to the general public by default.
>
> --ryan.
>
>
> _______________________________________________
> aquaria mailing list
> aquaria at icculus.org
> http://icculus.org/mailman/listinfo/aquaria
>
>
Hi Ryan!
@@ -1855,6 +1918,30 @@
//if (!didOnce)
{
+#ifdef BBGE_BUILD_SDL2
+ Uint32 flags = 0;
+ flags = SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN;
+ if (fullscreen)
+ flags |= SDL_WINDOW_FULLSCREEN;
+ gScreen = SDL_CreateWindow(appName.c_str(), SDL_WINDOWPOS_CENTERED,
SDL_WINDOWPOS_CENTERED, width, height, flags);
+ if (gScreen == NULL)
+ {
+ std::ostringstream os;
+ os << "Couldn't set resolution [" << width << "x" << height << "]\n" <<
SDL_GetError();
+ errorLog(os.str());
+ SDL_Quit();
+ exit(0);
+ }
+ gGLctx = SDL_GL_CreateContext(gScreen);
+ if (gScreen == NULL)
+ {
+ std::ostringstream os;
+ os << "Couldn't create OpenGL context!\n" << SDL_GetError();
+ errorLog(os.str());
+ SDL_Quit();
+ exit(0);
+ }
+#else
Just a small observation, but shouldn't the second check verify 'gGLctx'
instead of 'gScreen'?
Jonas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://icculus.org/pipermail/aquaria/attachments/20130717/2b39eaf5/attachment-0001.html>
More information about the aquaria
mailing list