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

Comparing libgender/shader.C (file contents):
Revision 1.11 by root, Sun Oct 24 01:55:00 2004 UTC vs.
Revision 1.12 by root, Sun Oct 24 02:13:43 2004 UTC

1#include <cassert>
2
1#include "shader.h" 3#include "shader.h"
2#include "shader_vars.h" 4#include "shader_vars.h"
3 5
4namespace shader { 6namespace shader {
5 7
155 157
156 shader_object_i::shader_object_i (GLenum type) 158 shader_object_i::shader_object_i (GLenum type)
157 : type (type) 159 : type (type)
158 { 160 {
159 id = glCreateShaderObjectARB (type); 161 id = glCreateShaderObjectARB (type);
162 assert (id);
160 } 163 }
161 164
162 shader_object_i::~shader_object_i () 165 shader_object_i::~shader_object_i ()
163 { 166 {
164 glDeleteObjectARB (id); 167 glDeleteObjectARB (id);
228 { 231 {
229 char infolog[8192]; 232 char infolog[8192];
230 glGetInfoLogARB (id, 8192, NULL, infolog); 233 glGetInfoLogARB (id, 8192, NULL, infolog);
231 printf ("SOURCE<%s>\n", src.c_str ()); 234 printf ("SOURCE<%s>\n", src.c_str ());
232 printf ("INFOLOG<%s>\n", infolog); 235 printf ("INFOLOG<%s>\n", infolog);
236 abort ();
237 }
238 }
239
240 program_object::program_object ()
241 {
242 id = glCreateProgramObjectARB ();
243 assert (id);
244 }
245
246 program_object::~program_object ()
247 {
248 glDeleteProgramsARB (1, &id);
249 }
250
251 void program_object::link ()
252 {
253 glAttachObjectARB (id, vsh->id);
254 glAttachObjectARB (id, fsh->id);
255 glLinkProgramARB (id);
256
257 GLint linked;
258 glGetObjectParameterivARB (id, GL_OBJECT_LINK_STATUS_ARB, &linked);
259
260 if (!linked)
261 {
262 char infolog[8192];
263 glGetInfoLogARB (id, 8192, NULL, infolog);
264 printf ("LINK-INFOLOG<%s>\n", infolog);
233 abort (); 265 abort ();
234 } 266 }
235 } 267 }
236 268
237 void sl_func0::begin () const 269 void sl_func0::begin () const

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines