diff --git a/lesson#11/raylib_firstWindow/car.png b/lesson#11/raylib_firstWindow/car.png new file mode 100644 index 0000000..4104d51 Binary files /dev/null and b/lesson#11/raylib_firstWindow/car.png differ diff --git a/lesson#11/raylib_firstWindow/dub.json b/lesson#11/raylib_firstWindow/dub.json new file mode 100644 index 0000000..5ad9c7f --- /dev/null +++ b/lesson#11/raylib_firstWindow/dub.json @@ -0,0 +1,13 @@ +{ + "authors": [ + "rillk500" + ], + "copyright": "free", + "dependencies": { + "raylib-d": "~>2.5.0" + }, + "libs": [ "raylib" ], + "description": "A minimal D application.", + "license": "no license", + "name": "raylib_firstwindow" +} \ No newline at end of file diff --git a/lesson#11/raylib_firstWindow/dub.selections.json b/lesson#11/raylib_firstWindow/dub.selections.json new file mode 100644 index 0000000..9d49892 --- /dev/null +++ b/lesson#11/raylib_firstWindow/dub.selections.json @@ -0,0 +1,6 @@ +{ + "fileVersion": 1, + "versions": { + "raylib-d": "2.5.0" + } +} diff --git a/lesson#11/raylib_firstWindow/raylib_firstwindow b/lesson#11/raylib_firstWindow/raylib_firstwindow new file mode 100644 index 0000000..e9ba5ba Binary files /dev/null and b/lesson#11/raylib_firstWindow/raylib_firstwindow differ diff --git a/lesson#11/raylib_firstWindow/source/app.d b/lesson#11/raylib_firstWindow/source/app.d new file mode 100644 index 0000000..cb71b6c --- /dev/null +++ b/lesson#11/raylib_firstWindow/source/app.d @@ -0,0 +1,44 @@ +import std.stdio: writeln; + +import raylib; + +void main() { + // creating window + InitWindow(720, 640, "Dlang Raylib Window"); + + // loading texture + Texture2D image = LoadTexture("car.png"); + // resizing the texture + image.width = image.height = 240; + + while(!WindowShouldClose()) { + // process events + + // update + + // draw + BeginDrawing(); // clear the screen + ClearBackground(WHITE); // set background color to WHITE + + // draw "Hello, World!" + DrawText("Hello, World!", 10, 10, 60, BLACK); + + // draw a square 50x50 + DrawRectangle(100, 100, 50, 50, BLACK); + + // draw a circle of radius = 100 + DrawCircle(100, 200, 50, BLACK); + + // draw the image + DrawTexture(image, 100, 400, WHITE); + + // display + EndDrawing(); + } + + // free res + UnloadTexture(image); + + // close the window and quit + CloseWindow(); +}