mirror of
https://github.com/love2d/megasource.git
synced 2026-08-20 04:30:45 +02:00
Upgrade to SDL2.0.2 (8393682d9d96d1516831a397290cb34ceb82129f).
This commit is contained in:
@@ -56,6 +56,11 @@
|
||||
const BOOL useDepthBuffer = (depthBits != 0);
|
||||
NSString *colorFormat = nil;
|
||||
|
||||
/* The EAGLRenderingAPI enum values currently map 1:1 to major GLES
|
||||
versions, and this allows us to handle future OpenGL ES versions.
|
||||
*/
|
||||
EAGLRenderingAPI api = majorVersion;
|
||||
|
||||
if (rBits == 8 && gBits == 8 && bBits == 8) {
|
||||
/* if user specifically requests rbg888 or some color format higher than 16bpp */
|
||||
colorFormat = kEAGLColorFormatRGBA8;
|
||||
@@ -71,11 +76,7 @@
|
||||
eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[NSNumber numberWithBool: retained], kEAGLDrawablePropertyRetainedBacking, colorFormat, kEAGLDrawablePropertyColorFormat, nil];
|
||||
|
||||
if (majorVersion > 1) {
|
||||
context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2 sharegroup:shareGroup];
|
||||
} else {
|
||||
context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1 sharegroup:shareGroup];
|
||||
}
|
||||
context = [[EAGLContext alloc] initWithAPI:api sharegroup:shareGroup];
|
||||
if (!context || ![EAGLContext setCurrentContext:context]) {
|
||||
[self release];
|
||||
SDL_SetError("OpenGL ES %d not supported", majorVersion);
|
||||
|
||||
Reference in New Issue
Block a user