From 2448bde58fcd8b1ab3a957b9fbbf838fd138bac9 Mon Sep 17 00:00:00 2001 From: Peter Kapec Date: Fri, 27 Sep 2019 21:29:40 +0200 Subject: [PATCH] [Fix] add libomp documentation for OSX, fix missing namespaces, fix screen flicker --- README.md | 2 +- src/gl1_gradient/gl1_gradient.cpp | 2 +- src/gl2_texture/gl2_texture.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a43b6da..91de8d6 100644 --- a/README.md +++ b/README.md @@ -151,7 +151,7 @@ sudo apt-get install build-essential cmake libglew-dev libglfw3-dev libglm-dev On macOS install [Homebrew](http://brew.sh) package manager and install the dependencies using the following commands in terminal. Note that the installation of Homebrew expects __XCode__ to be installed, this can be simply downloaded from the app store. ```bash -brew install cmake glm glfw glew +brew install cmake glm glfw glew libomp ``` You can also install CMake and use it to generate project files for your IDE of choice. diff --git a/src/gl1_gradient/gl1_gradient.cpp b/src/gl1_gradient/gl1_gradient.cpp index f8cbab7..17f233d 100644 --- a/src/gl1_gradient/gl1_gradient.cpp +++ b/src/gl1_gradient/gl1_gradient.cpp @@ -90,7 +90,7 @@ class GradientWindow : public ppgso::Window { /*! * Window refresh implementation that will be called automatically from pollEvents when needed */ - void onRefresh() override { + void onIdle() override { // Set gray background glClearColor(.5, .5, .5, 0); diff --git a/src/gl2_texture/gl2_texture.cpp b/src/gl2_texture/gl2_texture.cpp index e24f61e..08e2244 100644 --- a/src/gl2_texture/gl2_texture.cpp +++ b/src/gl2_texture/gl2_texture.cpp @@ -31,7 +31,7 @@ class TextureWindow : public ppgso::Window { * @param width Width of the image to load * @param height Height of the image to load */ - void loadImage(const string &image_file, int width, int height) { + void loadImage(const std::string &image_file, int width, int height) { // Create new OpenGL texture object identifier glGenTextures(1, &texture_id); glBindTexture(GL_TEXTURE_2D, texture_id); @@ -44,7 +44,7 @@ class TextureWindow : public ppgso::Window { std::ifstream image_stream(image_file, std::ios::binary); // Setup buffer for pixels (r,g,b bytes), since we will not manipulate the image just keep it as char - vector buffer(static_cast(width * height * 3)); + std::vector buffer(static_cast(width * height * 3)); image_stream.read(buffer.data(), static_cast(buffer.size())); image_stream.close(); @@ -88,7 +88,7 @@ class TextureWindow : public ppgso::Window { /*! * Window refresh implementation that will be called automatically from pollEvents when needed */ - void onRefresh() override { + void onIdle() override { // Set gray background glClearColor(.5f, .5f, .5f, 0);