Avoid overuse of 'std::endl'

This commit is contained in:
Vittorio Romeo 2022-02-16 14:34:15 +00:00
parent 5fee1aad7d
commit b069f88127
21 changed files with 90 additions and 89 deletions

View File

@ -59,19 +59,19 @@ int main()
do do
{ {
// Main FTP menu // Main FTP menu
std::cout << std::endl; std::cout << '\n'
std::cout << "Choose an action:" << std::endl; << "Choose an action:\n"
std::cout << "1. Print working directory" << std::endl; << "1. Print working directory\n"
std::cout << "2. Print contents of working directory" << std::endl; << "2. Print contents of working directory\n"
std::cout << "3. Change directory" << std::endl; << "3. Change directory\n"
std::cout << "4. Create directory" << std::endl; << "4. Create directory\n"
std::cout << "5. Delete directory" << std::endl; << "5. Delete directory\n"
std::cout << "6. Rename file" << std::endl; << "6. Rename file\n"
std::cout << "7. Remove file" << std::endl; << "7. Remove file\n"
std::cout << "8. Download file" << std::endl; << "8. Download file\n"
std::cout << "9. Upload file" << std::endl; << "9. Upload file\n"
std::cout << "0. Disconnect" << std::endl; << "0. Disconnect\n"
std::cout << std::endl; << std::endl;
std::cout << "Your choice: "; std::cout << "Your choice: ";
std::cin >> choice; std::cin >> choice;
@ -92,8 +92,8 @@ int main()
{ {
// Print the current server directory // Print the current server directory
sf::Ftp::DirectoryResponse response = server.getWorkingDirectory(); sf::Ftp::DirectoryResponse response = server.getWorkingDirectory();
std::cout << response << std::endl; std::cout << response << '\n'
std::cout << "Current directory is " << response.getDirectory() << std::endl; << "Current directory is " << response.getDirectory() << std::endl;
break; break;
} }
@ -101,9 +101,10 @@ int main()
{ {
// Print the contents of the current server directory // Print the contents of the current server directory
sf::Ftp::ListingResponse response = server.getDirectoryListing(); sf::Ftp::ListingResponse response = server.getDirectoryListing();
std::cout << response << std::endl; std::cout << response << '\n';
for (const std::string& name : response.getListing()) for (const std::string& name : response.getListing())
std::cout << name << std::endl; std::cout << name << '\n';
std::cout.flush();
break; break;
} }
@ -193,8 +194,8 @@ int main()
} while (choice != 0); } while (choice != 0);
// Disconnect from the server // Disconnect from the server
std::cout << "Disconnecting from server..." << std::endl; std::cout << "Disconnecting from server...\n"
std::cout << server.disconnect() << std::endl; << server.disconnect() << '\n';
// Wait until the user presses 'enter' key // Wait until the user presses 'enter' key
std::cout << "Press enter to exit..." << std::endl; std::cout << "Press enter to exit..." << std::endl;

View File

@ -246,7 +246,7 @@ int main()
<< "Use the arrow keys to change the values.\nUse the return key to regenerate the terrain.\n\n"; << "Use the arrow keys to change the values.\nUse the return key to regenerate the terrain.\n\n";
for (int i = 0; i < settingCount; ++i) for (int i = 0; i < settingCount; ++i)
osstr << ((i == currentSetting) ? ">> " : " ") << settings[i].name << ": " << *(settings[i].value) << "\n"; osstr << ((i == currentSetting) ? ">> " : " ") << settings[i].name << ": " << *(settings[i].value) << '\n';
hudText.setString(osstr.str()); hudText.setString(osstr.str());

View File

