summaryrefslogtreecommitdiffhomepage
path: root/projects/4coder/main.c
diff options
context:
space:
mode:
authorRay <[email protected]>2019-04-24 11:42:39 +0200
committerGitHub <[email protected]>2019-04-24 11:42:39 +0200
commit96cd3b5abcbabd421d9017a0f764c0b5313e55db (patch)
treef3f28c9f9b058517e2adb8ae34089bc197b63795 /projects/4coder/main.c
parent600cdb61a306cd1d5dd78679c0acceb91287b193 (diff)
parent6d65aa1acbe0bfa3212610ea3de3d71b6dd9324f (diff)
downloadraylib-96cd3b5abcbabd421d9017a0f764c0b5313e55db.tar.gz
raylib-96cd3b5abcbabd421d9017a0f764c0b5313e55db.zip
Merge pull request #815 from ChrisDill/testing
Added project for 4coder
Diffstat (limited to 'projects/4coder/main.c')
-rw-r--r--projects/4coder/main.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/projects/4coder/main.c b/projects/4coder/main.c
new file mode 100644
index 00000000..e7918422
--- /dev/null
+++ b/projects/4coder/main.c
@@ -0,0 +1,39 @@
+#include <math.h>
+#include "raylib.h"
+
+int main() {
+ int screenWidth = 800;
+ int screenHeight = 450;
+
+ InitWindow(screenWidth, screenHeight, "raylib");
+
+ Camera cam;
+ cam.position = (Vector3){ 0.f, 10.f, 8.f };
+ cam.target = (Vector3){ 0.f, 0.f, 0.f };
+ cam.up = (Vector3){ 0.f, 1.f, 0.f };
+ cam.fovy = 60.f;
+ cam.type = CAMERA_PERSPECTIVE;
+
+ Vector3 cubePos = { 0.f, 0.f, 0.f };
+
+ SetTargetFPS(60);
+
+ while (!WindowShouldClose()) {
+ cam.position.x = sin(GetTime()) * 10.f;
+ cam.position.z = cos(GetTime()) * 10.f;
+
+ BeginDrawing();
+ ClearBackground(RAYWHITE);
+ BeginMode3D(cam);
+ DrawCube(cubePos, 2.f, 2.f, 2.f, RED);
+ DrawCubeWires(cubePos, 2.f, 2.f, 2.f, MAROON);
+ DrawGrid(10, 1.f);
+ EndMode3D();
+ DrawText("This is a raylib example", 10, 40, 20, DARKGRAY);
+ DrawFPS(10, 10);
+ EndDrawing();
+ }
+
+ CloseWindow();
+ return 0;
+} \ No newline at end of file