tipforeveryone Posted May 28, 2019 Share Posted May 28, 2019 I created my project in cpp from scratch, and here is the code I used in main.cpp #include "Leadwerks.h" #include "GameControl.h" using namespace Leadwerks; int main() { iVec2 gfxmode = System::GetGraphicsMode(System::CountGraphicsModes() - 1); gfxmode.x = Math::Min(700, gfxmode.x); gfxmode.y = Math::Round(gfxmode.x * 9 / 16); Window* window = Window::Create("CSCDVMP cpp", 600, 600, gfxmode.x, gfxmode.y, Window::Titlebar); Context* context = Context::Create(window, 0); World* world = World::Create(); Pivot* gameControl = Pivot::Create(); GameControl* actor = new GameControl(); //this actor has PostRender() which I used to draw image gameControl->SetActor(actor); while (true) { if (window->Closed() || window->KeyDown(Key::Escape)) return false; Time::Update(); world->Update(); world->Render(); context->Sync(); } return 0; } In PostRender() function of my actor Context::GetCurrent()->DrawImage( myimage, Window::GetCurrent()->GetWidth() - myimage->GetWidth(), 0, myimage->GetWidth(), myimage->GetHeight() ); as my expectation, myimage will be displayed on the top right corner of screen, but this look like this instead window size seems to be larger than actual game display. It is ok if I use Window::FullScreen in Window::Create() Quote Link to comment Share on other sites More sharing options...
tipforeveryone Posted May 28, 2019 Author Share Posted May 28, 2019 I realized that actual window size is smaller than input size in Window::Create(), why ? This does not happen in Lua game Quote Link to comment Share on other sites More sharing options...
Solution Josh Posted May 28, 2019 Solution Share Posted May 28, 2019 Use the context size, not the window size. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. 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.