-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* rendering scene with 1 color * adding rturn value to shader_fragment, removing unused var
- Loading branch information
Showing
3 changed files
with
132 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#include "shader.h" | ||
|
||
/******************** | ||
* Notes | ||
* | ||
********************/ | ||
|
||
/********************/ | ||
/* defines */ | ||
/********************/ | ||
|
||
/********************/ | ||
/* static variables */ | ||
/********************/ | ||
|
||
static camera_t* cam = NULL; | ||
|
||
/********************/ | ||
/* static functions */ | ||
/********************/ | ||
|
||
/********************/ | ||
/* public functions */ | ||
/********************/ | ||
|
||
|
||
void shader_set_camera(camera_t* camera) | ||
{ | ||
cam = camera; | ||
} | ||
|
||
vec4_t shader_vertex(vec4_t v) | ||
{ | ||
mat_t PV = mat_mul_mat(camera_proj_transform(cam), | ||
camera_view_transform(cam)); | ||
|
||
return mat_mul_vec(PV, v); | ||
} | ||
|
||
uint32_t shader_fragment() | ||
{ | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#pragma once | ||
|
||
#include "camera.h" | ||
|
||
void shader_set_camera(camera_t* cam); | ||
vec4_t shader_vertex(vec4_t v); | ||
uint32_t shader_fragment(); |