Added some functions and Updated examples
View CHANGELOG for details
This commit is contained in:
parent
818e79638b
commit
e9143b8a8d
35 changed files with 586 additions and 199 deletions
|
@ -13,6 +13,8 @@
|
|||
|
||||
int main()
|
||||
{
|
||||
// Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
int screenWidth = 800;
|
||||
int screenHeight = 450;
|
||||
|
||||
|
@ -20,16 +22,14 @@ int main()
|
|||
int counter = 0;
|
||||
int mouseX, mouseY;
|
||||
|
||||
// Initialization
|
||||
//---------------------------------------------------------
|
||||
InitWindow(screenWidth, screenHeight, "raylib example 06 - mouse input");
|
||||
//----------------------------------------------------------
|
||||
//---------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
{
|
||||
// Update
|
||||
//-----------------------------------------------------
|
||||
//----------------------------------------------------------------------------------
|
||||
if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON))
|
||||
{
|
||||
mouseX = GetMouseX();
|
||||
|
@ -38,26 +38,26 @@ int main()
|
|||
ballPosition.x = (float)mouseX;
|
||||
ballPosition.y = (float)mouseY;
|
||||
}
|
||||
//-----------------------------------------------------
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
//-----------------------------------------------------
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
DrawCircleV(ballPosition, 40, GOLD);
|
||||
|
||||
DrawText("mouse click to draw the ball", 10, 10, 20, 1, DARKGRAY);
|
||||
DrawText("mouse click to draw the ball", 10, 10, 20, DARKGRAY);
|
||||
|
||||
EndDrawing();
|
||||
//-----------------------------------------------------
|
||||
//----------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// De-Initialization
|
||||
//---------------------------------------------------------
|
||||
//--------------------------------------------------------------------------------------
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//----------------------------------------------------------
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue