Skip to content

Commit

Permalink
minor bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
liavt committed Jul 23, 2017
1 parent 9e1bd76 commit ae6e8f3
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 12 deletions.
2 changes: 1 addition & 1 deletion include/MACE/Graphics/Context.h
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ namespace mc {
const Vector<float, 4>& getTransform() const;
void setTransform(const Vector<float, 4>& trans);

void bind() const;
void bind() const override;
void bind(const unsigned int location) const;
void unbind() const override;

Expand Down
2 changes: 1 addition & 1 deletion include/MACE/Graphics/Entity2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion include/MACE/Graphics/OGL/Shaders/mc_frag.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -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);;
}
Expand Down
3 changes: 1 addition & 2 deletions scripts/install-apt.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
11 changes: 11 additions & 0 deletions scripts/travis-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 6 additions & 6 deletions src/Graphics/OGL/OGL33Context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Byte>(filter));
MACE__THROW(UnsupportedRenderer, "Unsupported ResizeFilter for OpenGL: " + std::to_string(static_cast<Byte>(filter)));
}
}

Expand All @@ -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<Byte>(filter));
MACE__THROW(UnsupportedRenderer, "Unsupported ResizeFilter for OpenGL: " + std::to_string(static_cast<Byte>(filter)));
}
}

Expand All @@ -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<Byte>(hint));
MACE__THROW(UnsupportedRenderer, "Specified hint is unavailable for OpenGL: " + std::to_string(static_cast<Byte>(hint)));
}
}

Expand All @@ -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<Byte>(hint));
MACE__THROW(UnsupportedRenderer, "Specified hint is unavailable for OpenGL: " + std::to_string(static_cast<Byte>(hint)));
}
}

Expand All @@ -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<Byte>(wrap));
MACE__THROW(BadFormat, "Unknown wrap mode for OpenGL texture: " + std::to_string(static_cast<Byte>(wrap)));
}
}

Expand All @@ -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<Byte>(wrap));
MACE__THROW(BadFormat, "Unknown wrap mode for OpenGL texture: " + std::to_string(static_cast<Byte>(wrap)));
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/Graphics/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit ae6e8f3

Please sign in to comment.