Jump to content

SetRenderTarget no updating


SpiderPig
 Share

Recommended Posts

Its been a while since I tried something like this, the camera render draws to the screen but doesn't update as the camera moves.  Am I doing something wrong?  Or should I just draw to a buffer instead?

 

//c++ setup
auto cam = Camera::Create();
cam->move(0,1,0);
auto tex = Texture::Create(512, 512);
cam->SetRenderTarget(tex);

Map::Load("Maps/TestScene_001.map");//Just a ground plane,skybox and a few trees.  Primary camera in here.

//Loop
while (true) {
	if (window->Closed() || window->KeyDown(Key::Escape)) { return false; }

	cam->Move(0,0,0.01);

	Time::Update();
	world->Update();
	world->Render();

	context->SetBlendMode(Blend::Alpha);
	context->DrawImage(tex, 0.0f, 0.0f);
	context->Sync();
}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...