|
54 | 54 | }; |
55 | 55 |
|
56 | 56 | # Some global variables. |
57 | | -my $useMipMap = 1; |
58 | 57 | my $hasFBO = 0; |
59 | 58 | my $hasVBO = 0; |
60 | 59 | my $hasFragProg = 0; |
@@ -498,32 +497,18 @@ sub ourBuildTextures |
498 | 497 | glBindTexture(GL_TEXTURE_2D, $TextureID_image); |
499 | 498 |
|
500 | 499 | # Use MipMap |
501 | | - if ($useMipMap) |
| 500 | + print "Using Mipmap\n"; |
| 501 | + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, |
| 502 | + GL_NEAREST_MIPMAP_LINEAR); |
| 503 | + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, |
| 504 | + GL_NEAREST_MIPMAP_LINEAR); |
| 505 | + # The GLU library helps us build MipMaps for our texture. |
| 506 | + if (($gluerr = gluBuild2DMipmaps_c(GL_TEXTURE_2D, $Tex_Type, |
| 507 | + $Tex_Width, $Tex_Height, $Tex_Format, $Tex_Size, |
| 508 | + $Tex_Pixels->ptr()))) |
502 | 509 | { |
503 | | - print "Using Mipmap\n"; |
504 | | - |
505 | | - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, |
506 | | - GL_NEAREST_MIPMAP_LINEAR); |
507 | | - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, |
508 | | - GL_NEAREST_MIPMAP_LINEAR); |
509 | | - |
510 | | - # The GLU library helps us build MipMaps for our texture. |
511 | | - if (($gluerr = gluBuild2DMipmaps_c(GL_TEXTURE_2D, $Tex_Type, |
512 | | - $Tex_Width, $Tex_Height, $Tex_Format, $Tex_Size, |
513 | | - $Tex_Pixels->ptr()))) |
514 | | - { |
515 | | - printf STDERR "GLULib%s\n", gluErrorString($gluerr); |
516 | | - exit(-1); |
517 | | - } |
518 | | - } |
519 | | - # Use normal texture - Note: dimensions must be power of 2 |
520 | | - else |
521 | | - { |
522 | | - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); |
523 | | - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); |
524 | | - |
525 | | - glTexImage2D_c(GL_TEXTURE_2D, 0, $Tex_Type, $Tex_Width, $Tex_Height, |
526 | | - 0, $Tex_Format, $Tex_Size, $Tex_Pixels->ptr()); |
| 510 | + printf STDERR "GLULib%s\n", gluErrorString($gluerr); |
| 511 | + exit(-1); |
527 | 512 | } |
528 | 513 |
|
529 | 514 | # Benchmarks for Image Loading |
@@ -635,7 +620,7 @@ sub ourInitShaders |
635 | 620 |
|
636 | 621 | # NOP Vertex shader |
637 | 622 | my $VertexProg = qq |
638 | | - {!!ARBvp1.0 |
| 623 | + {!!ARBvp1.0 |
639 | 624 | PARAM center = program.local[0]; |
640 | 625 | PARAM xform[4] = {program.local[1..4]}; |
641 | 626 | TEMP vertexClip; |
@@ -686,7 +671,7 @@ sub ourInitShaders |
686 | 671 |
|
687 | 672 | # Lazy Metalic Fragment shader |
688 | 673 | my $FragProg = qq |
689 | | - {!!ARBfp1.0 |
| 674 | + {!!ARBfp1.0 |
690 | 675 | PARAM surfacecolor = program.local[5]; |
691 | 676 | TEMP color; |
692 | 677 | MUL color, fragment.texcoord[0].y, 2.0; |
|
0 commit comments