medfall

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit bf2ea05f320597a8ce6b47c6adfdbc87de0b5035
parent 2fcd4aa48f536745a3e08bda11d9103eb7198dc1
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sun Dec  4 11:04:56 +0200

Add polygon mode/wireframe to renderer

Diffstat:
renderer.cc | 8++++++++
renderer.h | 1+
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/renderer.cc b/renderer.cc @@ -510,6 +510,14 @@ void renderer_draw_mesh( const Mesh & mesh, RenderState state ) { glDisable( GL_BLEND ); } + // polygon fill mode + if( state.wireframe ) { + glPolygonMode( GL_FRONT_AND_BACK, GL_LINE ); + } + else { + glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ); + } + // TODO: missing a bunch of stuff here GLenum primitive = primitivetype_to_glenum( mesh.primitive_type ); diff --git a/renderer.h b/renderer.h @@ -69,6 +69,7 @@ struct RenderState { bool disable_depth_writes; bool disable_colour_writes; bool enable_alpha_blending; + bool wireframe; }; enum PrimitiveType {