Hi, I try to port some magnum example code using SDL2 library to wxWidgets.
This one:
https://github.com/mosra/magnum-examples/blob/master/src/arcball/ArcBallExample.cppand now, the ported project is located in
https://github.com/asmwarrior/magnum-wxI see some code in the SDL2 example was:
[code]
/* Set up the camera */
{
/* Setup the arcball after the camera objects */
const Vector3 eye = Vector3::zAxis(-10.0f);
const Vector3 center{};
const Vector3 up = Vector3::yAxis();
_arcballCamera.emplace(_scene, eye, center, up, 45.0_degf,
windowSize(), framebufferSize());
}
[/code]
For me, I don't know what the equivalent functions under wxWidgets, so I just changed to
[code]
/* Set up the camera */
{
/* Setup the arcball after the camera objects */
int w = GetSize().GetWidth();
int h = GetSize().GetHeight();
const Vector3 eye = Vector3::zAxis(-10.0f);
const Vector3 center{};
const Vector3 up = Vector3::yAxis();
_arcballCamera.emplace(_scene, eye, center, up, 45.0_degf,
Vector2i{w,h}, Vector2i{w,h});
}
[/code]
You see, I just set those two function call as the same width and height. Am I right? I really don't know if there is a wxWidgets function which could get the frame buffer size.
Thanks.
PS: I just want to post this message to the
forums.wxWidgets.org, but that forum has some issue, I can't post there, so I posted it help for help, thanks.