diff --git a/include/MACE/Graphics/Context.h b/include/MACE/Graphics/Context.h index e882f0483..09ee3eb45 100644 --- a/include/MACE/Graphics/Context.h +++ b/include/MACE/Graphics/Context.h @@ -384,7 +384,7 @@ namespace mc { const Vector& getTransform() const; void setTransform(const Vector& trans); - void bind() const; + void bind() const override; void bind(const unsigned int location) const; void unbind() const override; diff --git a/include/MACE/Graphics/Entity2D.h b/include/MACE/Graphics/Entity2D.h index ff7eafc9b..7a8ec8235 100644 --- a/include/MACE/Graphics/Entity2D.h +++ b/include/MACE/Graphics/Entity2D.h @@ -319,7 +319,7 @@ namespace mc { class Button: public Entity2D, public Selectable, public Texturable { public: - void setTexture(const Texture& c); + void setTexture(const Texture& c) override; const Texture& getTexture() const override; Texture& getTexture() override; diff --git a/include/MACE/Graphics/OGL/Shaders/mc_frag.glsl b/include/MACE/Graphics/OGL/Shaders/mc_frag.glsl index 6d675da88..c823f59d9 100644 --- a/include/MACE/Graphics/OGL/Shaders/mc_frag.glsl +++ b/include/MACE/Graphics/OGL/Shaders/mc_frag.glsl @@ -14,7 +14,7 @@ layout(location = MACE__ID_ATTACHMENT_INDEX) out uint _mc_OutID; uniform uint mc_EntityID; vec4 _mcGetTexture(const sampler2D mc_Sampler, const _mc_TextureAttachment mc_Tex){ - vec4 mc_Fragment = texture2D(mc_Sampler, _mcTextureCoord * mc_Tex.mc_TextureTransform.wz + mc_Tex.mc_TextureTransform.xy); + vec4 mc_Fragment = texture(mc_Sampler, _mcTextureCoord * mc_Tex.mc_TextureTransform.wz + mc_Tex.mc_TextureTransform.xy); return vec4(mix(mc_Tex.mc_Color.rgb, mc_Fragment.rgb, 1.0f - mc_Tex.mc_Color.a), mc_Fragment.a);; } diff --git a/scripts/install-apt.sh b/scripts/install-apt.sh index a5e8997b6..b8ccb08fb 100644 --- a/scripts/install-apt.sh +++ b/scripts/install-apt.sh @@ -1,6 +1,5 @@ #!/bin/bash -apt-get install libopencv-dev xorg-dev libopenal-dev libfreetype6 libfreetype6-dev libglu1-mesa-dev libglew-dev -apt-get update +apt-get install libopencv-dev libopenal-dev libfreetype6 libfreetype6-dev libglew-dev git clone https://github.com/glfw/glfw.git ../build/glfw cd ../build/glfw git checkout latest diff --git a/scripts/travis-install.sh b/scripts/travis-install.sh index b22e3ceb2..7c96397e1 100644 --- a/scripts/travis-install.sh +++ b/scripts/travis-install.sh @@ -6,4 +6,15 @@ fi if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo ./scripts/install-apt.sh; + add-apt-repository -y ppa:oibaf/graphics-drivers; + sudo apt-get install xorg-dev libgl1-mesa-dev libgl1-mesa-glx mesa-common-dev libglapi-mesa libgbm1 libgl1-mesa-dri libxatracker-dev xvfb + apt-get update --qq -y; + export DEBIAN_FRONTEND=noninteractive; + export DISPLAY=:99l + export LIBGL_ALWAYS_SOFTWARE=1; + xpra --xvfb="Xorg +extension GLX +extension RANDR +extension RENDER -config `pwd`/test/dummy.xorg.conf -logfile ${HOME}/.xpra/xorg.log" start :99; + sleep 3 ; + LIBGL_ALWAYS_SOFTWARE=1 glxinfo; + glxinfo; + cat ${HOME}/.xpra/xorg.log; fi \ No newline at end of file diff --git a/src/Graphics/OGL/OGL33Context.cpp b/src/Graphics/OGL/OGL33Context.cpp index 5bb285c1f..bfc50e21e 100644 --- a/src/Graphics/OGL/OGL33Context.cpp +++ b/src/Graphics/OGL/OGL33Context.cpp @@ -152,7 +152,7 @@ namespace mc { } else if (filter == Enums::ResizeFilter::NEAREST) { setParameter(GL_TEXTURE_MIN_FILTER, GL_NEAREST); } else { - MACE__THROW(UnsupportedRenderer, "Unsupported ResizeFilter for OpenGL: " + static_cast(filter)); + MACE__THROW(UnsupportedRenderer, "Unsupported ResizeFilter for OpenGL: " + std::to_string(static_cast(filter))); } } @@ -165,7 +165,7 @@ namespace mc { } else if (filter == Enums::ResizeFilter::NEAREST) { setParameter(GL_TEXTURE_MAG_FILTER, GL_NEAREST); } else { - MACE__THROW(UnsupportedRenderer, "Unsupported ResizeFilter for OpenGL: " + static_cast(filter)); + MACE__THROW(UnsupportedRenderer, "Unsupported ResizeFilter for OpenGL: " + std::to_string(static_cast(filter))); } } @@ -178,7 +178,7 @@ namespace mc { setPixelStorage(GL_UNPACK_ROW_LENGTH, value); break; default: - MACE__THROW(UnsupportedRenderer, "Specified hint is unavailable for OpenGL: " + static_cast(hint)); + MACE__THROW(UnsupportedRenderer, "Specified hint is unavailable for OpenGL: " + std::to_string(static_cast(hint))); } } @@ -191,7 +191,7 @@ namespace mc { setPixelStorage(GL_PACK_ROW_LENGTH, value); break; default: - MACE__THROW(UnsupportedRenderer, "Specified hint is unavailable for OpenGL: " + static_cast(hint)); + MACE__THROW(UnsupportedRenderer, "Specified hint is unavailable for OpenGL: " + std::to_string(static_cast(hint))); } } @@ -205,7 +205,7 @@ namespace mc { } else if (wrap == Enums::WrapMode::MIRROR_CLAMP) { setParameter(GL_TEXTURE_WRAP_S, GL_MIRROR_CLAMP_TO_EDGE); } else { - MACE__THROW(BadFormat, "Unknown wrap mode for OpenGL texture: " + static_cast(wrap)); + MACE__THROW(BadFormat, "Unknown wrap mode for OpenGL texture: " + std::to_string(static_cast(wrap))); } } @@ -219,7 +219,7 @@ namespace mc { } else if (wrap == Enums::WrapMode::MIRROR_CLAMP) { setParameter(GL_TEXTURE_WRAP_T, GL_MIRROR_CLAMP_TO_EDGE); } else { - MACE__THROW(BadFormat, "Unknown wrap mode for OpenGL texture: " + static_cast(wrap)); + MACE__THROW(BadFormat, "Unknown wrap mode for OpenGL texture: " + std::to_string(static_cast(wrap))); } } diff --git a/src/Graphics/Window.cpp b/src/Graphics/Window.cpp index af1a3dcac..4acdc98f6 100644 --- a/src/Graphics/Window.cpp +++ b/src/Graphics/Window.cpp @@ -174,6 +174,7 @@ namespace mc { glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); + glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, true); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_API); @@ -205,7 +206,7 @@ namespace mc { window = createWindow(config); if (versionMinor == 0 && versionMajor > 1 && !window) { - glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_FALSE); + glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, false); versionMinor = 3; --versionMajor; }