@ -31,14 +31,14 @@ void runTcpServer(unsigned short port)
const char out[] = "Hi, I'm the server"; const char out[] = "Hi, I'm the server";
if (socket.send(out, sizeof(out)) != sf::Socket::Done) if (socket.send(out, sizeof(out)) != sf::Socket::Done)
return; return;
std::cout << "Message sent to the client: \"" << out << "\"" << std::endl; std::cout << "Message sent to the client: \"" << out << '"' << std::endl;
// Receive a message back from the client // Receive a message back from the client
char in[128]; char in[128];
std::size_t received; std::size_t received;
if (socket.receive(in, sizeof(in), received) != sf::Socket::Done) if (socket.receive(in, sizeof(in), received) != sf::Socket::Done)
return; return;
std::cout << "Answer received from the client: \"" << in << "\"" << std::endl; std::cout << "Answer received from the client: \"" << in << '"' << std::endl;
} }
@ -71,11 +71,11 @@ void runTcpClient(unsigned short port)
std::size_t received; std::size_t received;
if (socket.receive(in, sizeof(in), received) != sf::Socket::Done) if (socket.receive(in, sizeof(in), received) != sf::Socket::Done)
return; return;
std::cout << "Message received from the server: \"" << in << "\"" << std::endl; std::cout << "Message received from the server: \"" << in << '"' << std::endl;
// Send an answer to the server // Send an answer to the server
const char out[] = "Hi, I'm a client"; const char out[] = "Hi, I'm a client";
if (socket.send(out, sizeof(out)) != sf::Socket::Done) if (socket.send(out, sizeof(out)) != sf::Socket::Done)
return; return;
std::cout << "Message sent to the server: \"" << out << "\"" << std::endl; std::cout << "Message sent to the server: \"" << out << '"' << std::endl;
} }

View File

@ -27,13 +27,13 @@ void runUdpServer(unsigned short port)
unsigned short senderPort; unsigned short senderPort;
if (socket.receive(in, sizeof(in), received, sender, senderPort) != sf::Socket::Done) if (socket.receive(in, sizeof(in), received, sender, senderPort) != sf::Socket::Done)
return; return;
std::cout << "Message received from client " << sender << ": \"" << in << "\"" << std::endl; std::cout << "Message received from client " << sender << ": \"" << in << '"' << std::endl;
// Send an answer to the client // Send an answer to the client
const char out[] = "Hi, I'm the server"; const char out[] = "Hi, I'm the server";
if (socket.send(out, sizeof(out), sender, senderPort) != sf::Socket::Done) if (socket.send(out, sizeof(out), sender, senderPort) != sf::Socket::Done)
return; return;
std::cout << "Message sent to the client: \"" << out << "\"" << std::endl; std::cout << "Message sent to the client: \"" << out << '"' << std::endl;
} }
@ -59,7 +59,7 @@ void runUdpClient(unsigned short port)
const char out[] = "Hi, I'm a client"; const char out[] = "Hi, I'm a client";
if (socket.send(out, sizeof(out), server, port) != sf::Socket::Done) if (socket.send(out, sizeof(out), server, port) != sf::Socket::Done)
return; return;
std::cout << "Message sent to the server: \"" << out << "\"" << std::endl; std::cout << "Message sent to the server: \"" << out << '"' << std::endl;
// Receive an answer from anyone (but most likely from the server) // Receive an answer from anyone (but most likely from the server)
char in[128]; char in[128];
@ -68,5 +68,5 @@ void runUdpClient(unsigned short port)
unsigned short senderPort; unsigned short senderPort;
if (socket.receive(in, sizeof(in), received, sender, senderPort) != sf::Socket::Done) if (socket.receive(in, sizeof(in), received, sender, senderPort) != sf::Socket::Done)
return; return;
std::cout << "Message received from " << sender << ": \"" << in << "\"" << std::endl; std::cout << "Message received from " << sender << ": \"" << in << '"' << std::endl;
} }

View File

@ -19,10 +19,10 @@ void playSound()
return; return;
// Display sound informations // Display sound informations
std::cout << "killdeer.wav:" << std::endl; std::cout << "killdeer.wav:" << '\n'
std::cout << " " << buffer.getDuration().asSeconds() << " seconds" << std::endl; << " " << buffer.getDuration().asSeconds() << " seconds" << '\n'
std::cout << " " << buffer.getSampleRate() << " samples / sec" << std::endl; << " " << buffer.getSampleRate() << " samples / sec" << '\n'
std::cout << " " << buffer.getChannelCount() << " channels" << std::endl; << " " << buffer.getChannelCount() << " channels" << std::endl;
// Create a sound instance and play it // Create a sound instance and play it
sf::Sound sound(buffer); sf::Sound sound(buffer);
@ -54,10 +54,10 @@ void playMusic(const std::string& filename)
return; return;
// Display music informations // Display music informations
std::cout << filename << ":" << std::endl; std::cout << filename << ":" << '\n'
std::cout << " " << music.getDuration().asSeconds() << " seconds" << std::endl; << " " << music.getDuration().asSeconds() << " seconds" << '\n'
std::cout << " " << music.getSampleRate() << " samples / sec" << std::endl; << " " << music.getSampleRate() << " samples / sec" << '\n'
std::cout << " " << music.getChannelCount() << " channels" << std::endl; << " " << music.getChannelCount() << " channels" << std::endl;
// Play it // Play it
music.play(); music.play();
@ -72,7 +72,7 @@ void playMusic(const std::string& filename)
std::cout << "\rPlaying... " << music.getPlayingOffset().asSeconds() << " sec "; std::cout << "\rPlaying... " << music.getPlayingOffset().asSeconds() << " sec ";
std::cout << std::flush; std::cout << std::flush;
} }
std::cout << std::endl << std::endl; std::cout << '\n' << std::endl;
} }

