mirror of
https://github.com/NoelFB/blah.git
synced 2024-11-28 16:58:57 +08:00
adding texture rendering to example
This commit is contained in:
parent
5503198eff
commit
deafcb4f64
|
@ -26,6 +26,12 @@ this will likely see breaking changes.
|
|||
using namespace Blah;
|
||||
|
||||
Batch batch;
|
||||
TextureRef tex;
|
||||
|
||||
void startup()
|
||||
{
|
||||
tex = Texture::create("player.png");
|
||||
}
|
||||
|
||||
void render()
|
||||
{
|
||||
|
@ -37,6 +43,7 @@ void render()
|
|||
|
||||
batch.push_matrix(transform);
|
||||
batch.rect(Rect(-32, -32, 64, 64), Color::red);
|
||||
batch.tex(tex, Vec2(64, 0), Color::white);
|
||||
batch.pop_matrix();
|
||||
|
||||
batch.render();
|
||||
|
@ -49,6 +56,7 @@ int main()
|
|||
config.name = "blah app";
|
||||
config.width = 1280;
|
||||
config.height = 720;
|
||||
config.on_startup = startup;
|
||||
config.on_render = render;
|
||||
|
||||
App::run(&config);
|
||||
|
|
Loading…
Reference in New Issue
Block a user