Skip to content

Commit

Permalink
Buf fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
ValeriiKoniushenko committed Jul 25, 2023
1 parent d97b67e commit 2ac3b98
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
7 changes: 4 additions & 3 deletions game/assets/shaders/text.vert
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#version 330 core
layout (location = 0) in vec2 aVertex;// <vec2 pos, vec2 tex>
layout (location = 1) in vec2 aUv;// <vec2 pos, vec2 tex>

layout (location = 0) in vec2 aVertex;
layout (location = 1) in vec2 aUv;

out vec2 TexCoords;

Expand All @@ -9,6 +10,6 @@ uniform mat4 uTransform;

void main()
{
gl_Position = uTransform * vec4(aVertex / uResolution, 0.0, 1.0);
TexCoords = aUv;
gl_Position = uTransform * vec4(aVertex / uResolution, 0.0, 1.0);
}
6 changes: 3 additions & 3 deletions game/assets/shaders/widget.vert
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#version 330 core

layout (location = 0) in vec2 aPos;
layout (location = 0) in vec2 aVertex;
layout (location = 1) in vec2 aCv;

out vec2 ioCv;

uniform mat4 uTransform;
uniform vec2 uResolution;
uniform mat4 uTransform;

void main()
{
ioCv = aCv;
gl_Position = uTransform * vec4(aPos / uResolution, 0.0, 1.0);
gl_Position = uTransform * vec4(aVertex / uResolution, 0.0, 1.0);
}
2 changes: 1 addition & 1 deletion game/source/VaKon2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void VaKon2D::start()
Font font("assets/fonts/Roboto-Medium.ttf");
LineText text(font, "Hello world");
text.setTexture(texture);
text.move({100.f, 100.f});
text.setPosition({100.f, 100.f});
text.prepare(shaderPack);

KeyboardInputAction iaWidgetReflector("WidgetReflector", Keyboard::Key::F1);
Expand Down
2 changes: 0 additions & 2 deletions lib/core/input-devices/source/Mouse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ glm::ivec2 Mouse::getPosition(Window& wnd)
POINT p{};
GetCursorPos(&p);
ScreenToClient(wnd.getHwnd(), &p);
p.x += -wnd.getSize().width / 2;
p.y += -wnd.getSize().height / 2;
return glm::ivec2(static_cast<int>(p.x), static_cast<int>(p.y));
}

Expand Down

0 comments on commit 2ac3b98

Please sign in to comment.