View File

@ -50,10 +50,10 @@ int main()
const sf::SoundBuffer& buffer = recorder.getBuffer(); const sf::SoundBuffer& buffer = recorder.getBuffer();
// Display captured sound informations // Display captured sound informations
std::cout << "Sound information:" << std::endl; std::cout << "Sound information:" << '\n'
std::cout << " " << buffer.getDuration().asSeconds() << " seconds" << std::endl; << " " << buffer.getDuration().asSeconds() << " seconds" << '\n'
std::cout << " " << buffer.getSampleRate() << " samples / seconds" << std::endl; << " " << buffer.getSampleRate() << " samples / seconds" << '\n'
std::cout << " " << buffer.getChannelCount() << " channels" << std::endl; << " " << buffer.getChannelCount() << " channels" << std::endl;
// Choose what to do with the recorded sound data // Choose what to do with the recorded sound data
char choice; char choice;
@ -91,7 +91,7 @@ int main()
} }
// Finished! // Finished!
std::cout << std::endl << "Done!" << std::endl; std::cout << '\n' << "Done!" << std::endl;
// Wait until the user presses 'enter' key // Wait until the user presses 'enter' key
std::cout << "Press enter to exit..." << std::endl; std::cout << "Press enter to exit..." << std::endl;

View File

@ -272,10 +272,10 @@ private:
/// /* error */; /// /* error */;
/// ///
/// // Print the sound attributes /// // Print the sound attributes
/// std::cout << "duration: " << file.getDuration().asSeconds() << std::endl; /// std::cout << "duration: " << file.getDuration().asSeconds() << '\n'
/// std::cout << "channels: " << file.getChannelCount() << std::endl; /// << "channels: " << file.getChannelCount() << '\n'
/// std::cout << "sample rate: " << file.getSampleRate() << std::endl; /// << "sample rate: " << file.getSampleRate() << '\n'
/// std::cout << "sample count: " << file.getSampleCount() << std::endl; /// << "sample count: " << file.getSampleCount() << std::endl;
/// ///
/// // Read and process batches of samples until the end of file is reached /// // Read and process batches of samples until the end of file is reached
/// sf::Int16 samples[1024]; /// sf::Int16 samples[1024];

View File

@ -97,7 +97,7 @@ void alCheckError(const char* file, unsigned int line, const char* expression)
err() << "An internal OpenAL call failed in " err() << "An internal OpenAL call failed in "
<< fileString.substr(fileString.find_last_of("\\/") + 1) << "(" << line << ")." << fileString.substr(fileString.find_last_of("\\/") + 1) << "(" << line << ")."
<< "\nExpression:\n " << expression << "\nExpression:\n " << expression
<< "\nError description:\n " << error << "\n " << description << "\n" << "\nError description:\n " << error << "\n " << description << '\n'
<< std::endl; << std::endl;
} }
} }

View File

@ -111,7 +111,7 @@ bool SoundFileWriterWav::open(const std::string& filename, unsigned int sampleRa
// Write the header // Write the header
if (!writeHeader(sampleRate, channelCount)) if (!writeHeader(sampleRate, channelCount))
{ {
err() << "Failed to write header of WAV sound file \"" << filename << "\"" << std::endl; err() << "Failed to write header of WAV sound file \"" << filename << '"' << std::endl;
return false; return false;
} }

View File

@ -104,7 +104,7 @@ void glCheckError(const char* file, unsigned int line, const char* expression)
err() << "An internal OpenGL call failed in " err() << "An internal OpenGL call failed in "
<< fileString.substr(fileString.find_last_of("\\/") + 1) << "(" << line << ")." << fileString.substr(fileString.find_last_of("\\/") + 1) << "(" << line << ")."
<< "\nExpression:\n " << expression << "\nExpression:\n " << expression
<< "\nError description:\n " << error << "\n " << description << "\n" << "\nError description:\n " << error << "\n " << description << '\n'
<< std::endl; << std::endl;
} }
} }

