Skip to content
Snippets Groups Projects
Commit 672fbeeb authored by Cédric Traizet's avatar Cédric Traizet
Browse files

WRG: move gl::error implementation to the header so it is not exported in a...

WRG: move gl::error implementation to the header so it is not exported in a dll in windows as std::runtime_error is not a dll interface (C4275)
parent aba8cbe0
No related branches found
No related tags found
No related merge requests found
......@@ -34,6 +34,8 @@
#include <iostream>
#include <stdexcept>
#include <sstream>
namespace otb { namespace gl {
......@@ -44,7 +46,17 @@ struct OTBIce_EXPORT Error : public std::runtime_error
{
/** Construct an OpenGL exception related to the OpenGL error code.
*/
Error( GLenum code );
Error( GLenum code ):
std::runtime_error(
[ code ]()
{
std::ostringstream oss;
oss << "OpenGL error #" << code << ": '" << gluErrorString( code ) << "'";
return oss.str();
}()
) {}
}; // End class GlError
......
......@@ -21,7 +21,6 @@
set(OTBICE_SRCS
otbGeoInterface.cxx
otbGlActor.cxx
otbGlError.cxx
otbGlImageActor.cxx
otbGlMesh.cxx
otbGlROIActor.cxx
......
/*
* Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "otbGlError.h"
#include <sstream>
// This
namespace otb
{
namespace gl
{
Error
::Error( GLenum code ) :
std::runtime_error(
[ code ]()
{
std::ostringstream oss;
oss << "OpenGL error #" << code << ": '" << gluErrorString( code ) << "'";
return oss.str();
}()
)
{
}
} // End namespace 'gl'.
} // End namespace 'otb'.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment