~ubuntu-branches/ubuntu/oneiric/nux/oneiric

« back to all changes in this revision

Viewing changes to NuxGraphics/GLShader2.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-11-18 19:17:32 UTC
  • Revision ID: james.westby@ubuntu.com-20101118191732-rn35790vekj6o4my
Tags: upstream-0.9.4
ImportĀ upstreamĀ versionĀ 0.9.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2010 Inalogic Inc.
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify it
 
5
 * under the terms of the GNU Lesser General Public License version 3, as
 
6
 * published by the  Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful, but
 
9
 * WITHOUT ANY WARRANTY; without even the implied warranties of
 
10
 * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
 
11
 * PURPOSE.  See the applicable version of the GNU Lesser General Public
 
12
 * License for more details.
 
13
 *
 
14
 * You should have received a copy of both the GNU Lesser General Public
 
15
 * License version 3 along with this program.  If not, see
 
16
 * <http://www.gnu.org/licenses/>
 
17
 *
 
18
 * Authored by: Jay Taoko <jay.taoko_AT_gmail_DOT_com>
 
19
 *
 
20
 */
 
21
 
 
22
 
 
23
#include "NuxCore/NuxCore.h"
 
24
#include "GLResource.h"
 
25
#include "GLShader.h"
 
26
#include "GLDeviceObjects.h"
 
27
 
 
28
namespace nux
 
