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

68 lines
1.1 KiB
C
Raw Normal View History

#ifndef ENGINE_H
2018-09-20 02:14:45 +00:00
#include "geometry.h"
#include <cstdint>
2018-09-19 02:18:58 +00:00
// WINDOW CONFIGURATION
2018-09-19 01:19:13 +00:00
#define WINDOW_WIDTH (1920)
#define WINDOW_HEIGHT (1080)
#define WINDOW_FPS (30)
2018-09-19 02:18:58 +00:00
// CAMERA CONFIGURATION
#define CAMERA_FOV (90.0f)
#define CAMERA_NEAR_CLIP (5.0f)
#define CAMERA_FAR_CLIP (600.0f)
2018-09-19 01:19:13 +00:00
// ENUMS
2018-09-20 02:14:45 +00:00
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,
2018-09-14 02:19:59 +00:00
SCALE_DOWN
};
// STRUCTURES
2018-09-20 02:14:45 +00:00
struct EngineBuffer
{
2018-09-07 01:32:15 +00:00
uint32_t *buffer;
int width;
int height;
};
2018-09-20 02:14:45 +00:00
struct EngineMemory
{
float zbuffer[WINDOW_HEIGHT][WINDOW_WIDTH];
VertexList localVerts;
VertexList transVerts;
FaceList localFaces;
FaceList transFaces;
UVList uvs;
MaterialList materials;
TextureList textures;
};
// FUNCTIONS
2018-09-20 02:14:45 +00:00
int EngineInit(char *objFilename, char *mtlFilename);
void EngineRender(EngineBuffer &buffer, uint32_t input);
void EngineShutdown(void);
#define ENGINE_H
#endif