Changeset 963e611 in git


Ignore:
Timestamp:
18/01/14 23:12:12 (6 years ago)
Author:
Olly Betts <olly@…>
Branches:
line_contents, master, stereo, travis-osx
Children:
d752afd
Parents:
c053e86
Message:

src/gla-gl.cc: Split log_fl_error helper function out of
CHECK_GL_ERROR, which will reduce code size and also the number of
deprecation warnings about gluErrorString on Mac OS X 10.9.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    rc053e86 r963e611  
     1Sat Jan 18 23:09:12 GMT 2014  Olly Betts <olly@survex.com>
     2
     3        * src/gla-gl.cc: Split log_fl_error helper function out of
     4          CHECK_GL_ERROR, which will reduce code size and also the number of
     5          deprecation warnings about gluErrorString on Mac OS X 10.9.
     6
    17Sat Jan 18 22:49:02 GMT 2014  Olly Betts <olly@survex.com>
    28
  • src/gla-gl.cc

    rc053e86 r963e611  
    55//
    66//  Copyright (C) 2002-2003,2005 Mark R. Shinwell
    7 //  Copyright (C) 2003,2004,2005,2006,2007,2010,2011,2012,2013 Olly Betts
     7//  Copyright (C) 2003,2004,2005,2006,2007,2010,2011,2012,2013,2014 Olly Betts
    88//
    99//  This program is free software; you can redistribute it and/or modify
     
    141141}
    142142
     143static void
     144log_gl_error(const wxChar * str, GLenum error_code)
     145{
     146    const char * e = reinterpret_cast<const char *>(gluErrorString(error_code));
     147    wxLogError(str, wxString(e, wxConvUTF8).c_str());
     148}
     149
    143150// Important: CHECK_GL_ERROR must not be called within a glBegin()/glEnd() pair
    144151//            (thus it must not be called from BeginLines(), etc., or within a
     
    150157    GLenum error_code_ = glGetError(); \
    151158    if (error_code_ != GL_NO_ERROR) { \
    152         wxLogError(wxT(__FILE__":"STRING(__LINE__)": OpenGL error: %s " \
    153                    "(call "F" in method "M")"), \
    154                    wxString((const char *)gluErrorString(error_code_), \
    155                             wxConvUTF8).c_str()); \
     159        log_gl_error(wxT(__FILE__":"STRING(__LINE__)": OpenGL error: %s " \
     160                         "(call "F" in method "M")"), error_code_); \
    156161    } \
    157162} while (0)
Note: See TracChangeset for help on using the changeset viewer.