View File

@ -94,8 +94,8 @@ void ensureExtensionsInit()
if ((majorVersion < 1) || ((majorVersion == 1) && (minorVersion < 1))) if ((majorVersion < 1) || ((majorVersion == 1) && (minorVersion < 1)))
{ {
err() << "sfml-graphics requires support for OpenGL 1.1 or greater" << std::endl; err() << "sfml-graphics requires support for OpenGL 1.1 or greater" << '\n'
err() << "Ensure that hardware acceleration is enabled if available" << std::endl; << "Ensure that hardware acceleration is enabled if available" << std::endl;
} }
} }
} }

View File

@ -277,7 +277,7 @@ bool ImageLoader::saveImageToFile(const std::string& filename, const std::vector
} }
} }
err() << "Failed to save image \"" << filename << "\"" << std::endl; err() << "Failed to save image \"" << filename << '"' << std::endl;
return false; return false;
} }
@ -318,7 +318,7 @@ bool ImageLoader::saveImageToMemory(const std::string& format, std::vector<sf::U
} }
} }
err() << "Failed to save image with format \"" << format << "\"" << std::endl; err() << "Failed to save image with format \"" << format << '"' << std::endl;
return false; return false;
} }

View File

@ -128,9 +128,9 @@ namespace
static bool warned = false; static bool warned = false;
if (!warned) if (!warned)
{ {
sf::err() << "OpenGL extension EXT_blend_minmax or EXT_blend_subtract unavailable" << std::endl; sf::err() << "OpenGL extension EXT_blend_minmax or EXT_blend_subtract unavailable" << '\n'
sf::err() << "Some blending equations will fallback to sf::BlendMode::Add" << std::endl; << "Some blending equations will fallback to sf::BlendMode::Add" << '\n'
sf::err() << "Ensure that hardware acceleration is enabled if available" << std::endl; << "Ensure that hardware acceleration is enabled if available" << std::endl;
warned = true; warned = true;
} }
@ -631,8 +631,8 @@ void RenderTarget::applyBlendMode(const BlendMode& mode)
#else #else
err() << "OpenGL extension EXT_blend_minmax and EXT_blend_subtract unavailable" << std::endl; err() << "OpenGL extension EXT_blend_minmax and EXT_blend_subtract unavailable" << std::endl;
#endif #endif
err() << "Selecting a blend equation not possible" << std::endl; err() << "Selecting a blend equation not possible" << '\n'
err() << "Ensure that hardware acceleration is enabled if available" << std::endl; << "Ensure that hardware acceleration is enabled if available" << std::endl;
warned = true; warned = true;
} }

View File

@ -242,8 +242,8 @@ bool RenderTextureImplFBO::create(unsigned int width, unsigned int height, unsig
if (settings.antialiasingLevel > static_cast<unsigned int>(samples)) if (settings.antialiasingLevel > static_cast<unsigned int>(samples))
{ {
err() << "Impossible to create render texture (unsupported anti-aliasing level)"; err() << "Impossible to create render texture (unsupported anti-aliasing level)"
err() << " Requested: " << settings.antialiasingLevel << " Maximum supported: " << samples << std::endl; << " Requested: " << settings.antialiasingLevel << " Maximum supported: " << samples << std::endl;
return false; return false;
} }
} }

View File

