23
#include "NuxCore/NKernel.h"
24
#include "GLResource.h"
26
#include "GLDeviceObjects.h"
29
// //-----------------------------------------------------------------------------
30
// bool IOpenGLShaderProgram::SetUniform1f(char* varname, GLfloat v0)
32
// //if (!useGLSL) return false; // GLSL not available
33
// //if (!_noshader) return true;
35
// GLint loc = GetUniformLocationARB(varname);
36
// if (loc==-1) return false; // can't find variable
38
// glUniform1fARB(loc, v0);
42
// bool IOpenGLShaderProgram::SetUniform1f(GLint loc, GLfloat v0)
44
// //if (!useGLSL) return false; // GLSL not available
45
// //if (!_noshader) return true;
47
// if (loc==-1) return false; // can't find variable
48
// glUniform1fARB(loc, v0);
52
// //-----------------------------------------------------------------------------
54
// bool IOpenGLShaderProgram::SetUniform2f(char* varname, GLfloat v0, GLfloat v1)
56
// //if (!useGLSL) return false; // GLSL not available
57
// //if (!_noshader) return true;
59
// GLint loc = GetUniformLocationARB(varname);
60
// if (loc==-1) return false; // can't find variable
62
// glUniform2fARB(loc, v0, v1);
66
// bool IOpenGLShaderProgram::SetUniform2f(GLint loc, GLfloat v0, GLfloat v1)
68
// //if (!useGLSL) return false; // GLSL not available
69
// //if (!_noshader) return true;
71
// if (loc==-1) return false; // can't find variable
72
// glUniform2fARB(loc, v0, v1);
75
// //-----------------------------------------------------------------------------
77
// bool IOpenGLShaderProgram::SetUniform3f(char* varname, GLfloat v0, GLfloat v1, GLfloat v2)
79
// //if (!useGLSL) return false; // GLSL not available
80
// //if (!_noshader) return true;
82
// GLint loc = GetUniformLocationARB(varname);
83
// if (loc==-1) return false; // can't find variable
85
// glUniform3fARB(loc, v0, v1, v2);
89
// bool IOpenGLShaderProgram::SetUniform3f(GLint loc, GLfloat v0, GLfloat v1, GLfloat v2)
91
// //if (!useGLSL) return false; // GLSL not available
92
// //if (!_noshader) return true;
94
// if (loc==-1) return false; // can't find variable
96
// glUniform3fARB(loc, v0, v1, v2);
100
// //-----------------------------------------------------------------------------
102
// bool IOpenGLShaderProgram::SetUniform4f(char* varname, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
104
// //if (!useGLSL) return false; // GLSL not available
105
// //if (!_noshader) return true;
107
// GLint loc = GetUniformLocationARB(varname);
108
// if (loc==-1) return false; // can't find variable
110
// glUniform4fARB(loc, v0, v1, v2, v3);
114
// bool IOpenGLShaderProgram::SetUniform4f(GLint loc, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
116
// //if (!useGLSL) return false; // GLSL not available
117
// //if (!_noshader) return true;
119
// if (loc==-1) return false; // can't find variable
121
// glUniform4fARB(loc, v0, v1, v2, v3);
125
// //-----------------------------------------------------------------------------
127
// bool IOpenGLShaderProgram::SetUniform1i(char* varname, GLint v0)
129
// //if (!useGLSL) return false; // GLSL not available
130
// //if (!_noshader) return true;
132
// GLint loc = GetUniformLocationARB(varname);
133
// if (loc==-1) return false; // can't find variable
135
// glUniform1iARB(loc, v0);
139
// bool IOpenGLShaderProgram::SetUniform1i(GLint loc, GLint v0)
141
// //if (!useGLSL) return false; // GLSL not available
142
// //if (!_noshader) return true;
144
// if (loc==-1) return false; // can't find variable
146
// glUniform1iARB(loc, v0);
151
// bool IOpenGLShaderProgram::SetUniform2i(char* varname, GLint v0, GLint v1)
153
// // if (!useGLSL) return false; // GLSL not available
154
// // if (!_noshader) return true;
156
// GLint loc = GetUniformLocationARB(varname);
157
// if (loc==-1) return false; // can't find variable
159
// glUniform2iARB(loc, v0, v1);
164
// bool IOpenGLShaderProgram::SetUniform2i(GLint loc, GLint v0, GLint v1)
166
// // if (!useGLSL) return false; // GLSL not available
167
// // if (!_noshader) return true;
169
// if (loc==-1) return false; // can't find variable
171
// glUniform2iARB(loc, v0, v1);
176
// //-----------------------------------------------------------------------------
178
// bool IOpenGLShaderProgram::SetUniform3i(char* varname, GLint v0, GLint v1, GLint v2)
180
// // if (!useGLSL) return false; // GLSL not available
181
// // if (!_noshader) return true;
183
// GLint loc = GetUniformLocationARB(varname);
184
// if (loc==-1) return false; // can't find variable
186
// glUniform3iARB(loc, v0, v1, v2);
190
// bool IOpenGLShaderProgram::SetUniform3i(GLint loc, GLint v0, GLint v1, GLint v2)
192
// // if (!useGLSL) return false; // GLSL not available
193
// // if (!_noshader) return true;
195
// if (loc==-1) return false; // can't find variable
197
// glUniform3iARB(loc, v0, v1, v2);
202
// bool IOpenGLShaderProgram::SetUniform4i(char* varname, GLint v0, GLint v1, GLint v2, GLint v3)
204
// // if (!useGLSL) return false; // GLSL not available
205
// // if (!_noshader) return true;
207
// GLint loc = GetUniformLocationARB(varname);
208
// if (loc==-1) return false; // can't find variable
210
// glUniform4iARB(loc, v0, v1, v2, v3);
214
// bool IOpenGLShaderProgram::SetUniform4i(GLint loc, GLint v0, GLint v1, GLint v2, GLint v3)
216
// // if (!useGLSL) return false; // GLSL not available
217
// // if (!_noshader) return true;
219
// if (loc==-1) return false; // can't find variable
221
// glUniform4iARB(loc, v0, v1, v2, v3);
225
// //-----------------------------------------------------------------------------
227
// bool IOpenGLShaderProgram::SetUniform1fv(char* varname, GLsizei count, GLfloat *value)
229
// // if (!useGLSL) return false; // GLSL not available
230
// // if (!_noshader) return true;
232
// GLint loc = GetUniformLocationARB(varname);
233
// if (loc==-1) return false; // can't find variable
235
// glUniform1fvARB(loc, count, value);
239
// bool IOpenGLShaderProgram::SetUniform1fv(GLint loc, GLsizei count, GLfloat *value)
241
// // if (!useGLSL) return false; // GLSL not available
242
// // if (!_noshader) return true;
244
// if (loc==-1) return false; // can't find variable
246
// glUniform1fvARB(loc, count, value);
251
// bool IOpenGLShaderProgram::SetUniform2fv(char* varname, GLsizei count, GLfloat *value)
253
// // if (!useGLSL) return false; // GLSL not available
254
// // if (!_noshader) return true;
256
// GLint loc = GetUniformLocationARB(varname);
257
// if (loc==-1) return false; // can't find variable
259
// glUniform2fvARB(loc, count, value);
263
// bool IOpenGLShaderProgram::SetUniform2fv(GLint loc, GLsizei count, GLfloat *value)
265
// // if (!useGLSL) return false; // GLSL not available
266
// // if (!_noshader) return true;
268
// if (loc==-1) return false; // can't find variable
270
// glUniform2fvARB(loc, count, value);
274
// //-----------------------------------------------------------------------------
276
// bool IOpenGLShaderProgram::SetUniform3fv(char* varname, GLsizei count, GLfloat *value)
278
// // if (!useGLSL) return false; // GLSL not available
279
// // if (!_noshader) return true;
281
// GLint loc = GetUniformLocationARB(varname);
282
// if (loc==-1) return false; // can't find variable
284
// glUniform3fvARB(loc, count, value);
288
// bool IOpenGLShaderProgram::SetUniform3fv(GLint loc, GLsizei count, GLfloat *value)
290
// // if (!useGLSL) return false; // GLSL not available
291
// // if (!_noshader) return true;
293
// if (loc==-1) return false; // can't find variable
295
// glUniform3fvARB(loc, count, value);
299
// //-----------------------------------------------------------------------------
301
// bool IOpenGLShaderProgram::SetUniform4fv(char* varname, GLsizei count, GLfloat *value)
303
// // if (!useGLSL) return false; // GLSL not available
304
// // if (!_noshader) return true;
306
// GLint loc = GetUniformLocationARB(varname);
307
// if (loc==-1) return false; // can't find variable
309
// glUniform4fvARB(loc, count, value);
313
// bool IOpenGLShaderProgram::SetUniform4fv(GLint loc, GLsizei count, GLfloat *value)
315
// // if (!useGLSL) return false; // GLSL not available
316
// // if (!_noshader) return true;
318
// if (loc==-1) return false; // can't find variable
320
// glUniform4fvARB(loc, count, value);
324
// //-----------------------------------------------------------------------------
326
// bool IOpenGLShaderProgram::SetUniform1iv(char* varname, GLsizei count, GLint *value)
328
// // if (!useGLSL) return false; // GLSL not available
329
// // if (!_noshader) return true;
331
// GLint loc = GetUniformLocationARB(varname);
332
// if (loc==-1) return false; // can't find variable
334
// glUniform1ivARB(loc, count, value);
338
// bool IOpenGLShaderProgram::SetUniform1iv(GLint loc, GLsizei count, GLint *value)
340
// // if (!useGLSL) return false; // GLSL not available
341
// // if (!_noshader) return true;
343
// if (loc==-1) return false; // can't find variable
345
// glUniform1ivARB(loc, count, value);
349
// //-----------------------------------------------------------------------------
351
// bool IOpenGLShaderProgram::SetUniform2iv(char* varname, GLsizei count, GLint *value)
353
// // if (!useGLSL) return false; // GLSL not available
354
// // if (!_noshader) return true;
356
// GLint loc = GetUniformLocationARB(varname);
357
// if (loc==-1) return false; // can't find variable
359
// glUniform2ivARB(loc, count, value);
363
// bool IOpenGLShaderProgram::SetUniform2iv(GLint loc, GLsizei count, GLint *value)
365
// // if (!useGLSL) return false; // GLSL not available
366
// // if (!_noshader) return true;
368
// if (loc==-1) return false; // can't find variable
370
// glUniform2ivARB(loc, count, value);
374
// //-----------------------------------------------------------------------------
376
// bool IOpenGLShaderProgram::SetUniform3iv(char* varname, GLsizei count, GLint *value)
378
// // if (!useGLSL) return false; // GLSL not available
379
// // if (!_noshader) return true;
381
// GLint loc = GetUniformLocationARB(varname);
382
// if (loc==-1) return false; // can't find variable
384
// glUniform3ivARB(loc, count, value);
388
// bool IOpenGLShaderProgram::SetUniform3iv(GLint loc, GLsizei count, GLint *value)
390
// // if (!useGLSL) return false; // GLSL not available
391
// // if (!_noshader) return true;
393
// if (loc==-1) return false; // can't find variable
395
// glUniform3ivARB(loc, count, value);
399
// //-----------------------------------------------------------------------------
401
// bool IOpenGLShaderProgram::SetUniform4iv(char* varname, GLsizei count, GLint *value)
403
// // if (!useGLSL) return false; // GLSL not available
404
// // if (!_noshader) return true;
406
// GLint loc = GetUniformLocationARB(varname);
407
// if (loc==-1) return false; // can't find variable
409
// glUniform4ivARB(loc, count, value);
413
// bool IOpenGLShaderProgram::SetUniform4iv(GLint loc, GLsizei count, GLint *value)
415
// // if (!useGLSL) return false; // GLSL not available
416
// // if (!_noshader) return true;
418
// if (loc==-1) return false; // can't find variable
420
// glUniform4ivARB(loc, count, value);
424
// //-----------------------------------------------------------------------------
426
// bool IOpenGLShaderProgram::SetUniformMatrix2fv(char* varname, GLsizei count, GLboolean transpose, GLfloat *value)
428
// // if (!useGLSL) return false; // GLSL not available
429
// // if (!_noshader) return true;
431
// GLint loc = GetUniformLocationARB(varname);
432
// if (loc==-1) return false; // can't find variable
434
// glUniformMatrix2fvARB(loc, count, transpose, value);
438
// bool IOpenGLShaderProgram::SetUniformLocMatrix2fv(GLint loc, GLsizei count, GLboolean transpose, GLfloat *value)
440
// // if (!useGLSL) return false; // GLSL not available
441
// // if (!_noshader) return true;
443
// if (loc==-1) return false; // can't find variable
445
// glUniformMatrix2fvARB(loc, count, transpose, value);
449
// //-----------------------------------------------------------------------------
451
// bool IOpenGLShaderProgram::SetUniformMatrix3fv(char* varname, GLsizei count, GLboolean transpose, GLfloat *value)
453
// // if (!useGLSL) return false; // GLSL not available
454
// // if (!_noshader) return true;
456
// GLint loc = GetUniformLocationARB(varname);
457
// if (loc==-1) return false; // can't find variable
459
// glUniformMatrix3fvARB(loc, count, transpose, value);
463
// bool IOpenGLShaderProgram::SetUniformLocMatrix3fv(GLint loc, GLsizei count, GLboolean transpose, GLfloat *value)
465
// // if (!useGLSL) return false; // GLSL not available
466
// // if (!_noshader) return true;
468
// if (loc==-1) return false; // can't find variable
470
// glUniformMatrix3fvARB(loc, count, transpose, value);
474
// //-----------------------------------------------------------------------------
476
// bool IOpenGLShaderProgram::SetUniformMatrix4fv(char* varname, GLsizei count, GLboolean transpose, GLfloat *value)
478
// // if (!useGLSL) return false; // GLSL not available
479
// // if (!_noshader) return true;
481
// GLint loc = GetUniformLocationARB(varname);
482
// if (loc==-1) return false; // can't find variable
484
// glUniformMatrix4fvARB(loc, count, transpose, value);
488
// bool IOpenGLShaderProgram::SetUniformLocMatrix4fv(GLint loc, GLsizei count, GLboolean transpose, GLfloat *value)
490
// // if (!useGLSL) return false; // GLSL not available
491
// // if (!_noshader) return true;
493
// if (loc==-1) return false; // can't find variable
495
// glUniformMatrix4fvARB(loc, count, transpose, value);
500
// //-----------------------------------------------------------------------------
502
// void IOpenGLShaderProgram::GetUniformfv(char* name, GLfloat* values)
504
// // if (!useGLSL) return;
507
// loc = glGetUniformLocationARB(_OpenGLID, name);
510
// std::cout << "Error: can't find uniform variable \"" << name << "\"\n";
512
// glGetUniformfvARB(_OpenGLID, loc, values);
515
// //-----------------------------------------------------------------------------
517
// void IOpenGLShaderProgram::GetUniformiv(char* name, GLint* values)
519
// //if (!useGLSL) return;
521
// loc = glGetUniformLocationARB(_OpenGLID, name);
524
// std::cout << "Error: can't find uniform variable \"" << name << "\"\n";
526
// glGetUniformivARB(_OpenGLID, loc, values);
528
// //-----------------------------------------------------------------------------
530
// int IOpenGLShaderProgram::GetUniformLocationARB(const GLcharARB* name)
533
// loc = glGetUniformLocationARB(_OpenGLID, name);
537
// //-----------------------------------------------------------------------------
538
// void IOpenGLShaderProgram::GetActiveUniformARB(
540
// GLsizei maxLength,
547
// glGetActiveUniformARB(_OpenGLID,
554
// CHECKGL_MSG(glGetActiveUniformARB);
557
// //-----------------------------------------------------------------------------
559
// void IOpenGLShaderProgram::GetObjectParameterfvARB(GLenum pname,
562
// glGetObjectParameterfvARB(_OpenGLID,
565
// CHECKGL_MSG(glGetObjectParameterfvARB);
568
// //-----------------------------------------------------------------------------
570
// BOOL IOpenGLShaderProgram::SetSampler(char* name, int texture_unit)
572
// GLint loc = GetUniformLocationARB(name);
573
// if (loc==-1) return false; // can't find variable
575
// glUniform1iARB(loc, texture_unit);
23
#include "NuxCore/NKernel.h"
24
#include "GLResource.h"
26
#include "GLDeviceObjects.h"
29
// //-----------------------------------------------------------------------------
30
// bool IOpenGLShaderProgram::SetUniform1f(char* varname, GLfloat v0)
32
// //if (!useGLSL) return false; // GLSL not available
33
// //if (!_noshader) return true;
35
// GLint loc = GetUniformLocationARB(varname);
36
// if (loc==-1) return false; // can't find variable
38
// glUniform1fARB(loc, v0);
42
// bool IOpenGLShaderProgram::SetUniform1f(GLint loc, GLfloat v0)
44
// //if (!useGLSL) return false; // GLSL not available
45
// //if (!_noshader) return true;
47
// if (loc==-1) return false; // can't find variable
48
// glUniform1fARB(loc, v0);
52
// //-----------------------------------------------------------------------------
54
// bool IOpenGLShaderProgram::SetUniform2f(char* varname, GLfloat v0, GLfloat v1)
56
// //if (!useGLSL) return false; // GLSL not available
57
// //if (!_noshader) return true;
59
// GLint loc = GetUniformLocationARB(varname);
60
// if (loc==-1) return false; // can't find variable
62
// glUniform2fARB(loc, v0, v1);
66
// bool IOpenGLShaderProgram::SetUniform2f(GLint loc, GLfloat v0, GLfloat v1)
68
// //if (!useGLSL) return false; // GLSL not available
69
// //if (!_noshader) return true;
71
// if (loc==-1) return false; // can't find variable
72
// glUniform2fARB(loc, v0, v1);
75
// //-----------------------------------------------------------------------------
77
// bool IOpenGLShaderProgram::SetUniform3f(char* varname, GLfloat v0, GLfloat v1, GLfloat v2)
79
// //if (!useGLSL) return false; // GLSL not available
80
// //if (!_noshader) return true;
82
// GLint loc = GetUniformLocationARB(varname);
83
// if (loc==-1) return false; // can't find variable
85
// glUniform3fARB(loc, v0, v1, v2);
89
// bool IOpenGLShaderProgram::SetUniform3f(GLint loc, GLfloat v0, GLfloat v1, GLfloat v2)
91
// //if (!useGLSL) return false; // GLSL not available
92
// //if (!_noshader) return true;
94
// if (loc==-1) return false; // can't find variable
96
// glUniform3fARB(loc, v0, v1, v2);
100
// //-----------------------------------------------------------------------------
102
// bool IOpenGLShaderProgram::SetUniform4f(char* varname, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
104
// //if (!useGLSL) return false; // GLSL not available
105
// //if (!_noshader) return true;
107
// GLint loc = GetUniformLocationARB(varname);
108
// if (loc==-1) return false; // can't find variable
110
// glUniform4fARB(loc, v0, v1, v2, v3);
114
// bool IOpenGLShaderProgram::SetUniform4f(GLint loc, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
116
// //if (!useGLSL) return false; // GLSL not available
117
// //if (!_noshader) return true;
119
// if (loc==-1) return false; // can't find variable
121
// glUniform4fARB(loc, v0, v1, v2, v3);
125
// //-----------------------------------------------------------------------------
127
// bool IOpenGLShaderProgram::SetUniform1i(char* varname, GLint v0)
129
// //if (!useGLSL) return false; // GLSL not available
130
// //if (!_noshader) return true;
132
// GLint loc = GetUniformLocationARB(varname);
133
// if (loc==-1) return false; // can't find variable
135
// glUniform1iARB(loc, v0);
139
// bool IOpenGLShaderProgram::SetUniform1i(GLint loc, GLint v0)
141
// //if (!useGLSL) return false; // GLSL not available
142
// //if (!_noshader) return true;
144
// if (loc==-1) return false; // can't find variable
146
// glUniform1iARB(loc, v0);
151
// bool IOpenGLShaderProgram::SetUniform2i(char* varname, GLint v0, GLint v1)
153
// // if (!useGLSL) return false; // GLSL not available
154
// // if (!_noshader) return true;
156
// GLint loc = GetUniformLocationARB(varname);
157
// if (loc==-1) return false; // can't find variable
159
// glUniform2iARB(loc, v0, v1);
164
// bool IOpenGLShaderProgram::SetUniform2i(GLint loc, GLint v0, GLint v1)
166
// // if (!useGLSL) return false; // GLSL not available
167
// // if (!_noshader) return true;
169
// if (loc==-1) return false; // can't find variable
171
// glUniform2iARB(loc, v0, v1);
176
// //-----------------------------------------------------------------------------
178
// bool IOpenGLShaderProgram::SetUniform3i(char* varname, GLint v0, GLint v1, GLint v2)
180
// // if (!useGLSL) return false; // GLSL not available
181
// // if (!_noshader) return true;
183
// GLint loc = GetUniformLocationARB(varname);
184
// if (loc==-1) return false; // can't find variable
186
// glUniform3iARB(loc, v0, v1, v2);
190
// bool IOpenGLShaderProgram::SetUniform3i(GLint loc, GLint v0, GLint v1, GLint v2)
192
// // if (!useGLSL) return false; // GLSL not available
193
// // if (!_noshader) return true;
195
// if (loc==-1) return false; // can't find variable
197
// glUniform3iARB(loc, v0, v1, v2);
202
// bool IOpenGLShaderProgram::SetUniform4i(char* varname, GLint v0, GLint v1, GLint v2, GLint v3)
204
// // if (!useGLSL) return false; // GLSL not available
205
// // if (!_noshader) return true;
207
// GLint loc = GetUniformLocationARB(varname);
208
// if (loc==-1) return false; // can't find variable
210
// glUniform4iARB(loc, v0, v1, v2, v3);
214
// bool IOpenGLShaderProgram::SetUniform4i(GLint loc, GLint v0, GLint v1, GLint v2, GLint v3)
216
// // if (!useGLSL) return false; // GLSL not available
217
// // if (!_noshader) return true;
219
// if (loc==-1) return false; // can't find variable
221
// glUniform4iARB(loc, v0, v1, v2, v3);
225
// //-----------------------------------------------------------------------------
227
// bool IOpenGLShaderProgram::SetUniform1fv(char* varname, GLsizei count, GLfloat *value)
229
// // if (!useGLSL) return false; // GLSL not available
230
// // if (!_noshader) return true;
232
// GLint loc = GetUniformLocationARB(varname);
233
// if (loc==-1) return false; // can't find variable
235
// glUniform1fvARB(loc, count, value);
239
// bool IOpenGLShaderProgram::SetUniform1fv(GLint loc, GLsizei count, GLfloat *value)
241
// // if (!useGLSL) return false; // GLSL not available
242
// // if (!_noshader) return true;
244
// if (loc==-1) return false; // can't find variable
246
// glUniform1fvARB(loc, count, value);
251
// bool IOpenGLShaderProgram::SetUniform2fv(char* varname, GLsizei count, GLfloat *value)
253
// // if (!useGLSL) return false; // GLSL not available
254
// // if (!_noshader) return true;
256
// GLint loc = GetUniformLocationARB(varname);
257
// if (loc==-1) return false; // can't find variable
259
// glUniform2fvARB(loc, count, value);
263
// bool IOpenGLShaderProgram::SetUniform2fv(GLint loc, GLsizei count, GLfloat *value)
265
// // if (!useGLSL) return false; // GLSL not available
266
// // if (!_noshader) return true;
268
// if (loc==-1) return false; // can't find variable
270
// glUniform2fvARB(loc, count, value);
274
// //-----------------------------------------------------------------------------
276
// bool IOpenGLShaderProgram::SetUniform3fv(char* varname, GLsizei count, GLfloat *value)
278
// // if (!useGLSL) return false; // GLSL not available
279
// // if (!_noshader) return true;
281
// GLint loc = GetUniformLocationARB(varname);
282
// if (loc==-1) return false; // can't find variable
284
// glUniform3fvARB(loc, count, value);
288
// bool IOpenGLShaderProgram::SetUniform3fv(GLint loc, GLsizei count, GLfloat *value)
290
// // if (!useGLSL) return false; // GLSL not available
291
// // if (!_noshader) return true;
293
// if (loc==-1) return false; // can't find variable
295
// glUniform3fvARB(loc, count, value);
299
// //-----------------------------------------------------------------------------
301
// bool IOpenGLShaderProgram::SetUniform4fv(char* varname, GLsizei count, GLfloat *value)
303
// // if (!useGLSL) return false; // GLSL not available
304
// // if (!_noshader) return true;
306
// GLint loc = GetUniformLocationARB(varname);
307
// if (loc==-1) return false; // can't find variable
309
// glUniform4fvARB(loc, count, value);
313
// bool IOpenGLShaderProgram::SetUniform4fv(GLint loc, GLsizei count, GLfloat *value)
315
// // if (!useGLSL) return false; // GLSL not available
316
// // if (!_noshader) return true;
318
// if (loc==-1) return false; // can't find variable
320
// glUniform4fvARB(loc, count, value);
324
// //-----------------------------------------------------------------------------
326
// bool IOpenGLShaderProgram::SetUniform1iv(char* varname, GLsizei count, GLint *value)
328
// // if (!useGLSL) return false; // GLSL not available
329
// // if (!_noshader) return true;
331
// GLint loc = GetUniformLocationARB(varname);
332
// if (loc==-1) return false; // can't find variable
334
// glUniform1ivARB(loc, count, value);
338
// bool IOpenGLShaderProgram::SetUniform1iv(GLint loc, GLsizei count, GLint *value)
340
// // if (!useGLSL) return false; // GLSL not available
341
// // if (!_noshader) return true;
343
// if (loc==-1) return false; // can't find variable
345
// glUniform1ivARB(loc, count, value);
349
// //-----------------------------------------------------------------------------
351
// bool IOpenGLShaderProgram::SetUniform2iv(char* varname, GLsizei count, GLint *value)
353
// // if (!useGLSL) return false; // GLSL not available
354
// // if (!_noshader) return true;
356
// GLint loc = GetUniformLocationARB(varname);
357
// if (loc==-1) return false; // can't find variable
359
// glUniform2ivARB(loc, count, value);
363
// bool IOpenGLShaderProgram::SetUniform2iv(GLint loc, GLsizei count, GLint *value)
365
// // if (!useGLSL) return false; // GLSL not available
366
// // if (!_noshader) return true;
368
// if (loc==-1) return false; // can't find variable
370
// glUniform2ivARB(loc, count, value);
374
// //-----------------------------------------------------------------------------
376
// bool IOpenGLShaderProgram::SetUniform3iv(char* varname, GLsizei count, GLint *value)
378
// // if (!useGLSL) return false; // GLSL not available
379
// // if (!_noshader) return true;
381
// GLint loc = GetUniformLocationARB(varname);
382
// if (loc==-1) return false; // can't find variable
384
// glUniform3ivARB(loc, count, value);
388
// bool IOpenGLShaderProgram::SetUniform3iv(GLint loc, GLsizei count, GLint *value)
390
// // if (!useGLSL) return false; // GLSL not available
391
// // if (!_noshader) return true;
393
// if (loc==-1) return false; // can't find variable
395
// glUniform3ivARB(loc, count, value);
399
// //-----------------------------------------------------------------------------
401
// bool IOpenGLShaderProgram::SetUniform4iv(char* varname, GLsizei count, GLint *value)
403
// // if (!useGLSL) return false; // GLSL not available
404
// // if (!_noshader) return true;
406
// GLint loc = GetUniformLocationARB(varname);
407
// if (loc==-1) return false; // can't find variable
409
// glUniform4ivARB(loc, count, value);
413
// bool IOpenGLShaderProgram::SetUniform4iv(GLint loc, GLsizei count, GLint *value)
415
// // if (!useGLSL) return false; // GLSL not available
416
// // if (!_noshader) return true;
418
// if (loc==-1) return false; // can't find variable
420
// glUniform4ivARB(loc, count, value);
424
// //-----------------------------------------------------------------------------
426
// bool IOpenGLShaderProgram::SetUniformMatrix2fv(char* varname, GLsizei count, GLboolean transpose, GLfloat *value)
428
// // if (!useGLSL) return false; // GLSL not available
429
// // if (!_noshader) return true;
431
// GLint loc = GetUniformLocationARB(varname);
432
// if (loc==-1) return false; // can't find variable
434
// glUniformMatrix2fvARB(loc, count, transpose, value);
438
// bool IOpenGLShaderProgram::SetUniformLocMatrix2fv(GLint loc, GLsizei count, GLboolean transpose, GLfloat *value)
440
// // if (!useGLSL) return false; // GLSL not available
441
// // if (!_noshader) return true;
443
// if (loc==-1) return false; // can't find variable
445
// glUniformMatrix2fvARB(loc, count, transpose, value);
449
// //-----------------------------------------------------------------------------
451
// bool IOpenGLShaderProgram::SetUniformMatrix3fv(char* varname, GLsizei count, GLboolean transpose, GLfloat *value)
453
// // if (!useGLSL) return false; // GLSL not available
454
// // if (!_noshader) return true;
456
// GLint loc = GetUniformLocationARB(varname);
457
// if (loc==-1) return false; // can't find variable
459
// glUniformMatrix3fvARB(loc, count, transpose, value);
463
// bool IOpenGLShaderProgram::SetUniformLocMatrix3fv(GLint loc, GLsizei count, GLboolean transpose, GLfloat *value)
465
// // if (!useGLSL) return false; // GLSL not available
466
// // if (!_noshader) return true;
468
// if (loc==-1) return false; // can't find variable
470
// glUniformMatrix3fvARB(loc, count, transpose, value);
474
// //-----------------------------------------------------------------------------
476
// bool IOpenGLShaderProgram::SetUniformMatrix4fv(char* varname, GLsizei count, GLboolean transpose, GLfloat *value)
478
// // if (!useGLSL) return false; // GLSL not available
479
// // if (!_noshader) return true;
481
// GLint loc = GetUniformLocationARB(varname);
482
// if (loc==-1) return false; // can't find variable
484
// glUniformMatrix4fvARB(loc, count, transpose, value);
488
// bool IOpenGLShaderProgram::SetUniformLocMatrix4fv(GLint loc, GLsizei count, GLboolean transpose, GLfloat *value)
490
// // if (!useGLSL) return false; // GLSL not available
491
// // if (!_noshader) return true;
493
// if (loc==-1) return false; // can't find variable
495
// glUniformMatrix4fvARB(loc, count, transpose, value);
500
// //-----------------------------------------------------------------------------
502
// void IOpenGLShaderProgram::GetUniformfv(char* name, GLfloat* values)
504
// // if (!useGLSL) return;
507
// loc = glGetUniformLocationARB(_OpenGLID, name);
510
// std::cout << "Error: can't find uniform variable \"" << name << "\"\n";
512
// glGetUniformfvARB(_OpenGLID, loc, values);
515
// //-----------------------------------------------------------------------------
517
// void IOpenGLShaderProgram::GetUniformiv(char* name, GLint* values)
519
// //if (!useGLSL) return;
521
// loc = glGetUniformLocationARB(_OpenGLID, name);
524
// std::cout << "Error: can't find uniform variable \"" << name << "\"\n";
526
// glGetUniformivARB(_OpenGLID, loc, values);
528
// //-----------------------------------------------------------------------------
530
// int IOpenGLShaderProgram::GetUniformLocationARB(const GLcharARB* name)
533
// loc = glGetUniformLocationARB(_OpenGLID, name);
537
// //-----------------------------------------------------------------------------
538
// void IOpenGLShaderProgram::GetActiveUniformARB(
540
// GLsizei maxLength,
547
// glGetActiveUniformARB(_OpenGLID,
554
// CHECKGL_MSG(glGetActiveUniformARB);
557
// //-----------------------------------------------------------------------------
559
// void IOpenGLShaderProgram::GetObjectParameterfvARB(GLenum pname,
562
// glGetObjectParameterfvARB(_OpenGLID,
565
// CHECKGL_MSG(glGetObjectParameterfvARB);
568
// //-----------------------------------------------------------------------------
570
// BOOL IOpenGLShaderProgram::SetSampler(char* name, int texture_unit)
572
// GLint loc = GetUniformLocationARB(name);
573
// if (loc==-1) return false; // can't find variable
575
// glUniform1iARB(loc, texture_unit);