mirror of
https://github.com/NoelFB/blah.git
synced 2024-11-29 17:08:56 +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;
|
using namespace Blah;
|
||||||
|
|
||||||
Batch batch;
|
Batch batch;
|
||||||
|
TextureRef tex;
|
||||||
|
|
||||||
|
void startup()
|
||||||
|
{
|
||||||
|
tex = Texture::create("player.png");
|
||||||
|
}
|
||||||
|
|
||||||
void render()
|
void render()
|
||||||
{
|
{
|
||||||
|
@ -37,6 +43,7 @@ void render()
|
||||||
|
|
||||||
batch.push_matrix(transform);
|
batch.push_matrix(transform);
|
||||||
batch.rect(Rect(-32, -32, 64, 64), Color::red);
|
batch.rect(Rect(-32, -32, 64, 64), Color::red);
|
||||||
|
batch.tex(tex, Vec2(64, 0), Color::white);
|
||||||
batch.pop_matrix();
|
batch.pop_matrix();
|
||||||
|
|
||||||
batch.render();
|
batch.render();
|
||||||
|
@ -49,6 +56,7 @@ int main()
|
||||||
config.name = "blah app";
|
config.name = "blah app";
|
||||||
config.width = 1280;
|
config.width = 1280;
|
||||||
config.height = 720;
|
config.height = 720;
|
||||||
|
config.on_startup = startup;
|
||||||
config.on_render = render;
|
config.on_render = render;
|
||||||
|
|
||||||
App::run(&config);
|
App::run(&config);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user