make code gl-cocoa.m 80 columns for consistency (I'm probably just being OCD, don't mind me, hopefully didn't break anything)

This commit is contained in:
jp9000 2013-11-14 10:48:48 -07:00
parent ec411fe046
commit 041f48b566

View file

@ -40,7 +40,8 @@ static NSOpenGLContext *gl_context_create(struct gs_init_data *info)
{
unsigned attrib_count = 0;
#define ADD_ATTR(x) { attributes[attrib_count++] = (NSOpenGLPixelFormatAttribute)x; }
#define ADD_ATTR(x) \
{ attributes[attrib_count++] = (NSOpenGLPixelFormatAttribute)x; }
#define ADD_ATTR2(x, y) { ADD_ATTR(x); ADD_ATTR(y); }
NSOpenGLPixelFormatAttribute attributes[40];
@ -55,7 +56,8 @@ static NSOpenGLContext *gl_context_create(struct gs_init_data *info)
ADD_ATTR(NSOpenGLPFATripleBuffer);
break;
default:
blog(LOG_ERROR, "Requested backbuffers (%d) not supported", info->num_backbuffers);
blog(LOG_ERROR, "Requested backbuffers (%d) not "
"supported", info->num_backbuffers);
}
ADD_ATTR(NSOpenGLPFAClosestPolicy);
@ -76,13 +78,15 @@ static NSOpenGLContext *gl_context_create(struct gs_init_data *info)
#undef ADD_ATTR2
#undef ADD_ATTR
NSOpenGLPixelFormat *pf = [[NSOpenGLPixelFormat alloc] initWithAttributes:attributes];;
NSOpenGLPixelFormat *pf;
pf = [[NSOpenGLPixelFormat alloc] initWithAttributes:attributes];
if(!pf) {
blog(LOG_ERROR, "Failed to create pixel format");
return NULL;
}
NSOpenGLContext *context = [[NSOpenGLContext alloc] initWithFormat:pf shareContext:nil];
NSOpenGLContext *context;
context = [[NSOpenGLContext alloc] initWithFormat:pf shareContext:nil];
[pf release];
if(!context) {
blog(LOG_ERROR, "Failed to create context");
@ -104,7 +108,8 @@ static bool gl_init_extensions(device_t device)
glewExperimental=true;
GLenum error = glewInit();
if(error != GLEW_OK) {
blog(LOG_ERROR, "glewInit failed, %u\n%s\n", error, glewGetErrorString(error));
blog(LOG_ERROR, "glewInit failed, %u\n%s\n", error,
glewGetErrorString(error));
return false;
}
@ -124,7 +129,8 @@ static bool gl_init_extensions(device_t device)
return false;
}
glGetError(); //something inside glew produces error code 1280 (invalid enum)
//something inside glew produces error code 1280 (invalid enum)
glGetError();
device->copy_type = COPY_TYPE_FBO_BLIT;
@ -246,7 +252,8 @@ void device_present(device_t device)
[device->plat->context flushBuffer];
}
void gl_getclientsize(struct gs_swap_chain *swap, uint32_t *width, uint32_t *height)
void gl_getclientsize(struct gs_swap_chain *swap, uint32_t *width,
uint32_t *height)
{
if(width) *width = swap->info.cx;
if(height) *height = swap->info.cy;