… | |
… | |
153 | sub view_item { |
153 | sub view_item { |
154 | ("\t" x ($indent / 4)) |
154 | ("\t" x ($indent / 4)) |
155 | . $_[1]->title->present ($_[0]) |
155 | . $_[1]->title->present ($_[0]) |
156 | . "\n" |
156 | . "\n" |
157 | . $_[1]->content->present ($_[0]) |
157 | . $_[1]->content->present ($_[0]) |
|
|
158 | } |
|
|
159 | |
|
|
160 | sub view_verbatim { |
|
|
161 | (join "", |
|
|
162 | map +("\t" x ($indent / 2)) . "$_\n", |
|
|
163 | split /\n/, CFClient::UI::Label::escape ($_[1])) |
|
|
164 | . "\n" |
158 | } |
165 | } |
159 | |
166 | |
160 | sub view_textblock { |
167 | sub view_textblock { |
161 | ("\t" x ($indent / 2)) . "$_[1]\n\n" |
168 | ("\t" x ($indent / 2)) . "$_[1]\n\n" |
162 | } |
169 | } |
… | |
… | |
348 | glGetError; |
355 | glGetError; |
349 | |
356 | |
350 | if (defined $data) { |
357 | if (defined $data) { |
351 | glTexImage2D GL_TEXTURE_2D, 0, |
358 | glTexImage2D GL_TEXTURE_2D, 0, |
352 | $self->{internalformat}, |
359 | $self->{internalformat}, |
353 | $tw, $th, # need to pad texture first |
360 | $tw, $th, |
354 | 0, |
361 | 0, |
355 | $self->{format}, |
362 | $self->{format}, |
356 | $self->{type}, |
363 | $self->{type}, |
357 | $data; |
364 | $data; |
358 | CFClient::gl_check "uploading texture %dx%d if=%x f=%x t=%x", |
365 | CFClient::gl_check "uploading texture %dx%d if=%x f=%x t=%x", |
… | |
… | |
364 | $tw, $th, |
371 | $tw, $th, |
365 | 0; |
372 | 0; |
366 | CFClient::gl_check "copying to texture %dx%d if=%x", |
373 | CFClient::gl_check "copying to texture %dx%d if=%x", |
367 | $tw, $th, $self->{internalformat}; |
374 | $tw, $th, $self->{internalformat}; |
368 | } |
375 | } |
|
|
376 | |
|
|
377 | glBindTexture GL_TEXTURE_2D, 0; # just to be on the safe side |
369 | } |
378 | } |
370 | |
379 | |
371 | sub DESTROY { |
380 | sub DESTROY { |
372 | my ($self) = @_; |
381 | my ($self) = @_; |
373 | |
382 | |
… | |
… | |
375 | |
384 | |
376 | glDeleteTexture delete $self->{name} |
385 | glDeleteTexture delete $self->{name} |
377 | if $self->{name}; |
386 | if $self->{name}; |
378 | } |
387 | } |
379 | |
388 | |
380 | sub restore_state{ |
389 | sub restore_state { |
381 | $_->upload |
390 | $_->upload |
382 | for values %TEXTURES; |
391 | for values %TEXTURES; |
383 | }; |
392 | } |
384 | |
393 | |
385 | 1; |
394 | 1; |
386 | |
395 | |
387 | =back |
396 | =back |
388 | |
397 | |