SpiderPig Posted May 4, 2022 Share 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 Link to comment Share on other sites More sharing options...
reepblue Posted May 4, 2022 Share 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! Link to comment Share on other sites More sharing options...
SpiderPig Posted May 4, 2022 Author Share Posted May 4, 2022 Just tried it with no success. Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted May 4, 2022 Author Share 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 Link to comment Share on other sites More sharing options...
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.