diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2017-12-27 21:24:48 +0000 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2017-12-27 21:24:48 +0000 |
commit | d2ed94a517066da4f4ec53045f9c69bfc355eab6 (patch) | |
tree | 4aba7b767826ddd05279c12b5b0c5da592c200cb /examples/simplegame/main.cpp | |
parent | 354d7df4d2779ed7391701d1ef4344e959b64582 (diff) | |
download | YAGE-d2ed94a517066da4f4ec53045f9c69bfc355eab6.tar.gz YAGE-d2ed94a517066da4f4ec53045f9c69bfc355eab6.zip |
[Code] Examples working again.
Diffstat (limited to 'examples/simplegame/main.cpp')
-rw-r--r-- | examples/simplegame/main.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/examples/simplegame/main.cpp b/examples/simplegame/main.cpp index f5547e53..895fce51 100644 --- a/examples/simplegame/main.cpp +++ b/examples/simplegame/main.cpp @@ -19,8 +19,8 @@ int main() Window window; window.create("Simple Game", 800, 640); - Shader textureProgram("examples/resources/textureshader.vert", - "examples/resources/textureshader.frag"); + Shader textureProgram("examples/resources/learnopenglshader.vert", + "examples/resources/learnopenglshader.frag"); SpriteBatch sp; Texture fountain = ResourceManager::getTexture( @@ -28,12 +28,13 @@ int main() Texture breast_plate = ResourceManager::getTexture("examples/resources/breast_black.png"); - cout << "texture: " << fountain.width << ", " << fountain.height << '\n'; + Texture brick = ResourceManager::getTexture("examples/resources/wall.png"); - Camera camera(800, 640); + cout << "texture: " << brick.width << ", " << brick.height << '\n'; + Camera camera(800, 640); textureProgram.use(); - textureProgram.setUniform("texture_sampler", 0); + textureProgram.setUniform("ourTexture", 0); while (!window.shouldClose()) { window.clearBuffer(); @@ -47,10 +48,8 @@ int main() texture = breast_plate; } - camera.update(textureProgram); + sp.draw({-0.5, -0.5, 1, 1}, {0, 0, 1, 1}, brick.id, Colour(255, 255, 255, 255), 0); - sp.draw({0.f, 0.f, 64.f, 64.f}, {0, 0, 1, 1}, fountain.id, - Colour(255, 0, 255, 255), 0); sp.render(); window.swapBuffer(); |