@@ -186,8 +186,8 @@ static void DestroyUI()
186186
187187static void ResizeWindowCallback ( GLFWwindow*, int width, int height )
188188{
189- s_context.camera .m_width = float ( width );
190- s_context.camera .m_height = float ( height );
189+ s_context.camera .width = float ( width );
190+ s_context.camera .height = float ( height );
191191}
192192
193193static void KeyCallback ( GLFWwindow* window, int key, int scancode, int action, int mods )
@@ -216,7 +216,7 @@ static void KeyCallback( GLFWwindow* window, int key, int scancode, int action,
216216 }
217217 else
218218 {
219- s_context.camera .m_center .x -= 0 .5f ;
219+ s_context.camera .center .x -= 0 .5f ;
220220 }
221221 break ;
222222
@@ -229,7 +229,7 @@ static void KeyCallback( GLFWwindow* window, int key, int scancode, int action,
229229 }
230230 else
231231 {
232- s_context.camera .m_center .x += 0 .5f ;
232+ s_context.camera .center .x += 0 .5f ;
233233 }
234234 break ;
235235
@@ -242,7 +242,7 @@ static void KeyCallback( GLFWwindow* window, int key, int scancode, int action,
242242 }
243243 else
244244 {
245- s_context.camera .m_center .y -= 0 .5f ;
245+ s_context.camera .center .y -= 0 .5f ;
246246 }
247247 break ;
248248
@@ -255,7 +255,7 @@ static void KeyCallback( GLFWwindow* window, int key, int scancode, int action,
255255 }
256256 else
257257 {
258- s_context.camera .m_center .y += 0 .5f ;
258+ s_context.camera .center .y += 0 .5f ;
259259 }
260260 break ;
261261
@@ -365,8 +365,8 @@ static void MouseMotionCallback( GLFWwindow* window, double xd, double yd )
365365 if ( s_rightMouseDown )
366366 {
367367 b2Vec2 diff = b2Sub ( pw, s_clickPointWS );
368- s_context.camera .m_center .x -= diff.x ;
369- s_context.camera .m_center .y -= diff.y ;
368+ s_context.camera .center .x -= diff.x ;
369+ s_context.camera .center .y -= diff.y ;
370370 s_clickPointWS = ConvertScreenToWorld ( &s_context.camera , ps );
371371 }
372372}
@@ -381,11 +381,11 @@ static void ScrollCallback( GLFWwindow* window, double dx, double dy )
381381
382382 if ( dy > 0 )
383383 {
384- s_context.camera .m_zoom /= 1 .1f ;
384+ s_context.camera .zoom /= 1 .1f ;
385385 }
386386 else
387387 {
388- s_context.camera .m_zoom *= 1 .1f ;
388+ s_context.camera .zoom *= 1 .1f ;
389389 }
390390}
391391
@@ -397,8 +397,8 @@ static void UpdateUI()
397397 float menuWidth = 13 .0f * fontSize;
398398 if ( s_context.showUI )
399399 {
400- ImGui::SetNextWindowPos ( { s_context.camera .m_width - menuWidth - 0 .5f * fontSize, 0 .5f * fontSize } );
401- ImGui::SetNextWindowSize ( { menuWidth, s_context.camera .m_height - fontSize } );
400+ ImGui::SetNextWindowPos ( { s_context.camera .width - menuWidth - 0 .5f * fontSize, 0 .5f * fontSize } );
401+ ImGui::SetNextWindowSize ( { menuWidth, s_context.camera .height - fontSize } );
402402
403403 ImGui::Begin ( " Tools" , &s_context.showUI ,
404404 ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse );
@@ -609,7 +609,7 @@ int main( int, char** )
609609 else
610610 {
611611 s_context.window =
612- glfwCreateWindow ( int ( s_context.camera .m_width ), int ( s_context.camera .m_height ), buffer, nullptr , nullptr );
612+ glfwCreateWindow ( int ( s_context.camera .width ), int ( s_context.camera .height ), buffer, nullptr , nullptr );
613613 }
614614
615615 if ( s_context.window == nullptr )
@@ -659,18 +659,18 @@ int main( int, char** )
659659 if ( glfwGetKey ( s_context.window , GLFW_KEY_Z ) == GLFW_PRESS )
660660 {
661661 // Zoom out
662- s_context.camera .m_zoom = b2MinFloat ( 1 .005f * s_context.camera .m_zoom , 100 .0f );
662+ s_context.camera .zoom = b2MinFloat ( 1 .005f * s_context.camera .zoom , 100 .0f );
663663 }
664664 else if ( glfwGetKey ( s_context.window , GLFW_KEY_X ) == GLFW_PRESS )
665665 {
666666 // Zoom in
667- s_context.camera .m_zoom = b2MaxFloat ( 0 .995f * s_context.camera .m_zoom , 0 .5f );
667+ s_context.camera .zoom = b2MaxFloat ( 0 .995f * s_context.camera .zoom , 0 .5f );
668668 }
669669
670670 int width, height;
671671 glfwGetWindowSize ( s_context.window , &width, &height );
672- s_context.camera .m_width = width;
673- s_context.camera .m_height = height;
672+ s_context.camera .width = width;
673+ s_context.camera .height = height;
674674
675675 int bufferWidth, bufferHeight;
676676 glfwGetFramebufferSize ( s_context.window , &bufferWidth, &bufferHeight );
@@ -688,10 +688,10 @@ int main( int, char** )
688688 // ImGui_ImplGlfw_CursorPosCallback( s_context.window, cursorPosX / s_windowScale, cursorPosY / s_windowScale );
689689
690690 ImGuiIO& io = ImGui::GetIO ();
691- io.DisplaySize .x = s_context.camera .m_width ;
692- io.DisplaySize .y = s_context.camera .m_height ;
693- io.DisplayFramebufferScale .x = bufferWidth / s_context.camera .m_width ;
694- io.DisplayFramebufferScale .y = bufferHeight / s_context.camera .m_height ;
691+ io.DisplaySize .x = s_context.camera .width ;
692+ io.DisplaySize .y = s_context.camera .height ;
693+ io.DisplayFramebufferScale .x = bufferWidth / s_context.camera .width ;
694+ io.DisplayFramebufferScale .y = bufferHeight / s_context.camera .height ;
695695
696696 ImGui::NewFrame ();
697697
@@ -708,9 +708,9 @@ int main( int, char** )
708708
709709 s_sample->Step ();
710710
711- DrawScreenString ( s_context.draw , 5 .0f , s_context.camera .m_height - 10 .0f , b2_colorSeaGreen,
711+ DrawScreenString ( s_context.draw , 5 .0f , s_context.camera .height - 10 .0f , b2_colorSeaGreen,
712712 " %.1f ms - step %d - camera (%g, %g, %g)" , 1000 .0f * frameTime, s_sample->m_stepCount ,
713- s_context.camera .m_center .x , s_context.camera .m_center .y , s_context.camera .m_zoom );
713+ s_context.camera .center .x , s_context.camera .center .y , s_context.camera .zoom );
714714
715715 FlushDraw ( s_context.draw , &s_context.camera );
716716
0 commit comments