29
{
 
30
// //-----------------------------------------------------------------------------
 
31
// bool IOpenGLShaderProgram::SetUniform1f(char* varname, GLfloat v0)
 
32
// {
 
33
//     //if (!useGLSL) return false; // GLSL not available
 
34
//     //if (!_noshader) return true;
 
35
//
 
36
//     GLint loc = GetUniformLocationARB(varname);
 
37
//     if (loc==-1) return false;  // can't find variable
 
38
//
 
39
//     glUniform1fARB(loc, v0);
 
40
//
 
41
//     return true;
 
42
// }
 
43
// bool IOpenGLShaderProgram::SetUniform1f(GLint loc, GLfloat v0)
 
44
// {
 
45
//     //if (!useGLSL) return false; // GLSL not available
 
46
//     //if (!_noshader) return true;
 
47
//
 
48
//     if (loc==-1) return false;  // can't find variable
 
49
//     glUniform1fARB(loc, v0);
 
50
//     return true;
 
51
// }
 
52
//
 
53
// //-----------------------------------------------------------------------------
 
54
//
 
55
// bool IOpenGLShaderProgram::SetUniform2f(char* varname, GLfloat v0, GLfloat v1)
 
56
// {
 
57
//     //if (!useGLSL) return false; // GLSL not available
 
58
//     //if (!_noshader) return true;
 
59
//
 
60
//     GLint loc = GetUniformLocationARB(varname);
 
61
//     if (loc==-1) return false;  // can't find variable
 
62
//
 
63
//     glUniform2fARB(loc, v0, v1);
 
64
//
 
65
//     return true;
 
66
// }
 
67
// bool IOpenGLShaderProgram::SetUniform2f(GLint loc, GLfloat v0, GLfloat v1)
 
68
// {
 
69
//     //if (!useGLSL) return false; // GLSL not available
 
70
//     //if (!_noshader) return true;
 
71
//
 
72
//     if (loc==-1) return false;  // can't find variable
 
73
//     glUniform2fARB(loc, v0, v1);
 
74
//     return true;
 
75
// }
 
76
// //-----------------------------------------------------------------------------
 
77
//
 
78
// bool IOpenGLShaderProgram::SetUniform3f(char* varname, GLfloat v0, GLfloat v1, GLfloat v2)
 
79
// {
 
80
//     //if (!useGLSL) return false; // GLSL not available
 
81
//     //if (!_noshader) return true;
 
82
//
 
83
//     GLint loc = GetUniformLocationARB(varname);
 
84
//     if (loc==-1) return false;  // can't find variable
 
85
//
 
86
//     glUniform3fARB(loc, v0, v1, v2);
 
87
//
 
88
//     return true;
 
89
// }
 
90
// bool IOpenGLShaderProgram::SetUniform3f(GLint loc, GLfloat v0, GLfloat v1, GLfloat v2)
 
91
// {
 
92
//     //if (!useGLSL) return false; // GLSL not available
 
93
//     //if (!_noshader) return true;
 
94
//
 
95
//     if (loc==-1) return false;  // can't find variable
 
96
//
 
97
//     glUniform3fARB(loc, v0, v1, v2);
 
98
//
 
99
//     return true;
 
100
// }
 
101
// //-----------------------------------------------------------------------------
 
102
//
 
103
// bool IOpenGLShaderProgram::SetUniform4f(char* varname, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
 
104
// {
 
105
//     //if (!useGLSL) return false; // GLSL not available
 
106
//     //if (!_noshader) return true;
 
107
//
 
108
//     GLint loc = GetUniformLocationARB(varname);
 
109
//     if (loc==-1) return false;  // can't find variable
 
110
//
 
111
//     glUniform4fARB(loc, v0, v1, v2, v3);
 
112
//
 
113
//     return true;
 
114
// }
 
115
// bool IOpenGLShaderProgram::SetUniform4f(GLint loc, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
 
116
// {
 
117
//     //if (!useGLSL) return false; // GLSL not available
 
118
//     //if (!_noshader) return true;
 
119
//
 
120
//     if (loc==-1) return false;  // can't find variable
 
121
//
 
122
//     glUniform4fARB(loc, v0, v1, v2, v3);
 
123
//
 
124
//     return true;
 
125
// }
 
126
// //-----------------------------------------------------------------------------
 
127
//
 
128
// bool IOpenGLShaderProgram::SetUniform1i(char* varname, GLint v0)
 
129
// {
 
130
//     //if (!useGLSL) return false; // GLSL not available
 
131
//     //if (!_noshader) return true;
 
132
//
 
133
//     GLint loc = GetUniformLocationARB(varname);
 
134
//     if (loc==-1) return false;  // can't find variable
 
135
//
 
136
//     glUniform1iARB(loc, v0);
 
137
//
 
138
//     return true;
 
139
// }
 
140
// bool IOpenGLShaderProgram::SetUniform1i(GLint loc, GLint v0)
 
141
// {
 
142
//     //if (!useGLSL) return false; // GLSL not available
 
143
//     //if (!_noshader) return true;
 
144
//
 
145
//     if (loc==-1) return false;  // can't find variable
 
146
//
 
147
//     glUniform1iARB(loc, v0);
 
148
//
 
149
//     return true;
 
150
// }
 
151
//
 
152
// bool IOpenGLShaderProgram::SetUniform2i(char* varname, GLint v0, GLint v1)
 
153
// {
 
154
//     //    if (!useGLSL) return false; // GLSL not available
 
155
//     //    if (!_noshader) return true;
 
156
//
 
157
//     GLint loc = GetUniformLocationARB(varname);
 
158
//     if (loc==-1) return false;  // can't find variable
 
159
//
 
160
//     glUniform2iARB(loc, v0, v1);
 
161
//
 
162
//
 
163
//     return true;
 
164
// }
 
165
// bool IOpenGLShaderProgram::SetUniform2i(GLint loc, GLint v0, GLint v1)
 
166
// {
 
167
//     //    if (!useGLSL) return false; // GLSL not available
 
168
//     //    if (!_noshader) return true;
 
169
//
 
170
//     if (loc==-1) return false;  // can't find variable
 
171
//
 
172
//     glUniform2iARB(loc, v0, v1);
 
173
//
 
174
//
 
175
//     return true;
 
176
// }
 
177
// //-----------------------------------------------------------------------------
 
178
//
 
179
// bool IOpenGLShaderProgram::SetUniform3i(char* varname, GLint v0, GLint v1, GLint v2)
 
180
// {
 
181
//     //    if (!useGLSL) return false; // GLSL not available
 
182
//     //    if (!_noshader) return true;
 
183
//
 
184
//     GLint loc = GetUniformLocationARB(varname);
 
185
//     if (loc==-1) return false;  // can't find variable
 
186
//
 
187
//     glUniform3iARB(loc, v0, v1, v2);
 
188
//
 
189
//     return true;
 
190
// }
 
191
// bool IOpenGLShaderProgram::SetUniform3i(GLint loc, GLint v0, GLint v1, GLint v2)
 
192
// {
 
193
//     //    if (!useGLSL) return false; // GLSL not available
 
194
//     //    if (!_noshader) return true;
 
195
//
 
196
//     if (loc==-1) return false;  // can't find variable
 
197
//
 
198
//     glUniform3iARB(loc, v0, v1, v2);
 
199
//
 
200
//     return true;
 
201
// }
 
202
//
 
203
// bool IOpenGLShaderProgram::SetUniform4i(char* varname, GLint v0, GLint v1, GLint v2, GLint v3)
 
204
// {
 
205
//     //    if (!useGLSL) return false; // GLSL not available
 
206
//     //    if (!_noshader) return true;
 
207
//
 
208
//     GLint loc = GetUniformLocationARB(varname);
 
209
//     if (loc==-1) return false;  // can't find variable
 
210
//
 
211
//     glUniform4iARB(loc, v0, v1, v2, v3);
 
212
//
 
213
//     return true;
 
214
// }
 
215
// bool IOpenGLShaderProgram::SetUniform4i(GLint loc, GLint v0, GLint v1, GLint v2, GLint v3)
 
216
// {
 
217
//     //    if (!useGLSL) return false; // GLSL not available
 
218
//     //    if (!_noshader) return true;
 
219
//
 
220
//     if (loc==-1) return false;  // can't find variable
 
221
//
 
222
//     glUniform4iARB(loc, v0, v1, v2, v3);
 
223
//
 
224
//     return true;
 
225
// }
 
226
// //-----------------------------------------------------------------------------
 
227
//
 
228
// bool IOpenGLShaderProgram::SetUniform1fv(char* varname, GLsizei count, GLfloat *value)
 
229
// {
 
230
//     //    if (!useGLSL) return false; // GLSL not available
 
231
//     //    if (!_noshader) return true;
 
232
//
 
233
//     GLint loc = GetUniformLocationARB(varname);
 
234
//     if (loc==-1) return false;  // can't find variable
 
235
//
 
236
//     glUniform1fvARB(loc, count, value);
 
237
//
 
238
//     return true;
 
239
// }
 
240
// bool IOpenGLShaderProgram::SetUniform1fv(GLint loc, GLsizei count, GLfloat *value)
 
241
// {
 
242
//     //    if (!useGLSL) return false; // GLSL not available
 
243
//     //    if (!_noshader) return true;
 
244
//
 
245
//     if (loc==-1) return false;  // can't find variable
 
246
//
 
247
//     glUniform1fvARB(loc, count, value);
 
248
//
 
249
//     return true;
 
250
// }
 
251
//
 
252
// bool IOpenGLShaderProgram::SetUniform2fv(char* varname, GLsizei count, GLfloat *value)
 
253
// {
 
254
//     //    if (!useGLSL) return false; // GLSL not available
 
255
//     //    if (!_noshader) return true;
 
256
//
 
257
//     GLint loc = GetUniformLocationARB(varname);
 
258
//     if (loc==-1) return false;  // can't find variable
 
259
//
 
260
//     glUniform2fvARB(loc, count, value);
 
261
//
 
262
//     return true;
 
263
// }
 
264
// bool IOpenGLShaderProgram::SetUniform2fv(GLint loc, GLsizei count, GLfloat *value)
 
265
// {
 
266
//     //    if (!useGLSL) return false; // GLSL not available
 
267
//     //    if (!_noshader) return true;
 
268
//
 
269
//     if (loc==-1) return false;  // can't find variable
 
270
//
 
271
//     glUniform2fvARB(loc, count, value);
 
272
//
 
273
//     return true;
 
274
// }
 
275
// //-----------------------------------------------------------------------------
 
276
//
 
277
// bool IOpenGLShaderProgram::SetUniform3fv(char* varname, GLsizei count, GLfloat *value)
 
278
// {
 
279
//     //    if (!useGLSL) return false; // GLSL not available
 
280
//     //    if (!_noshader) return true;
 
281
//
 
282
//     GLint loc = GetUniformLocationARB(varname);
 
283
//     if (loc==-1) return false;  // can't find variable
 
284
//
 
285
//     glUniform3fvARB(loc, count, value);
 
286
//
 
287
//     return true;
 
288
// }
 
289
// bool IOpenGLShaderProgram::SetUniform3fv(GLint loc, GLsizei count, GLfloat *value)
 
290
// {
 
291
//     //    if (!useGLSL) return false; // GLSL not available
 
292
//     //    if (!_noshader) return true;
 
293
//
 
294
//     if (loc==-1) return false;  // can't find variable
 
295
//
 
296
//     glUniform3fvARB(loc, count, value);
 
297
//
 
298
//     return true;
 
299
// }
 
300
// //-----------------------------------------------------------------------------
 
301
//
 
302
// bool IOpenGLShaderProgram::SetUniform4fv(char* varname, GLsizei count, GLfloat *value)
 
303
// {
 
304
//     //    if (!useGLSL) return false; // GLSL not available
 
305
//     //    if (!_noshader) return true;
 
306
//
 
307
//     GLint loc = GetUniformLocationARB(varname);
 
308
//     if (loc==-1) return false;  // can't find variable
 
309
//
 
310
//     glUniform4fvARB(loc, count, value);
 
311
//
 
312
//     return true;
 
313
// }
 
314
// bool IOpenGLShaderProgram::SetUniform4fv(GLint loc, GLsizei count, GLfloat *value)
 
315
// {
 
316
//     //    if (!useGLSL) return false; // GLSL not available
 
317
//     //    if (!_noshader) return true;
 
318
//
 
319
//     if (loc==-1) return false;  // can't find variable
 
320
//
 
321
//     glUniform4fvARB(loc, count, value);
 
322
//
 
323
//     return true;
 
324
// }
 
325
// //-----------------------------------------------------------------------------
 
326
//
 
327
// bool IOpenGLShaderProgram::SetUniform1iv(char* varname, GLsizei count, GLint *value)
 
328
// {
 
329
//     //    if (!useGLSL) return false; // GLSL not available
 
330
//     //    if (!_noshader) return true;
 
331
//
 
332
//     GLint loc = GetUniformLocationARB(varname);
 
333
//     if (loc==-1) return false;  // can't find variable
 
334
//
 
335
//     glUniform1ivARB(loc, count, value);
 
336
//
 
337
//     return true;
 
338
// }
 
339
// bool IOpenGLShaderProgram::SetUniform1iv(GLint loc, GLsizei count, GLint *value)
 
340
// {
 
341
//     //    if (!useGLSL) return false; // GLSL not available
 
342
//     //    if (!_noshader) return true;
 
343
//
 
344
//     if (loc==-1) return false;  // can't find variable
 
345
//
 
346
//     glUniform1ivARB(loc, count, value);
 
347
//
 
348
//     return true;
 
349
// }
 
350
// //-----------------------------------------------------------------------------
 
351
//
 
352
// bool IOpenGLShaderProgram::SetUniform2iv(char* varname, GLsizei count, GLint *value)
 
353
// {
 
354
//     //    if (!useGLSL) return false; // GLSL not available
 
355
//     //    if (!_noshader) return true;
 
356
//
 
357
//     GLint loc = GetUniformLocationARB(varname);
 
358
//     if (loc==-1) return false;  // can't find variable
 
359
//
 
360
//     glUniform2ivARB(loc, count, value);
 
361
//
 
362
//     return true;
 
363
// }
 
364
// bool IOpenGLShaderProgram::SetUniform2iv(GLint loc, GLsizei count, GLint *value)
 
365
// {
 
366
//     //    if (!useGLSL) return false; // GLSL not available
 
367
//     //    if (!_noshader) return true;
 
368
//
 
369
//     if (loc==-1) return false;  // can't find variable
 
370
//
 
371
//     glUniform2ivARB(loc, count, value);
 
372
//
 
373
//     return true;
 
374
// }
 
375
// //-----------------------------------------------------------------------------
 
376
//
 
377
// bool IOpenGLShaderProgram::SetUniform3iv(char* varname, GLsizei count, GLint *value)
 
378
// {
 
379
//     //    if (!useGLSL) return false; // GLSL not available
 
380
//     //    if (!_noshader) return true;
 
381
//
 
382
//     GLint loc = GetUniformLocationARB(varname);
 
383
//     if (loc==-1) return false;  // can't find variable
 
384
//
 
385
//     glUniform3ivARB(loc, count, value);
 
386
//
 
387
//     return true;
 
388
// }
 
389
// bool IOpenGLShaderProgram::SetUniform3iv(GLint loc, GLsizei count, GLint *value)
 
390
// {
 
391
//     //    if (!useGLSL) return false; // GLSL not available
 
392
//     //    if (!_noshader) return true;
 
393
//
 
394
//     if (loc==-1) return false;  // can't find variable
 
395
//
 
396
//     glUniform3ivARB(loc, count, value);
 
397
//
 
398
//     return true;
 
399
// }
 
400
// //-----------------------------------------------------------------------------
 
401
//
 
402
// bool IOpenGLShaderProgram::SetUniform4iv(char* varname, GLsizei count, GLint *value)
 
403
// {
 
404
//     //    if (!useGLSL) return false; // GLSL not available
 
405
//     //    if (!_noshader) return true;
 
406
//
 
407
//     GLint loc = GetUniformLocationARB(varname);
 
408
//     if (loc==-1) return false;  // can't find variable
 
409
//
 
410
//     glUniform4ivARB(loc, count, value);
 
411
//
 
412
//     return true;
 
413
// }
 
414
// bool IOpenGLShaderProgram::SetUniform4iv(GLint loc, GLsizei count, GLint *value)
 
415
// {
 
416
//     //    if (!useGLSL) return false; // GLSL not available
 
417
//     //    if (!_noshader) return true;
 
418
//
 
419
//     if (loc==-1) return false;  // can't find variable
 
420
//
 
421
//     glUniform4ivARB(loc, count, value);
 
422
//
 
423
//     return true;
 
424
// }
 
425
// //-----------------------------------------------------------------------------
 
426
//
 
427
// bool IOpenGLShaderProgram::SetUniformMatrix2fv(char* varname, GLsizei count, GLboolean transpose, GLfloat *value)
 
428
// {
 
429
//     //    if (!useGLSL) return false; // GLSL not available
 
430
//     //    if (!_noshader) return true;
 
431
//
 
432
//     GLint loc = GetUniformLocationARB(varname);
 
433
//     if (loc==-1) return false;  // can't find variable
 
434
//
 
435
//     glUniformMatrix2fvARB(loc, count, transpose, value);
 
436
//
 
437
//     return true;
 
438
// }
 
439
// bool IOpenGLShaderProgram::SetUniformLocMatrix2fv(GLint loc, GLsizei count, GLboolean transpose, GLfloat *value)
 
440
// {
 
441
//     //    if (!useGLSL) return false; // GLSL not available
 
442
//     //    if (!_noshader) return true;
 
443
//
 
444
//     if (loc==-1) return false;  // can't find variable
 
445
//
 
446
//     glUniformMatrix2fvARB(loc, count, transpose, value);
 
447
//
 
448
//     return true;
 
449
// }
 
450
// //-----------------------------------------------------------------------------
 
451
//
 
452
// bool IOpenGLShaderProgram::SetUniformMatrix3fv(char* varname, GLsizei count, GLboolean transpose, GLfloat *value)
 
453
// {
 
454
//     //    if (!useGLSL) return false; // GLSL not available
 
455
//     //    if (!_noshader) return true;
 
456
//
 
457
//     GLint loc = GetUniformLocationARB(varname);
 
458
//     if (loc==-1) return false;  // can't find variable
 
459
//
 
460
//     glUniformMatrix3fvARB(loc, count, transpose, value);
 
461
//
 
462
//     return true;
 
463
// }
 
464
// bool IOpenGLShaderProgram::SetUniformLocMatrix3fv(GLint loc, GLsizei count, GLboolean transpose, GLfloat *value)
 
465
// {
 
466
//     //    if (!useGLSL) return false; // GLSL not available
 
467
//     //    if (!_noshader) return true;
 
468
//
 
469
//     if (loc==-1) return false;  // can't find variable
 
470
//
 
471
//     glUniformMatrix3fvARB(loc, count, transpose, value);
 
472
//
 
473
//     return true;
 
474
// }
 
475
// //-----------------------------------------------------------------------------
 
476
//
 
477
// bool IOpenGLShaderProgram::SetUniformMatrix4fv(char* varname, GLsizei count, GLboolean transpose, GLfloat *value)
 
478
// {
 
479
//     //    if (!useGLSL) return false; // GLSL not available
 
480
//     //    if (!_noshader) return true;
 
481
//
 
482
//     GLint loc = GetUniformLocationARB(varname);
 
483
//     if (loc==-1) return false;  // can't find variable
 
484
//
 
485
//     glUniformMatrix4fvARB(loc, count, transpose, value);
 
486
//
 
487
//     return true;
 
488
// }
 
489
// bool IOpenGLShaderProgram::SetUniformLocMatrix4fv(GLint loc, GLsizei count, GLboolean transpose, GLfloat *value)
 
490
// {
 
491
//     //    if (!useGLSL) return false; // GLSL not available
 
492
//     //    if (!_noshader) return true;
 
493
//
 
494
//     if (loc==-1) return false;  // can't find variable
 
495
//
 
496
//     glUniformMatrix4fvARB(loc, count, transpose, value);
 
497
//
 
498
//     return true;
 
499
// }
 
500
//
 
501
// //-----------------------------------------------------------------------------
 
502
//
 
503
// void IOpenGLShaderProgram::GetUniformfv(char* name, GLfloat* values)
 
504
// {
 
505
//     //     if (!useGLSL) return;
 
506
//     GLint loc;
 
507
//
 
508
//     loc = glGetUniformLocationARB(_OpenGLID, name);
 
509
//     if (loc == -1)
 
510
//     {
 
511
//         std::cout << "Error: can't find uniform variable \"" << name << "\"\n";
 
512
//     }
 
513
//     glGetUniformfvARB(_OpenGLID, loc, values);
 
514
// }
 
515
//
 
516
// //-----------------------------------------------------------------------------
 
517
//
 
518
// void IOpenGLShaderProgram::GetUniformiv(char* name, GLint* values)
 
519
// {
 
520
//     //if (!useGLSL) return;
 
521
//     GLint loc;
 
522
//     loc = glGetUniformLocationARB(_OpenGLID, name);
 
523
//     if (loc == -1)
 
524
//     {
 
525
//         std::cout << "Error: can't find uniform variable \"" << name << "\"\n";
 
526
//     }
 
527
//     glGetUniformivARB(_OpenGLID, loc, values);
 
528
// }
 
529
// //-----------------------------------------------------------------------------
 
530
//
 
531
// int IOpenGLShaderProgram::GetUniformLocationARB(const GLcharARB* name)
 
532
// {
 
533
//     GLint loc;
 
534
//     loc = glGetUniformLocationARB(_OpenGLID, name);
 
535
//     return loc;
 
536
// }
 
537
//
 
538
// //-----------------------------------------------------------------------------
 
539
// void IOpenGLShaderProgram::GetActiveUniformARB(
 
540
//     GLuint index,
 
541
//     GLsizei maxLength,
 
542
//     GLsizei *length,
 
543
//     GLint *size,
 
544
//     GLenum *type,
 
545
//     GLcharARB *name)
 
546
// {
 
547
//
 
548
//     glGetActiveUniformARB(_OpenGLID,
 
549
//         index,
 
550
//         maxLength,
 
551
//         length,
 
552
//         size,
 
553
//         type,
 
554
//         name);
 
555
//     CHECKGL_MSG(glGetActiveUniformARB);
 
556
// }
 
557
//
 
558
// //-----------------------------------------------------------------------------
 
559
//
 
560
// void IOpenGLShaderProgram::GetObjectParameterfvARB(GLenum pname,
 
561
//                                                    GLfloat *params)
 
562
// {
 
563
//     glGetObjectParameterfvARB(_OpenGLID,
 
564
//         pname,
 
565
//         params);
 
566
//     CHECKGL_MSG(glGetObjectParameterfvARB);
 
567
// }
 
568
//
 
569
// //-----------------------------------------------------------------------------
 
570
//
 
571
// BOOL IOpenGLShaderProgram::SetSampler(char* name, int texture_unit)
 
572
// {
 
573
//     GLint loc = GetUniformLocationARB(name);
 
574
//     if (loc==-1) return false;  // can't find variable
 
575
//
 
576
//     glUniform1iARB(loc, texture_unit);
 
577
//     return true;
 
578
// }
 
579
//
 
580
}