diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/animation/main.cpp | 2 | ||||
-rw-r--r-- | examples/particle_system/main.cpp | 20 |
2 files changed, 11 insertions, 11 deletions
diff --git a/examples/animation/main.cpp b/examples/animation/main.cpp index 7d85c77..b5ad60f 100644 --- a/examples/animation/main.cpp +++ b/examples/animation/main.cpp @@ -41,7 +41,7 @@ void onLoad() tex = Texture::createTexture("anim.png"); shader = Shader::createShader(shader_code); SpriteSheet ss = SpriteSheet(tex); - vector<Sprite*> frames = ss.createSprites(1, 19, 246, 238, Origin::BottomCenter); + vector<Sprite*> frames = ss.createSprites(19, 1, 19, 246, 238, Origin::BottomCenter); anim.addFrames(frames); anim.setSpeed(10); animator.setAnimation(&anim); diff --git a/examples/particle_system/main.cpp b/examples/particle_system/main.cpp index 9251cc4..6ab3448 100644 --- a/examples/particle_system/main.cpp +++ b/examples/particle_system/main.cpp @@ -21,24 +21,24 @@ Shader* shader; Sprite* spr; const char* shader_code = R"( #VERTEX_SHADER -Vertex vert(Vertex v) -{ - return v; -} + Vertex vert(Vertex v) + { + return v; + } #END_VERTEX_SHADER #FRAGMENT_SHADER -Color frag(Color col, Texture tex, Vertex v) -{ - Color c = texel(tex, v.uv); - return c * col; -} + Color frag(Color col, Texture tex, Vertex v) + { + Color c = texel(tex, v.uv); + return c * col; + } #END_FRAGMENT_SHADER )"; const float Pi = 3.14f; void onLoad() { tex = Texture::createTexture("texture.png"); - spr = new Sprite(tex, Sprite::Origin::BottomCenter); + spr = new Sprite(tex, Origin::BottomCenter); shader = Shader::createShader(shader_code); ParticleSystemDef def; def.maxParticleCount = 30; |