Skip to content

Commit

Permalink
minor ref
Browse files Browse the repository at this point in the history
  • Loading branch information
Prtm2110 committed Jan 15, 2025
1 parent 97bd65a commit 2c193da
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions Spraky-core/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ int main() {

mat4 ortho = mat4::orthographic(0.0f, 16.0f, 0.0f, 9.0f, -1.0f, 1.0f);



std::cout << "Loading shader..." << std::endl;

Shader shader("x64/src/shaders/basic.vert", "x64/src/shaders/basic.frag");
shader.enable();
shader.setUniformMat4("pr_matrix", ortho);
Expand All @@ -40,23 +38,18 @@ int main() {
shader.setUniform4f("colour", vec4(0.2f, 0.3f, 0.8f, 1.0f));





std::cout << "Entering main loop..." << std::endl;
while (!window.closed()) {

window.clear();

double x, y;
window.getMousePosition(x, y);
shader.setUniform2f("light_pos", vec2(x * 16.0f / 1280.0f, 9.0f - y * 9.0f / 800.0f)); // Center of the square
shader.setUniform2f("light_pos", vec2(x * 16.0f / 1280.0f, 9.0f - y * 9.0f / 800.0f));

renderer.submit(&sprite);
renderer.flush();




window.update();
}
return 0;
Expand Down

0 comments on commit 2c193da

Please sign in to comment.