1
0
Fork 0
2018-soft-3d-renderer/include/engine.h

68 lines
1.1 KiB
C++

#ifndef ENGINE_H
#include "geometry.h"
#include <cstdint>
// WINDOW CONFIGURATION
#define WINDOW_WIDTH (1920)
#define WINDOW_HEIGHT (1080)
#define WINDOW_FPS (30)
// CAMERA CONFIGURATION
#define CAMERA_FOV (90.0f)
#define CAMERA_NEAR_CLIP (5.0f)
#define CAMERA_FAR_CLIP (600.0f)
// ENUMS
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
};
// STRUCTURES
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;
};
// FUNCTIONS
int EngineInit(char *objFilename, char *mtlFilename);
void EngineRender(EngineBuffer &buffer, uint32_t input);
void EngineShutdown(void);
#define ENGINE_H
#endif