Added matrix
This commit is contained in:
@ -14,6 +14,7 @@
|
||||
|
||||
#include "display/camera.h"
|
||||
#include "display/framebuffer.h"
|
||||
#include "display/matrix.h"
|
||||
#include "display/primitive.h"
|
||||
#include "display/render.h"
|
||||
#include "display/shader.h"
|
||||
|
@ -7,12 +7,13 @@
|
||||
|
||||
#pragma once
|
||||
#include "../libs.h"
|
||||
#include "matrix.h"
|
||||
|
||||
/** The math for the camera is stored here. */
|
||||
typedef struct {
|
||||
/** View Matrix (Where the camera looks) */
|
||||
mat4 view;
|
||||
matrix_t view;
|
||||
|
||||
/** Projection Matrix (How the camera looks) */
|
||||
mat4 projection;
|
||||
matrix_t projection;
|
||||
} camera_t;
|
18
include/dawn/display/matrix.h
Normal file
18
include/dawn/display/matrix.h
Normal file
@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Copyright (c) 2021 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "../libs.h"
|
||||
|
||||
/**
|
||||
* Representation for a matrix. Used as a highlevel wrapper for the math
|
||||
* functions that sit underneath this API.
|
||||
*/
|
||||
typedef struct {
|
||||
/** Internal Matrix API */
|
||||
mat4 internalMatrix;
|
||||
} matrix_t;
|
@ -13,29 +13,32 @@
|
||||
#define SHADER_UNI_TEXT "u_Text"
|
||||
#define SHADER_UNI_MODL "u_Modl"
|
||||
|
||||
/** Representation of a shader uniform */
|
||||
typedef GLuint shaderuniform_t;
|
||||
|
||||
/**
|
||||
* Structure containing information about an OpenGL Shader. For simplicity sake
|
||||
* we demand certain uninforms to be present on the shader target.
|
||||
*/
|
||||
typedef struct {
|
||||
/** Pointer to an uploaded vertex shader program */
|
||||
GLuint shaderVertex;
|
||||
shaderuniform_t shaderVertex;
|
||||
|
||||
/** Pointer to an uploaded fragment shader program */
|
||||
GLuint shaderFrag;
|
||||
shaderuniform_t shaderFrag;
|
||||
|
||||
/** Pointer to an uploaded shader program linked */
|
||||
GLuint shaderProgram;
|
||||
shaderuniform_t shaderProgram;
|
||||
|
||||
/** Matrix for the view matrix */
|
||||
GLint uniView;
|
||||
shaderuniform_t uniView;
|
||||
|
||||
/** Matrix for the projection matrix */
|
||||
GLint uniProj;
|
||||
shaderuniform_t uniProj;
|
||||
|
||||
/** Uniform for the current texture */
|
||||
GLint uniText;
|
||||
shaderuniform_t uniText;
|
||||
|
||||
/** Uniform for the current model world position */
|
||||
GLint uniModl;
|
||||
shaderuniform_t uniModl;
|
||||
} shader_t;
|
Reference in New Issue
Block a user