1 | package Crossfire::Client::Widget; |
1 | package Crossfire::Client::Widget; |
|
|
2 | |
2 | use strict; |
3 | use strict; |
3 | |
4 | |
4 | our $FOCUS; # the widget with current focus |
5 | our $FOCUS; # the widget with current focus |
5 | our %ACTIVE_WIDGETS; |
6 | our %ACTIVE_WIDGETS; |
6 | |
7 | |
… | |
… | |
59 | } |
60 | } |
60 | |
61 | |
61 | package Client::TextView; |
62 | package Client::TextView; |
62 | |
63 | |
63 | use strict; |
64 | use strict; |
|
|
65 | |
64 | our @ISA = qw/Client::Widget/; |
66 | our @ISA = qw/Client::Widget/; |
65 | |
67 | |
66 | use SDL::OpenGL; |
68 | use SDL::OpenGL; |
67 | use SDL::OpenGL::Constants; |
69 | use SDL::OpenGL::Constants; |
68 | |
70 | |
… | |
… | |
90 | } |
92 | } |
91 | |
93 | |
92 | sub key_up { |
94 | sub key_up { |
93 | } |
95 | } |
94 | |
96 | |
95 | my $x; |
|
|
96 | |
|
|
97 | sub draw { |
97 | sub draw { |
98 | glEnable GL_TEXTURE_2D; |
98 | glEnable GL_TEXTURE_2D; |
99 | glEnable GL_BLEND; |
99 | glEnable GL_BLEND; |
100 | |
|
|
101 | glPushMatrix; |
|
|
102 | |
100 | |
103 | my $map = $::CONN->{map}; |
101 | my $map = $::CONN->{map}; |
104 | |
102 | |
105 | for my $x (0 .. $::CONN->{mapw} - 1) { |
103 | for my $x (0 .. $::CONN->{mapw} - 1) { |
106 | for my $y (0 .. $::CONN->{maph} - 1) { |
104 | for my $y (0 .. $::CONN->{maph} - 1) { |
… | |
… | |
124 | glEnd; |
122 | glEnd; |
125 | } |
123 | } |
126 | } |
124 | } |
127 | } |
125 | } |
128 | |
126 | |
129 | glPopMatrix; |
|
|
130 | |
|
|
131 | glDisable GL_TEXTURE_2D; |
127 | glDisable GL_TEXTURE_2D; |
132 | glDisable GL_BLEND; |
128 | glDisable GL_BLEND; |
133 | } |
129 | } |
134 | |
130 | |
135 | 1; |
131 | 1; |