raylib/projects/4coder/main.c
Leandro Gabriel 89c16baf18 Replace tabs with spaces and update year of copyright notices (#927)
* Update year of copyright notices

* Fix mistake in comment

* Fix typo ("algorythms")

* Replace tabs with spaces

* Remove trailing whitespace and fix mistake in comment

* Fix ExportImageAsCode missing comment rectangle corner

* Replace tab with spaces

* Replace tabs with spaces
2019-08-03 11:07:41 +02:00

39 lines
1005 B
C

#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;
}