diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2017-11-12 22:30:20 +0000 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2017-11-12 22:30:20 +0000 |
commit | e68759a4101567a27e306eae0a907baa759ae80c (patch) | |
tree | c90733351cb7a8a02f91725118593c1c4f19c563 /tests/simplegame.cpp | |
parent | 5fb7c972d44a3ce0a067101885d2e0c1966e7c89 (diff) | |
download | YAGE-e68759a4101567a27e306eae0a907baa759ae80c.tar.gz YAGE-e68759a4101567a27e306eae0a907baa759ae80c.zip |
Designing simple preview game
Diffstat (limited to 'tests/simplegame.cpp')
-rw-r--r-- | tests/simplegame.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/simplegame.cpp b/tests/simplegame.cpp index 0692574a..7ca8db77 100644 --- a/tests/simplegame.cpp +++ b/tests/simplegame.cpp @@ -5,14 +5,26 @@ using namespace yage; int main() { Window window; + SpriteBatch sp; + GlslProgram program; window.create("Simple Game", 800, 640); + sp.init(); + + program.compileShaders("/home/yannherklotz/Github/YAGE/tests/resources/simplegame.vert", "/home/yannherklotz/Github/YAGE/tests/resources/simplegame.vert"); + program.addAttribute("vertex_position"); + program.addAttribute("vertex_color"); + program.addAttribute("vertex_uv"); + program.linkShaders(); + + Texture fountain = ResourceManager::getTexture("/home/yannherklotz/Github/YAGE/tests/resources/dngn_blood_fountain.png"); while(!window.shouldClose()) { window.clearBuffer(); - SpriteBatch sp; sp.begin(); + sp.draw(std::vector<float>({0, 0, 50, 50}), std::vector<float>({0, 0, 1, 1}), fountain.id, Color(), 0); + sp.render(); window.pollEvents(); window.swapBuffer(); |