1
0
Fork 0
2018-soft-3d-renderer/Source/Engine.hpp

56 lines
931 B
C++
Raw Normal View History

2019-08-10 00:03:10 +00:00
#pragma once
#include "Geometry.hpp"
#include <cstdint>
const int WINDOW_WIDTH = 1920;
const int WINDOW_HEIGHT = 1080;
const int WINDOW_FPS = 30;
const float CAMERA_FOV = 90.0f;
const float CAMERA_NEAR_CLIP = 5.0f;
const float CAMERA_FAR_CLIP = 600.0f;
enum EngineInput
{
TRANSLATE_X_POS,
TRANSLATE_X_NEG,
TRANSLATE_Y_POS,
TRANSLATE_Y_NEG,
TRANSLATE_Z_POS,
TRANSLATE_Z_NEG,
ROTATE_X_POS,
ROTATE_X_NEG,
ROTATE_Y_POS,
ROTATE_Y_NEG,
ROTATE_Z_POS,
ROTATE_Z_NEG,
SCALE_UP,
SCALE_DOWN
};
struct EngineBuffer
{
uint32_t* buffer;
int width;
int height;
};
struct EngineMemory
{
float zbuffer[WINDOW_HEIGHT][WINDOW_WIDTH];
VertexList localVerts;
VertexList transVerts;
FaceList localFaces;
FaceList transFaces;
UVList uvs;
MaterialList materials;
TextureList textures;
};
int EngineInit(char* objFilename, char* mtlFilename);
void EngineRender(EngineBuffer& buffer, uint32_t input);
void EngineShutdown();