Jump to content

Render from a second world


SpiderPig
 Share

Go to solution Solved by reepblue,

Recommended Posts

auto _currentWorld = World::GetCurrent();
world = World::Create();

auto b = Model::Box();
b->SetColor(1, 0, 0, 1);

World::SetCurrent(_currentWorld);

worldBuffer = Buffer::Create(512, 512);

I'm trying to create a second world where I can render an object in and then draw that render on screen.  But so far I can't get the second world to show anything, can anyone see anything wrong with my code?

Texture* cInventory::_renderWorldBuffer()
{
	auto _currentBuffer = Buffer::GetCurrent();
	worldBuffer->Enable();

	//World::GetCurrent()->Render(); <- This works
	world->Render();		//This is not

	_currentBuffer->Enable();

	return worldBuffer->GetColorTexture();
}

 

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...