Main > Getting Started > Displaying Texture

Here's complete Tiny2D application that loads and then
displays some texture:

#include "Tiny2D.h"

using namespace Tiny2D;

class TextureApp : public App::Callbacks
{
public:
	virtual bool OnInit()
	{
		texture.Create("my_texture.png");
		return true;
	}

	virtual void OnDraw(Texture& renderTarget)
	{
		renderTarget.BeginDrawing(&Color::Black);
		texture.Draw(10, 10);
		renderTarget.EndDrawing();
	}

private:
	Texture texture;
};

TINY2D_DEFINE_APP(TextureApp);





Contact: contact at pixelelephant dot com
(C) 2013 Pixel Elephant - All Rights Reserved