mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-06 14:23:12 +00:00
Update core_2d_camera_mouse_zoom.c
This commit is contained in:
parent
596d3bcb7e
commit
06589d3350
@ -23,7 +23,7 @@
|
|||||||
//------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------
|
||||||
// Program main entry point
|
// Program main entry point
|
||||||
//------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------
|
||||||
int main ()
|
int main(void)
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
@ -93,6 +93,7 @@ int main ()
|
|||||||
// under the cursor to the screen space point under the cursor at any zoom
|
// under the cursor to the screen space point under the cursor at any zoom
|
||||||
camera.target = mouseWorldPos;
|
camera.target = mouseWorldPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsMouseButtonDown(MOUSE_BUTTON_RIGHT))
|
if (IsMouseButtonDown(MOUSE_BUTTON_RIGHT))
|
||||||
{
|
{
|
||||||
// Zoom increment
|
// Zoom increment
|
||||||
@ -110,7 +111,6 @@ int main ()
|
|||||||
ClearBackground(RAYWHITE);
|
ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
BeginMode2D(camera);
|
BeginMode2D(camera);
|
||||||
|
|
||||||
// Draw the 3d grid, rotated 90 degrees and centered around 0,0
|
// Draw the 3d grid, rotated 90 degrees and centered around 0,0
|
||||||
// just so we have something in the XY plane
|
// just so we have something in the XY plane
|
||||||
rlPushMatrix();
|
rlPushMatrix();
|
||||||
@ -121,7 +121,6 @@ int main ()
|
|||||||
|
|
||||||
// Draw a reference circle
|
// Draw a reference circle
|
||||||
DrawCircle(GetScreenWidth()/2, GetScreenHeight()/2, 50, MAROON);
|
DrawCircle(GetScreenWidth()/2, GetScreenHeight()/2, 50, MAROON);
|
||||||
|
|
||||||
EndMode2D();
|
EndMode2D();
|
||||||
|
|
||||||
// Draw mouse reference
|
// Draw mouse reference
|
||||||
@ -142,5 +141,6 @@ int main ()
|
|||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
CloseWindow(); // Close window and OpenGL context
|
CloseWindow(); // Close window and OpenGL context
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user