medfall

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

commit 8623d653d8652230c2fec2bb9813e1be29c054ba
parent 16e8cc34eac3c9edeea208e2f2b1438e324bef58
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Fri Dec 30 21:29:59 +0200

Remove the checkerboard

Diffstat:
bsp.cc | 56--------------------------------------------------------
1 file changed, 0 insertions(+), 56 deletions(-)
diff --git a/bsp.cc b/bsp.cc @@ -396,60 +396,4 @@ extern "C" GAME_FRAME( game_frame ) { immediate_render_state.ubs[ UB_VS_HOT ] = test_ub; immediate_render( &imm, immediate_render_state ); - const v4 checkerboard[] = { - v4( 0, 0, 0, 0.5 ), - v4( 1, 1, 1, 0.5 ), - v4( 1, 1, 1, 0.5 ), - v4( 0, 0, 0, 0.5 ), - }; - TextureConfig texture_config; - texture_config.width = 2; - texture_config.height = 2; - texture_config.data = checkerboard; - Texture texture = renderer_new_texture( texture_config ); - - const float aspect = 640.0f / 480.0f; - const v4 white( 1, 1, 1, 1 ); - const int num_checks = 20; - - v3 positions[] = { - v3( 0.5, 1.0, 0 ), - v3( 1, 1, 0 ), - v3( 0.5, 0.5, 0 ), - v3( 0.5, 0.5, 0 ), - v3( 1, 1, 0 ), - v3( 1, 0.5, 0 ), - }; - float colours[] = { - 1, 1, 1, - 1, 1, 1, - 1, 1, 1, - 1, 1, 1, - 1, 1, 1, - 1, 1, 1, - }; - v2 texcoords[] = { - v2( 0, 0 ), - v2( num_checks, 0 ), - v2( 0, num_checks / aspect ), - v2( 0, num_checks / aspect ), - v2( num_checks, 0 ), - v2( num_checks, num_checks / aspect ), - }; - - MeshConfig mesh_config; - mesh_config.positions = renderer_new_vb( positions, sizeof( positions ) ); - mesh_config.colours = renderer_new_vb( colours, sizeof( colours ) ); - mesh_config.tex_coords0 = renderer_new_vb( texcoords, sizeof( texcoords ) ); - mesh_config.num_vertices = 6; - Mesh mesh = renderer_new_mesh( mesh_config ); - - RenderState render_state2; - render_state2.shader = texture_shader; - render_state2.textures[ 0 ] = texture; - - renderer_draw_mesh( mesh, render_state2 ); - - renderer_delete_mesh( mesh ); - renderer_delete_texture( texture ); }