summaryrefslogtreecommitdiffhomepage
path: root/src/render.c
blob: 9203eceeb2e85aa3bf001bea53120a04de5208a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "render.h"
#include "rlgl.h"

void
renderWorld(World* world, Camera camera)
{
	//Vector3 lookat = camera.target;
	//camera.target = (Vector3){0};
	//camera.position.x -= lookat.x;
	//camera.position.y -= lookat.y;
	//camera.position.z -= lookat.z;
	customBeginMode3D(camera);
	//rlPushMatrix();
	//rlTranslatef(
	//		-lookat.x,
	//		-lookat.y,
	//		-lookat.z
	//		);
	drawPlayer(&world->players[0]);
	drawPlayer(&world->players[1]);

	for(int i = 0; i <= 3; ++i){
		DrawCube((Vector3){i,3,3}, 0.5f, 0.5f, 0.5f, YELLOW);
		DrawCube((Vector3){i,4,3}, 0.5f, 0.5f, 0.5f, DARKPURPLE);
		DrawCube((Vector3){i,5,3}, 0.5f, 0.5f, 0.5f, YELLOW);
		DrawCube((Vector3){i,3,4}, 0.5f, 0.5f, 0.5f, MAGENTA);
		DrawCube((Vector3){i,4,4}, 0.5f, 0.5f, 0.5f, GREEN);
		DrawCube((Vector3){i,5,4}, 0.5f, 0.5f, 0.5f, MAGENTA);
		//DrawLineV((Vector2){i, -3}, (Vector2){i, 3}, BLACK);
		//DrawLineV((Vector2){-3, i}, (Vector2){3, i}, BLACK);
	}
	//rlPopMatrix();
	EndMode3D();
}