DrawImage
Syntax
- void DrawImage(Texture* texture, int x, int y, int width, int height)
- void DrawImage(Texture* texture, int x, int y)
Parameters
- texture:
- x:
- y:
- width:
- height:
Returns
Returns the created Context. If the Context could not be created with the specified parameters, NULL is returned.
Example
#include "Leadwerks.h"
using namespace Leadwerks;
int main(int argc, const char *argv[])
{
Leadwerks::Window* window = Leadwerks::Window::Create();
Context* context = Context::Create(window);
//Load a texture
Texture* texture = Texture::Load("Materials/Grass/grass01.tex");
while (true)
{
if (window->Closed() || window->KeyHit(Key::Escape)) break;
context->SetColor(0.0, 0.0, 1.0);
context->Clear();
context->SetColor(1.0, 1.0, 1.0);
context->DrawImage(texture, 0, 0, 512, 512);
context->Sync();
}
return 0;
}