@ -259,7 +259,7 @@ bool Shader::loadFromFile(const std::string& filename, Type type)
std::vector<char> shader; std::vector<char> shader;
if (!getFileContents(filename, shader)) if (!getFileContents(filename, shader))
{ {
err() << "Failed to open shader file \"" << filename << "\"" << std::endl; err() << "Failed to open shader file \"" << filename << '"' << std::endl;
return false; return false;
} }
@ -280,7 +280,7 @@ bool Shader::loadFromFile(const std::string& vertexShaderFilename, const std::st
std::vector<char> vertexShader; std::vector<char> vertexShader;
if (!getFileContents(vertexShaderFilename, vertexShader)) if (!getFileContents(vertexShaderFilename, vertexShader))
{ {
err() << "Failed to open vertex shader file \"" << vertexShaderFilename << "\"" << std::endl; err() << "Failed to open vertex shader file \"" << vertexShaderFilename << '"' << std::endl;
return false; return false;
} }
@ -288,7 +288,7 @@ bool Shader::loadFromFile(const std::string& vertexShaderFilename, const std::st
std::vector<char> fragmentShader; std::vector<char> fragmentShader;
if (!getFileContents(fragmentShaderFilename, fragmentShader)) if (!getFileContents(fragmentShaderFilename, fragmentShader))
{ {
err() << "Failed to open fragment shader file \"" << fragmentShaderFilename << "\"" << std::endl; err() << "Failed to open fragment shader file \"" << fragmentShaderFilename << '"' << std::endl;
return false; return false;
} }
@ -304,7 +304,7 @@ bool Shader::loadFromFile(const std::string& vertexShaderFilename, const std::st
std::vector<char> vertexShader; std::vector<char> vertexShader;
if (!getFileContents(vertexShaderFilename, vertexShader)) if (!getFileContents(vertexShaderFilename, vertexShader))
{ {
err() << "Failed to open vertex shader file \"" << vertexShaderFilename << "\"" << std::endl; err() << "Failed to open vertex shader file \"" << vertexShaderFilename << '"' << std::endl;
return false; return false;
} }
@ -312,7 +312,7 @@ bool Shader::loadFromFile(const std::string& vertexShaderFilename, const std::st
std::vector<char> geometryShader; std::vector<char> geometryShader;
if (!getFileContents(geometryShaderFilename, geometryShader)) if (!getFileContents(geometryShaderFilename, geometryShader))
{ {
err() << "Failed to open geometry shader file \"" << geometryShaderFilename << "\"" << std::endl; err() << "Failed to open geometry shader file \"" << geometryShaderFilename << '"' << std::endl;
return false; return false;
} }
@ -320,7 +320,7 @@ bool Shader::loadFromFile(const std::string& vertexShaderFilename, const std::st
std::vector<char> fragmentShader; std::vector<char> fragmentShader;
if (!getFileContents(fragmentShaderFilename, fragmentShader)) if (!getFileContents(fragmentShaderFilename, fragmentShader))
{ {
err() << "Failed to open fragment shader file \"" << fragmentShaderFilename << "\"" << std::endl; err() << "Failed to open fragment shader file \"" << fragmentShaderFilename << '"' << std::endl;
return false; return false;
} }
@ -817,7 +817,7 @@ bool Shader::compile(const char* vertexShaderCode, const char* geometryShaderCod
{ {
char log[1024]; char log[1024];
glCheck(GLEXT_glGetInfoLog(vertexShader, sizeof(log), nullptr, log)); glCheck(GLEXT_glGetInfoLog(vertexShader, sizeof(log), nullptr, log));
err() << "Failed to compile vertex shader:" << std::endl err() << "Failed to compile vertex shader:" << '\n'
<< log << std::endl; << log << std::endl;
glCheck(GLEXT_glDeleteObject(vertexShader)); glCheck(GLEXT_glDeleteObject(vertexShader));
glCheck(GLEXT_glDeleteObject(shaderProgram)); glCheck(GLEXT_glDeleteObject(shaderProgram));
@ -844,7 +844,7 @@ bool Shader::compile(const char* vertexShaderCode, const char* geometryShaderCod
{ {
char log[1024]; char log[1024];
glCheck(GLEXT_glGetInfoLog(geometryShader, sizeof(log), nullptr, log)); glCheck(GLEXT_glGetInfoLog(geometryShader, sizeof(log), nullptr, log));
err() << "Failed to compile geometry shader:" << std::endl err() << "Failed to compile geometry shader:" << '\n'
<< log << std::endl; << log << std::endl;
glCheck(GLEXT_glDeleteObject(geometryShader)); glCheck(GLEXT_glDeleteObject(geometryShader));
glCheck(GLEXT_glDeleteObject(shaderProgram)); glCheck(GLEXT_glDeleteObject(shaderProgram));
@ -872,7 +872,7 @@ bool Shader::compile(const char* vertexShaderCode, const char* geometryShaderCod
{ {
char log[1024]; char log[1024];
glCheck(GLEXT_glGetInfoLog(fragmentShader, sizeof(log), nullptr, log)); glCheck(GLEXT_glGetInfoLog(fragmentShader, sizeof(log), nullptr, log));
err() << "Failed to compile fragment shader:" << std::endl err() << "Failed to compile fragment shader:" << '\n'
<< log << std::endl; << log << std::endl;
glCheck(GLEXT_glDeleteObject(fragmentShader)); glCheck(GLEXT_glDeleteObject(fragmentShader));
glCheck(GLEXT_glDeleteObject(shaderProgram)); glCheck(GLEXT_glDeleteObject(shaderProgram));
@ -894,7 +894,7 @@ bool Shader::compile(const char* vertexShaderCode, const char* geometryShaderCod
{ {
char log[1024]; char log[1024];
glCheck(GLEXT_glGetInfoLog(shaderProgram, sizeof(log), nullptr, log)); glCheck(GLEXT_glGetInfoLog(shaderProgram, sizeof(log), nullptr, log));
err() << "Failed to link shader:" << std::endl err() << "Failed to link shader:" << '\n'
<< log << std::endl; << log << std::endl;
glCheck(GLEXT_glDeleteObject(shaderProgram)); glCheck(GLEXT_glDeleteObject(shaderProgram));
return false; return false;

View File

@ -175,9 +175,9 @@ bool Texture::create(unsigned int width, unsigned int height)
if (!warned) if (!warned)
{ {
err() << "OpenGL extension SGIS_texture_edge_clamp unavailable" << std::endl; err() << "OpenGL extension SGIS_texture_edge_clamp unavailable" << '\n'
err() << "Artifacts may occur along texture edges" << std::endl; << "Artifacts may occur along texture edges" << '\n'
err() << "Ensure that hardware acceleration is enabled if available" << std::endl; << "Ensure that hardware acceleration is enabled if available" << std::endl;
warned = true; warned = true;
} }
@ -192,9 +192,9 @@ bool Texture::create(unsigned int width, unsigned int height)
if (!warned) if (!warned)
{ {
#ifndef SFML_OPENGL_ES #ifndef SFML_OPENGL_ES
err() << "OpenGL extension EXT_texture_sRGB unavailable" << std::endl; err() << "OpenGL extension EXT_texture_sRGB unavailable" << '\n';
#else #else
err() << "OpenGL ES extension EXT_sRGB unavailable" << std::endl; err() << "OpenGL ES extension EXT_sRGB unavailable" << '\n';
#endif #endif
err() << "Automatic sRGB to linear conversion disabled" << std::endl; err() << "Automatic sRGB to linear conversion disabled" << std::endl;
@ -668,9 +668,9 @@ void Texture::setRepeated(bool repeated)
if (!warned) if (!warned)
{ {
err() << "OpenGL extension SGIS_texture_edge_clamp unavailable" << std::endl; err() << "OpenGL extension SGIS_texture_edge_clamp unavailable" << '\n'
err() << "Artifacts may occur along texture edges" << std::endl; << "Artifacts may occur along texture edges" << '\n'
err() << "Ensure that hardware acceleration is enabled if available" << std::endl; << "Ensure that hardware acceleration is enabled if available" << std::endl;
warned = true; warned = true;
} }

View File

@ -497,7 +497,7 @@ Ftp::Response Ftp::getResponse()
// Append it to the current message // Append it to the current message
std::ostringstream out; std::ostringstream out;
out << code << separator << line << "\n"; out << code << separator << line << '\n';
message += out.str(); message += out.str();
} }
} }

View File

@ -156,7 +156,7 @@ void eglCheckError(const char* file, unsigned int line, const char* expression)
err() << "An internal EGL call failed in " err() << "An internal EGL call failed in "
<< fileString.substr(fileString.find_last_of("\\/") + 1) << " (" << line << ") : " << fileString.substr(fileString.find_last_of("\\/") + 1) << " (" << line << ") : "
<< "\nExpression:\n " << expression << "\nExpression:\n " << expression
<< "\nError description:\n " << error << "\n " << description << "\n" << "\nError description:\n " << error << "\n " << description << '\n'
<< std::endl; << std::endl;
} }
} }

View File

@ -926,7 +926,7 @@ void GlContext::checkSettings(const ContextSettings& requestedSettings)
{ {
if ((std::strcmp(vendorName, "Microsoft Corporation") == 0) && (std::strcmp(rendererName, "GDI Generic") == 0)) if ((std::strcmp(vendorName, "Microsoft Corporation") == 0) && (std::strcmp(rendererName, "GDI Generic") == 0))
{ {
err() << "Warning: Detected \"Microsoft Corporation GDI Generic\" OpenGL implementation" << std::endl err() << "Warning: Detected \"Microsoft Corporation GDI Generic\" OpenGL implementation" << '\n'
<< "The current OpenGL implementation is not hardware-accelerated" << std::endl; << "The current OpenGL implementation is not hardware-accelerated" << std::endl;
} }
} }
@ -941,8 +941,8 @@ void GlContext::checkSettings(const ContextSettings& requestedSettings)
(m_settings.depthBits < requestedSettings.depthBits) || (m_settings.depthBits < requestedSettings.depthBits) ||
(!m_settings.sRgbCapable && requestedSettings.sRgbCapable)) (!m_settings.sRgbCapable && requestedSettings.sRgbCapable))
{ {
err() << "Warning: The created OpenGL context does not fully meet the settings that were requested" << std::endl; err() << "Warning: The created OpenGL context does not fully meet the settings that were requested" << '\n'
err() << "Requested: version = " << requestedSettings.majorVersion << "." << requestedSettings.minorVersion << "Requested: version = " << requestedSettings.majorVersion << "." << requestedSettings.minorVersion
<< " ; depth bits = " << requestedSettings.depthBits << " ; depth bits = " << requestedSettings.depthBits
<< " ; stencil bits = " << requestedSettings.stencilBits << " ; stencil bits = " << requestedSettings.stencilBits
<< " ; AA level = " << requestedSettings.antialiasingLevel << " ; AA level = " << requestedSettings.antialiasingLevel
@ -950,8 +950,8 @@ void GlContext::checkSettings(const ContextSettings& requestedSettings)
<< " ; core = " << ((requestedSettings.attributeFlags & ContextSettings::Core) != 0) << " ; core = " << ((requestedSettings.attributeFlags & ContextSettings::Core) != 0)
<< " ; debug = " << ((requestedSettings.attributeFlags & ContextSettings::Debug) != 0) << " ; debug = " << ((requestedSettings.attributeFlags & ContextSettings::Debug) != 0)
<< " ; sRGB = " << requestedSettings.sRgbCapable << " ; sRGB = " << requestedSettings.sRgbCapable
<< std::noboolalpha << std::endl; << std::noboolalpha << '\n'
err() << "Created: version = " << m_settings.majorVersion << "." << m_settings.minorVersion << "Created: version = " << m_settings.majorVersion << "." << m_settings.minorVersion
<< " ; depth bits = " << m_settings.depthBits << " ; depth bits = " << m_settings.depthBits
<< " ; stencil bits = " << m_settings.stencilBits << " ; stencil bits = " << m_settings.stencilBits
<< " ; AA level = " << m_settings.antialiasingLevel << " ; AA level = " << m_settings.antialiasingLevel

View File

@ -414,7 +414,7 @@ void WglContext::setDevicePixelFormat(unsigned int bitsPerPixel)
if (bestFormat == 0) if (bestFormat == 0)
{ {
err() << "Failed to find a suitable pixel format for device context: " << getErrorString(GetLastError()).toAnsiString() << std::endl err() << "Failed to find a suitable pixel format for device context: " << getErrorString(GetLastError()).toAnsiString() << '\n'
<< "Cannot create OpenGL context" << std::endl; << "Cannot create OpenGL context" << std::endl;
return; return;
} }
@ -428,7 +428,7 @@ void WglContext::setDevicePixelFormat(unsigned int bitsPerPixel)
// Set the chosen pixel format // Set the chosen pixel format
if (SetPixelFormat(m_deviceContext, bestFormat, &actualFormat) == FALSE) if (SetPixelFormat(m_deviceContext, bestFormat, &actualFormat) == FALSE)
{ {
err() << "Failed to set pixel format for device context: " << getErrorString(GetLastError()).toAnsiString() << std::endl err() << "Failed to set pixel format for device context: " << getErrorString(GetLastError()).toAnsiString() << '\n'
<< "Cannot create OpenGL context" << std::endl; << "Cannot create OpenGL context" << std::endl;
return; return;
} }