SpiderPig Posted May 4, 2022 Posted May 4, 2022 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(); } Quote
reepblue Posted May 4, 2022 Posted May 4, 2022 Try creating the camera after you load the map. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon!
SpiderPig Posted May 4, 2022 Author Posted May 4, 2022 Got it to work with a buffer instead. auto buffer = Buffer::Create(256, 256); auto cb = Buffer::GetCurrent(); buffer->Enable(); cam->Render(); Buffer::SetCurrent(cb); Quote
Recommended Posts
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.