commit 392f5e6196e2ae934d0e071517d7be5bb528eb7f parent 195240962683e56b337feb05f702b495c564b94c Author: Michael Savage <mikejsavage@gmail.com> Date: Wed Oct 12 22:52:37 +0300 Lose the checkerboard Diffstat:
hm.cc | | | 35 | ----------------------------------- |
diff --git a/hm.cc b/hm.cc @@ -303,41 +303,6 @@ extern "C" GAME_FRAME( game_frame ) { ImmediateTriangle asdf[ 32 ]; immediate_init( &imm, asdf, 32 ); - GLuint tex; - glActiveTexture( GL_TEXTURE0 ); - glGenTextures( 1, &tex ); - glBindTexture( GL_TEXTURE_2D, tex ); - - const glm::vec4 checkerboard[] = { - glm::vec4( 0, 0, 0, 0.5 ), - glm::vec4( 1, 1, 1, 0.5 ), - glm::vec4( 1, 1, 1, 0.5 ), - glm::vec4( 0, 0, 0, 0.5 ), - }; - - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ); - - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); - - glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, 2, 2, 0, GL_RGBA, GL_FLOAT, checkerboard ); - - const float aspect = 640.0f / 480.0f; - const glm::vec4 white( 1, 1, 1, 1 ); - const int num_checks = 20; - - const ImmediateVertex v1 = { glm::vec3( 0.5, 1.0, 0 ), white, glm::vec2( 0, 0 ) }; - const ImmediateVertex v2 = { glm::vec3( 1.0, 1.0, 0 ), white, glm::vec2( num_checks, 0 ) }; - const ImmediateVertex v3 = { glm::vec3( 0.5, 0.5, 0 ), white, glm::vec2( 0, num_checks / aspect ) }; - const ImmediateVertex v4 = { glm::vec3( 1.0, 0.5, 0 ), white, glm::vec2( num_checks, num_checks / aspect ) }; - - immediate_triangle( &imm, v1, v2, v3 ); - immediate_triangle( &imm, v3, v2, v4 ); - immediate_render( &imm, game->test_tex_at_pos, game->test_tex_at_colour, true, game->test_tex_at_uv, game->test_tex_un_tex ); - glDeleteTextures( 1, &tex ); - glBindTexture( GL_TEXTURE_2D, 0 ); - glUseProgram( game->font_shader ); // TODO: the positions don't make sense draw_string( game, -140, -100, "hello", game->font_at_position, game->font_at_colour, game->font_at_uv, game->font_un_atlas );