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

51 lines
780 B
C++

#ifndef ENGINE_H
#include <cstdint>
// CONSTANTS
#define WINDOW_WIDTH (1920)
#define WINDOW_HEIGHT (1080)
#define WINDOW_FPS (30)
// ENUMS
enum Engine_Input
{
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 Engine_Buffer
{
uint32_t *buffer;
float zbuffer[WINDOW_HEIGHT][WINDOW_WIDTH];
int width;
int height;
};
// FUNCTIONS
int Engine_Init(Engine_Buffer &buffer, char *objFilename, char *mtlFilename);
void Engine_Render(Engine_Buffer &buffer, uint32_t input);
void Engine_Shutdown(void);
#define ENGINE_H
#endif