ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libgender/shader.C
(Generate patch)

Comparing libgender/shader.C (file contents):
Revision 1.21 by root, Fri Oct 29 22:32:49 2004 UTC vs.
Revision 1.22 by root, Fri Oct 29 23:19:08 2004 UTC

113 113
114 void stream_i::build (shader_builder &b) 114 void stream_i::build (shader_builder &b)
115 { 115 {
116 var_i::build (b); 116 var_i::build (b);
117 117
118#if 0
118 if (find (b.streams.begin (), b.streams.end (), var (*this)) == b.streams.end ()) 119 if (find (b.streams.begin (), b.streams.end (), var (*this)) == b.streams.end ())
119 b.streams.push_back (*this); 120 b.streams.push_back (*this);
121#endif
120 } 122 }
121 123
122 void temporary_i::build (shader_builder &b) 124 void temporary_i::build (shader_builder &b)
123 { 125 {
124 var_i::build (b); 126 var_i::build (b);
192 { 194 {
193 (*i)->build_decl (os); 195 (*i)->build_decl (os);
194 os << ";\n"; 196 os << ";\n";
195 } 197 }
196 198
199#if 0
197 // not neccessary right now, as GLSL is rich on predefinitions 200 // not neccessary right now, as GLSL is rich on predefinitions
198 for (vector<var>::iterator i = b.streams.begin (); i != b.streams.end (); i++) 201 for (vector<var>::iterator i = b.streams.begin (); i != b.streams.end (); i++)
199 { 202 {
200 os << "attribute "; 203 os << "attribute ";
201 (*i)->build_decl (os); 204 (*i)->build_decl (os);
202 os << ";\n"; 205 os << ";\n";
203 } 206 }
207#endif
204 208
205 os << "\nvoid main (void)\n{\n"; 209 os << "\nvoid main (void)\n{\n";
206 210
207 for (vector<var>::iterator i = b.temps.begin (); i != b.temps.end (); i++) 211 for (vector<var>::iterator i = b.temps.begin (); i != b.temps.end (); i++)
208 { 212 {
305 printf ("LINK-INFOLOG<%s>\n", infolog); 309 printf ("LINK-INFOLOG<%s>\n", infolog);
306 abort (); 310 abort ();
307 } 311 }
308 312
309 uloc.clear (); 313 uloc.clear ();
314 }
315
316 void program_object::enable ()
317 {
318 glUseProgramObjectARB (id);
319 //TODO: set samplers here
320 cur = this;
321 }
322
323 void program_object::disable ()
324 {
325 //TODO: clear samplers here
326 glUseProgramObjectARB (0);
327 cur = 0;
310 } 328 }
311 329
312 void sl_func0::begin () const 330 void sl_func0::begin () const
313 { 331 {
314 cur->append_string (name_par); 332 cur->append_string (name_par);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines