diff options
| author | Reece Mackie <[email protected]> | 2019-04-27 21:59:01 +0100 |
|---|---|---|
| committer | Reece Mackie <[email protected]> | 2019-04-27 21:59:01 +0100 |
| commit | e0580e6322236f03c75ff8088c98bc079ac8ca95 (patch) | |
| tree | 14004b760d8a1e1df4ba076e36d5a23ff8da7633 /projects/VS2017.UWP/raylib.App.UWP/App.cpp | |
| parent | c1f33eb817765ad801b2419d86457a6102b64032 (diff) | |
| parent | f70a640b2db343d48e465013cacb304f8dabebcb (diff) | |
| download | raylib-e0580e6322236f03c75ff8088c98bc079ac8ca95.tar.gz raylib-e0580e6322236f03c75ff8088c98bc079ac8ca95.zip | |
Fix merge
Diffstat (limited to 'projects/VS2017.UWP/raylib.App.UWP/App.cpp')
| -rw-r--r-- | projects/VS2017.UWP/raylib.App.UWP/App.cpp | 61 |
1 files changed, 31 insertions, 30 deletions
diff --git a/projects/VS2017.UWP/raylib.App.UWP/App.cpp b/projects/VS2017.UWP/raylib.App.UWP/App.cpp index fb07636c..b738535f 100644 --- a/projects/VS2017.UWP/raylib.App.UWP/App.cpp +++ b/projects/VS2017.UWP/raylib.App.UWP/App.cpp @@ -17,7 +17,7 @@ int main(Platform::Array<Platform::String^>^) App::App() { - //This does not work... need to fix this. + // This does not work... need to fix this. SetConfigFlags(0); Setup(640, 480); @@ -30,49 +30,50 @@ static int gTime = 0; // This method is called every frame void App::Update() { - //return; - // Draw + // Update + //---------------------------------------------------------------------------------- + posX += GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_LEFT_X) * 5; + posY += GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_LEFT_Y) * -5; + + auto mPos = GetMousePosition(); + + if (IsKeyPressed(KEY_A)) + { + posX -= 50; + EnableCursor(); + } + + if (IsKeyPressed(KEY_D)) + { + posX += 50; + DisableCursor(); + } + + static int pos = 0; + pos -= GetMouseWheelMove(); + //---------------------------------------------------------------------------------- + + // Draw + //---------------------------------------------------------------------------------- BeginDrawing(); ClearBackground(RAYWHITE); - - posX += GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_LEFT_X) * 5; - posY += GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_LEFT_Y) * -5; DrawRectangle(posX, posY, 400, 100, RED); DrawLine(0, 0, GetScreenWidth(), GetScreenHeight(), BLUE); - auto mPos = GetMousePosition(); - DrawCircle(mPos.x, mPos.y, 40, BLUE); if (IsKeyDown(KEY_S)) DrawCircle(100, 100, 100, BLUE); - if (IsKeyPressed(KEY_A)) - { - posX -= 50; - EnableCursor(); - } - - if (IsKeyPressed(KEY_D)) - { - posX += 50; - DisableCursor(); - } - - if (IsKeyDown(KEY_LEFT_ALT)) - DrawRectangle(250, 250, 20, 20, BLACK); - if (IsKeyDown(KEY_BACKSPACE) || IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_RIGHT_FACE_DOWN)) - DrawRectangle(280, 250, 20, 20, BLACK); - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - DrawRectangle(280, 250, 20, 20, BLACK); - - static int pos = 0; - pos -= GetMouseWheelMove(); - + if (IsKeyDown(KEY_LEFT_ALT)) DrawRectangle(250, 250, 20, 20, BLACK); + if (IsKeyDown(KEY_BACKSPACE)) DrawRectangle(280, 250, 20, 20, BLACK); + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) DrawRectangle(280, 250, 20, 20, BLACK); + DrawRectangle(280, pos + 50, 20, 20, BLACK); DrawRectangle(250, 280 + (gTime++ % 60), 10, 10, PURPLE); EndDrawing(); + //---------------------------------------------------------------------------------- }
\ No newline at end of file |
