From 2f445854cc8dc618f295c92b87c421ff74643622 Mon Sep 17 00:00:00 2001 From: "SND\\MaddTheSane_cp" Date: Mon, 2 Dec 2013 20:33:06 +0000 Subject: Some code changes. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@88035 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- macosx/plugins/DFXVideo/macsrc/GL3Code.m | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'macosx/plugins/DFXVideo/macsrc/GL3Code.m') diff --git a/macosx/plugins/DFXVideo/macsrc/GL3Code.m b/macosx/plugins/DFXVideo/macsrc/GL3Code.m index bc4ea3e0..0e8ec435 100644 --- a/macosx/plugins/DFXVideo/macsrc/GL3Code.m +++ b/macosx/plugins/DFXVideo/macsrc/GL3Code.m @@ -43,11 +43,14 @@ static int mylog2(int val) // Get pixel format from OpenGL NSOpenGLPixelFormat* pixFmt = [[NSOpenGLPixelFormat alloc] initWithAttributes:attrs]; - if (!pixFmt) + if (!pixFmt) { + NSLog(@"OpenGL 3 context could not be created."); + NSLog(@"Legacy context will be tried."); return NO; + } [self setPixelFormat:pixFmt]; - + return NO; } @@ -109,7 +112,7 @@ static int mylog2(int val) myShader = glCreateShader(type); if(myShader == 0) { - fprintf(stderr, "impossible de creer le shader\n"); + NSLog(@"impossible de creer le shader"); return 0; } @@ -145,18 +148,16 @@ static int mylog2(int val) glGetShaderiv(myShader, GL_INFO_LOG_LENGTH, &logsize); /* on alloue un espace memoire dans lequel OpenGL ecrira le message */ - log = malloc(logsize + 1); + log = calloc(logsize + 1, 1); if(log == NULL) { - fprintf(stderr, "impossible d'allouer de la memoire !\n"); + NSLog(@"impossible d'allouer de la memoire!"); return 0; } - /* initialisation du contenu */ - memset(log, '\0', logsize + 1); glGetShaderInfoLog(myShader, logsize, &logsize, log); - fprintf(stderr, "impossible de compiler le shader '%s' :\n%s", - [[filename path] UTF8String], log); + NSLog(@"impossible de compiler le shader '%@' :\n%s", + [filename path], log); /* ne pas oublier de liberer la memoire et notre shader */ free(log); @@ -181,7 +182,7 @@ void printProgramInfoLog(GLuint obj) { infoLog = (char *)malloc(infologLength); glGetProgramInfoLog(obj, infologLength, &charsWritten, infoLog); - printf("%s\n",infoLog); + NSLog(@"%s", infoLog); free(infoLog); } } -- cgit v1.2.3