diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-12-02 20:33:06 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-12-02 20:33:06 +0000 |
| commit | 2f445854cc8dc618f295c92b87c421ff74643622 (patch) | |
| tree | b371284e48ea47fb3a72046815bb6bac55c2aeb4 /macosx/plugins/DFXVideo/macsrc | |
| parent | 81da7f45b488bd774fdf51763a5d3ef094d8e368 (diff) | |
| download | pcsxr-2f445854cc8dc618f295c92b87c421ff74643622.tar.gz | |
Some code changes.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@88035 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/plugins/DFXVideo/macsrc')
| -rw-r--r-- | macosx/plugins/DFXVideo/macsrc/GL3Code.m | 21 |
1 files changed, 11 insertions, 10 deletions
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); } } |
