Added toggleable draw modes, GL_TRIANGLES, GL_POINTS and GL_LINES along with initial work on debug rendering
parent
8210ba663c
commit
4a091cea9a
@ -0,0 +1,10 @@ |
|||||||
|
//include version.glsl |
||||||
|
|
||||||
|
uniform vec3 wireframe_color; |
||||||
|
|
||||||
|
out vec4 frag_color; |
||||||
|
|
||||||
|
void main() |
||||||
|
{ |
||||||
|
frag_color = vec4(wireframe_color, 1.0); |
||||||
|
} |
@ -0,0 +1,10 @@ |
|||||||
|
//include version.glsl |
||||||
|
|
||||||
|
uniform mat4 mvp; |
||||||
|
|
||||||
|
in vec3 vPosition; |
||||||
|
|
||||||
|
void main() |
||||||
|
{ |
||||||
|
gl_Position = mvp * vec4(vPosition, 1.0); |
||||||
|
} |
@ -1,26 +1,28 @@ |
|||||||
#ifndef model_H |
#ifndef MODEL_H |
||||||
#define model_H |
#define MODEL_H |
||||||
|
|
||||||
#include "linmath.h" |
#include "linmath.h" |
||||||
|
#include "geometry.h" |
||||||
|
|
||||||
struct Camera; |
struct Camera; |
||||||
struct Material_Param; |
struct Material_Param; |
||||||
|
|
||||||
struct Model |
struct Model |
||||||
{ |
{ |
||||||
int node; |
int node; |
||||||
int geometry_index; |
int geometry_index; |
||||||
int material; |
int material; |
||||||
struct Material_Param* material_params; |
struct Material_Param* material_params; |
||||||
}; |
}; |
||||||
|
|
||||||
struct Model* model_get(int index); |
struct Model* model_get(int index); |
||||||
void model_init(void); |
struct Model* model_get_all(void); |
||||||
int model_create(int node, const char* geo_name, const char* material_name); |
void model_init(void); |
||||||
void model_remove(int index); |
int model_create(int node, const char* geo_name, const char* material_name); |
||||||
void model_cleanup(void); |
void model_remove(int index); |
||||||
void model_render_all(struct Camera* camera); |
void model_cleanup(void); |
||||||
int model_set_material_param(struct Model* model, const char* name, void* value); |
void model_render_all(struct Camera* camera, enum Geometry_Draw_Mode draw_mode); |
||||||
int model_get_material_param(struct Model* model, const char* name, void* value_out); |
int model_set_material_param(struct Model* model, const char* name, void* value); |
||||||
|
int model_get_material_param(struct Model* model, const char* name, void* value_out); |
||||||
|
|
||||||
#endif |
#endif |
||||||
|
Loading…
Reference in new issue