ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC/Texture.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC/Texture.pm (file contents):
Revision 1.11 by root, Sun Jul 30 13:16:44 2006 UTC vs.
Revision 1.12 by root, Sun Aug 13 16:29:36 2006 UTC

84#} 84#}
85 85
86sub new_from_opengl { 86sub new_from_opengl {
87 my ($class, $w, $h, $cb) = @_; 87 my ($class, $w, $h, $cb) = @_;
88 88
89 $class->new (w => $w || 1, h => $h || 1, render_cb => $cb) 89 $class->new (w => $w || 1, h => $h || 1, render_cb => $cb, nearest => 1)
90} 90}
91 91
92sub upload { 92sub upload {
93 my ($self) = @_; 93 my ($self) = @_;
94 94
135 } else { 135 } else {
136 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, $GL_VERSION >= 1.2 ? GL_CLAMP_TO_EDGE : GL_CLAMP; 136 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, $GL_VERSION >= 1.2 ? GL_CLAMP_TO_EDGE : GL_CLAMP;
137 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, $GL_VERSION >= 1.2 ? GL_CLAMP_TO_EDGE : GL_CLAMP; 137 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, $GL_VERSION >= 1.2 ? GL_CLAMP_TO_EDGE : GL_CLAMP;
138 } 138 }
139 139
140 if ($::FAST) { 140 if ($::FAST || $self->{nearest}) {
141 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST; 141 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST;
142 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST; 142 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST;
143 } elsif ($self->{mipmap} && $GL_VERSION >= 1.4) { 143 } elsif ($self->{mipmap} && $GL_VERSION >= 1.4) {
144 glTexParameter GL_TEXTURE_2D, GL_GENERATE_MIPMAP, 1; 144 glTexParameter GL_TEXTURE_2D, GL_GENERATE_MIPMAP, 1;
145 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR; 145 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines