opengl 0.9.2-x86-mingw32 → 0.10.0.pre1-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +8 -0
  3. data/Manifest.txt +5 -1
  4. data/README.rdoc +25 -28
  5. data/Rakefile +56 -28
  6. data/examples/RedBook/font.rb +2 -2
  7. data/examples/RedBook/light.rb +2 -0
  8. data/examples/RedBook/stroke.rb +6 -6
  9. data/ext/opengl/GL/gl.h +2115 -0
  10. data/ext/opengl/GL/glext.h +11770 -0
  11. data/ext/opengl/common.h +116 -172
  12. data/ext/opengl/conv.h +2 -2
  13. data/ext/opengl/extconf.rb +3 -31
  14. data/ext/opengl/fptr_struct.h +912 -0
  15. data/ext/opengl/funcdef.h +29 -63
  16. data/ext/opengl/gl-1.0-1.1.c +918 -648
  17. data/ext/opengl/gl-1.2.c +13 -13
  18. data/ext/opengl/gl-1.3.c +68 -64
  19. data/ext/opengl/gl-1.4.c +64 -66
  20. data/ext/opengl/gl-1.5.c +32 -31
  21. data/ext/opengl/gl-2.0.c +126 -128
  22. data/ext/opengl/gl-2.1.c +8 -8
  23. data/ext/opengl/gl-3.0.c +102 -93
  24. data/ext/opengl/gl-enums.c +9 -29
  25. data/ext/opengl/gl-enums.h +31 -91
  26. data/ext/opengl/gl-error.c +15 -17
  27. data/ext/opengl/gl-error.h +4 -7
  28. data/ext/opengl/gl-ext-3dfx.c +2 -2
  29. data/ext/opengl/gl-ext-arb.c +176 -171
  30. data/ext/opengl/gl-ext-ati.c +4 -4
  31. data/ext/opengl/gl-ext-ext.c +151 -155
  32. data/ext/opengl/gl-ext-gremedy.c +4 -4
  33. data/ext/opengl/gl-ext-nv.c +141 -142
  34. data/ext/opengl/gl.c +121 -76
  35. data/ext/opengl/gl_buffer.c +44 -19
  36. data/ext/opengl/glimpl.c +187 -0
  37. data/ext/opengl/glimpl.h +47 -0
  38. data/ext/opengl/opengl.c +5 -3
  39. data/lib/opengl.rb +24 -4
  40. data/lib/opengl/1.9/opengl.so +0 -0
  41. data/lib/opengl/2.0/opengl.so +0 -0
  42. data/lib/opengl/2.1/opengl.so +0 -0
  43. data/lib/opengl/2.2/opengl.so +0 -0
  44. data/lib/opengl/2.3/opengl.so +0 -0
  45. data/lib/opengl/bindings_version.rb +4 -0
  46. data/lib/opengl/implementation.rb +38 -0
  47. data/opengl.gemspec +33 -0
  48. data/test/test_gl.rb +7 -0
  49. data/test/test_gl_21.rb +21 -21
  50. data/test/test_gl_ext_arb.rb +1 -1
  51. data/test/test_glimpl.rb +23 -0
  52. data/test/test_opengl_buffer.rb +2 -0
  53. data/utils/enumgen.rb +2 -2
  54. metadata +69 -60
  55. checksums.yaml.gz.sig +0 -2
  56. data.tar.gz.sig +0 -0
  57. data/ext/opengl/gl-types.h +0 -67
  58. metadata.gz.sig +0 -0
@@ -1,6 +1,6 @@
1
- /* This file was genereated on 2013-02-27 15:05:34 +0100
2
- source: http://www.opengl.org/registry/api/enum.spec
3
- source: http://www.opengl.org/registry/api/enumext.spec
1
+ /* This file was genereated on 2015-01-17 21:05:45 +0100
2
+ source: https://www.opengl.org/registry/oldspecs/enum.spec
3
+ source: https://www.opengl.org/registry/oldspecs/enumext.spec
4
4
  */
5
5
 
6
6
  #ifndef GL_1PASS_EXT
@@ -252,6 +252,9 @@
252
252
  #ifndef GL_ALL_SHADER_BITS_EXT
253
253
  #define GL_ALL_SHADER_BITS_EXT 0xFFFFFFFF
254
254
  #endif
255
+ #ifndef GL_ALL_STATIC_DATA_IBM
256
+ #define GL_ALL_STATIC_DATA_IBM 103060
257
+ #endif
255
258
  #ifndef GL_ALPHA
256
259
  #define GL_ALPHA 0x1906
257
260
  #endif
@@ -1930,7 +1933,7 @@
1930
1933
  #define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002
1931
1934
  #endif
1932
1935
  #ifndef GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT
1933
- #define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001
1936
+ #define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x00000001
1934
1937
  #endif
1935
1938
  #ifndef GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB
1936
1939
  #define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004
@@ -2116,13 +2119,13 @@
2116
2119
  #define GL_COPY_PIXEL_TOKEN 0x0706
2117
2120
  #endif
2118
2121
  #ifndef GL_COPY_READ_BUFFER
2119
- #define GL_COPY_READ_BUFFER GL_COPY_READ_BUFFER_BINDING
2122
+ #define GL_COPY_READ_BUFFER 0x8F36
2120
2123
  #endif
2121
2124
  #ifndef GL_COPY_READ_BUFFER_BINDING
2122
2125
  #define GL_COPY_READ_BUFFER_BINDING 0x8F36
2123
2126
  #endif
2124
2127
  #ifndef GL_COPY_WRITE_BUFFER
2125
- #define GL_COPY_WRITE_BUFFER GL_COPY_WRITE_BUFFER_BINDING
2128
+ #define GL_COPY_WRITE_BUFFER 0x8F37
2126
2129
  #endif
2127
2130
  #ifndef GL_COPY_WRITE_BUFFER_BINDING
2128
2131
  #define GL_COPY_WRITE_BUFFER_BINDING 0x8F37
@@ -2164,7 +2167,7 @@
2164
2167
  #define GL_COVERAGE_EDGE_FRAGMENTS_NV 0x8ED6
2165
2168
  #endif
2166
2169
  #ifndef GL_COVERAGE_SAMPLES_NV
2167
- #define GL_COVERAGE_SAMPLES_NV 0x80A9
2170
+ #define GL_COVERAGE_SAMPLES_NV 0x8ED4
2168
2171
  #endif
2169
2172
  #ifndef GL_CPU_OPTIMIZED_QCOM
2170
2173
  #define GL_CPU_OPTIMIZED_QCOM 0x8FB1
@@ -3124,10 +3127,10 @@
3124
3127
  #define GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9
3125
3128
  #endif
3126
3129
  #ifndef GL_DRAW_FRAMEBUFFER_BINDING
3127
- #define GL_DRAW_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING
3130
+ #define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6
3128
3131
  #endif
3129
3132
  #ifndef GL_DRAW_FRAMEBUFFER_BINDING_EXT
3130
- #define GL_DRAW_FRAMEBUFFER_BINDING_EXT GL_FRAMEBUFFER_BINDING_EXT
3133
+ #define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6
3131
3134
  #endif
3132
3135
  #ifndef GL_DRAW_FRAMEBUFFER_BINDING_NV
3133
3136
  #define GL_DRAW_FRAMEBUFFER_BINDING_NV 0x8CA6
@@ -3408,54 +3411,6 @@
3408
3411
  #ifndef GL_EVAL_TRIANGULAR_2D_NV
3409
3412
  #define GL_EVAL_TRIANGULAR_2D_NV 0x86C1
3410
3413
  #endif
3411
- #ifndef GL_EVAL_VERTEX_ATRRIB0_NV
3412
- #define GL_EVAL_VERTEX_ATRRIB0_NV 0x86C6
3413
- #endif
3414
- #ifndef GL_EVAL_VERTEX_ATRRIB10_NV
3415
- #define GL_EVAL_VERTEX_ATRRIB10_NV 0x86D0
3416
- #endif
3417
- #ifndef GL_EVAL_VERTEX_ATRRIB11_NV
3418
- #define GL_EVAL_VERTEX_ATRRIB11_NV 0x86D1
3419
- #endif
3420
- #ifndef GL_EVAL_VERTEX_ATRRIB12_NV
3421
- #define GL_EVAL_VERTEX_ATRRIB12_NV 0x86D2
3422
- #endif
3423
- #ifndef GL_EVAL_VERTEX_ATRRIB13_NV
3424
- #define GL_EVAL_VERTEX_ATRRIB13_NV 0x86D3
3425
- #endif
3426
- #ifndef GL_EVAL_VERTEX_ATRRIB14_NV
3427
- #define GL_EVAL_VERTEX_ATRRIB14_NV 0x86D4
3428
- #endif
3429
- #ifndef GL_EVAL_VERTEX_ATRRIB15_NV
3430
- #define GL_EVAL_VERTEX_ATRRIB15_NV 0x86D5
3431
- #endif
3432
- #ifndef GL_EVAL_VERTEX_ATRRIB1_NV
3433
- #define GL_EVAL_VERTEX_ATRRIB1_NV 0x86C7
3434
- #endif
3435
- #ifndef GL_EVAL_VERTEX_ATRRIB2_NV
3436
- #define GL_EVAL_VERTEX_ATRRIB2_NV 0x86C8
3437
- #endif
3438
- #ifndef GL_EVAL_VERTEX_ATRRIB3_NV
3439
- #define GL_EVAL_VERTEX_ATRRIB3_NV 0x86C9
3440
- #endif
3441
- #ifndef GL_EVAL_VERTEX_ATRRIB4_NV
3442
- #define GL_EVAL_VERTEX_ATRRIB4_NV 0x86CA
3443
- #endif
3444
- #ifndef GL_EVAL_VERTEX_ATRRIB5_NV
3445
- #define GL_EVAL_VERTEX_ATRRIB5_NV 0x86CB
3446
- #endif
3447
- #ifndef GL_EVAL_VERTEX_ATRRIB6_NV
3448
- #define GL_EVAL_VERTEX_ATRRIB6_NV 0x86CC
3449
- #endif
3450
- #ifndef GL_EVAL_VERTEX_ATRRIB7_NV
3451
- #define GL_EVAL_VERTEX_ATRRIB7_NV 0x86CD
3452
- #endif
3453
- #ifndef GL_EVAL_VERTEX_ATRRIB8_NV
3454
- #define GL_EVAL_VERTEX_ATRRIB8_NV 0x86CE
3455
- #endif
3456
- #ifndef GL_EVAL_VERTEX_ATRRIB9_NV
3457
- #define GL_EVAL_VERTEX_ATRRIB9_NV 0x86CF
3458
- #endif
3459
3414
  #ifndef GL_EVAL_VERTEX_ATTRIB0_NV
3460
3415
  #define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6
3461
3416
  #endif
@@ -3897,18 +3852,12 @@
3897
3852
  #ifndef GL_FOG_END
3898
3853
  #define GL_FOG_END 0x0B64
3899
3854
  #endif
3900
- #ifndef GL_FOG_FACTOR_TO_ALPHA_SGIX
3901
- #define GL_FOG_FACTOR_TO_ALPHA_SGIX 0x836F
3902
- #endif
3903
3855
  #ifndef GL_FOG_FUNC_POINTS_SGIS
3904
3856
  #define GL_FOG_FUNC_POINTS_SGIS 0x812B
3905
3857
  #endif
3906
3858
  #ifndef GL_FOG_FUNC_SGIS
3907
3859
  #define GL_FOG_FUNC_SGIS 0x812A
3908
3860
  #endif
3909
- #ifndef GL_FOG_GEN_MODE_NV
3910
- #define GL_FOG_GEN_MODE_NV 0x855A
3911
- #endif
3912
3861
  #ifndef GL_FOG_HINT
3913
3862
  #define GL_FOG_HINT 0x0C54
3914
3863
  #endif
@@ -3924,12 +3873,6 @@
3924
3873
  #ifndef GL_FOG_OFFSET_VALUE_SGIX
3925
3874
  #define GL_FOG_OFFSET_VALUE_SGIX 0x8199
3926
3875
  #endif
3927
- #ifndef GL_FOG_SCALE_SGIX
3928
- #define GL_FOG_SCALE_SGIX 0x81FC
3929
- #endif
3930
- #ifndef GL_FOG_SCALE_VALUE_SGIX
3931
- #define GL_FOG_SCALE_VALUE_SGIX 0x81FD
3932
- #endif
3933
3876
  #ifndef GL_FOG_SPECULAR_TEXTURE_WIN
3934
3877
  #define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC
3935
3878
  #endif
@@ -5886,6 +5829,9 @@
5886
5829
  #ifndef GL_MAJOR_VERSION
5887
5830
  #define GL_MAJOR_VERSION 0x821B
5888
5831
  #endif
5832
+ #ifndef GL_MALI_PROGRAM_BINARY_ARM
5833
+ #define GL_MALI_PROGRAM_BINARY_ARM 0x8F61
5834
+ #endif
5889
5835
  #ifndef GL_MALI_SHADER_BINARY_ARM
5890
5836
  #define GL_MALI_SHADER_BINARY_ARM 0x8F60
5891
5837
  #endif
@@ -6418,7 +6364,7 @@
6418
6364
  #define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39
6419
6365
  #endif
6420
6366
  #ifndef GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES
6421
- #define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS
6367
+ #define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39
6422
6368
  #endif
6423
6369
  #ifndef GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS
6424
6370
  #define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC
@@ -6900,9 +6846,6 @@
6900
6846
  #ifndef GL_MAX_PROGRAM_TEXEL_OFFSET_NV
6901
6847
  #define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905
6902
6848
  #endif
6903
- #ifndef GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS
6904
- #define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS 0x8F9F
6905
- #endif
6906
6849
  #ifndef GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB
6907
6850
  #define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F
6908
6851
  #endif
@@ -7384,13 +7327,13 @@
7384
7327
  #define GL_MODELVIEW0_ARB 0x1700
7385
7328
  #endif
7386
7329
  #ifndef GL_MODELVIEW0_EXT
7387
- #define GL_MODELVIEW0_EXT GL_MODELVIEW
7330
+ #define GL_MODELVIEW0_EXT 0x1700
7388
7331
  #endif
7389
7332
  #ifndef GL_MODELVIEW0_MATRIX_EXT
7390
- #define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX
7333
+ #define GL_MODELVIEW0_MATRIX_EXT 0x0BA6
7391
7334
  #endif
7392
7335
  #ifndef GL_MODELVIEW0_STACK_DEPTH_EXT
7393
- #define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH
7336
+ #define GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3
7394
7337
  #endif
7395
7338
  #ifndef GL_MODELVIEW10_ARB
7396
7339
  #define GL_MODELVIEW10_ARB 0x872A
@@ -7497,9 +7440,6 @@
7497
7440
  #ifndef GL_MODELVIEW_MATRIX
7498
7441
  #define GL_MODELVIEW_MATRIX 0x0BA6
7499
7442
  #endif
7500
- #ifndef GL_MODELVIEW_MATRIX1_EXT
7501
- #define GL_MODELVIEW_MATRIX1_EXT 0x8506
7502
- #endif
7503
7443
  #ifndef GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES
7504
7444
  #define GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES 0x898D
7505
7445
  #endif
@@ -7906,16 +7846,16 @@
7906
7846
  #define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853
7907
7847
  #endif
7908
7848
  #ifndef GL_OFFSET_TEXTURE_2D_BIAS_NV
7909
- #define GL_OFFSET_TEXTURE_2D_BIAS_NV GL_OFFSET_TEXTURE_BIAS_NV
7849
+ #define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3
7910
7850
  #endif
7911
7851
  #ifndef GL_OFFSET_TEXTURE_2D_MATRIX_NV
7912
- #define GL_OFFSET_TEXTURE_2D_MATRIX_NV GL_OFFSET_TEXTURE_MATRIX_NV
7852
+ #define GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1
7913
7853
  #endif
7914
7854
  #ifndef GL_OFFSET_TEXTURE_2D_NV
7915
7855
  #define GL_OFFSET_TEXTURE_2D_NV 0x86E8
7916
7856
  #endif
7917
7857
  #ifndef GL_OFFSET_TEXTURE_2D_SCALE_NV
7918
- #define GL_OFFSET_TEXTURE_2D_SCALE_NV GL_OFFSET_TEXTURE_SCALE_NV
7858
+ #define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2
7919
7859
  #endif
7920
7860
  #ifndef GL_OFFSET_TEXTURE_BIAS_NV
7921
7861
  #define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3
@@ -10335,6 +10275,9 @@
10335
10275
  #ifndef GL_RGBA8_EXT
10336
10276
  #define GL_RGBA8_EXT 0x8058
10337
10277
  #endif
10278
+ #ifndef GL_RGBA8_OES
10279
+ #define GL_RGBA8_OES 0x8058
10280
+ #endif
10338
10281
  #ifndef GL_RGBA8_SNORM
10339
10282
  #define GL_RGBA8_SNORM 0x8F97
10340
10283
  #endif
@@ -11038,7 +10981,7 @@
11038
10981
  #define GL_SHADER_SOURCE_LENGTH 0x8B88
11039
10982
  #endif
11040
10983
  #ifndef GL_SHADER_STORAGE_BARRIER_BIT
11041
- #define GL_SHADER_STORAGE_BARRIER_BIT 0x2000
10984
+ #define GL_SHADER_STORAGE_BARRIER_BIT 0x00002000
11042
10985
  #endif
11043
10986
  #ifndef GL_SHADER_STORAGE_BLOCK
11044
10987
  #define GL_SHADER_STORAGE_BLOCK 0x92E6
@@ -11472,6 +11415,9 @@
11472
11415
  #ifndef GL_STATIC_READ_ARB
11473
11416
  #define GL_STATIC_READ_ARB 0x88E5
11474
11417
  #endif
11418
+ #ifndef GL_STATIC_VERTEX_ARRAY_IBM
11419
+ #define GL_STATIC_VERTEX_ARRAY_IBM 103061
11420
+ #endif
11475
11421
  #ifndef GL_STENCIL
11476
11422
  #define GL_STENCIL 0x1802
11477
11423
  #endif
@@ -13066,7 +13012,7 @@
13066
13012
  #define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E
13067
13013
  #endif
13068
13014
  #ifndef GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE
13069
- #define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE GL_TRANSFORM_FEEDBACK_ACTIVE
13015
+ #define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24
13070
13016
  #endif
13071
13017
  #ifndef GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV
13072
13018
  #define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24
@@ -13096,7 +13042,7 @@
13096
13042
  #define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E
13097
13043
  #endif
13098
13044
  #ifndef GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED
13099
- #define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED GL_TRANSFORM_FEEDBACK_PAUSED
13045
+ #define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23
13100
13046
  #endif
13101
13047
  #ifndef GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV
13102
13048
  #define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23
@@ -13251,9 +13197,6 @@
13251
13197
  #ifndef GL_TYPE
13252
13198
  #define GL_TYPE 0x92FA
13253
13199
  #endif
13254
- #ifndef GL_TYPE_RGBA_FLOAT_ATI
13255
- #define GL_TYPE_RGBA_FLOAT_ATI 0x8820
13256
- #endif
13257
13200
  #ifndef GL_UNDEFINED_APPLE
13258
13201
  #define GL_UNDEFINED_APPLE 0x8A1C
13259
13202
  #endif
@@ -13713,9 +13656,6 @@
13713
13656
  #ifndef GL_UNSIGNED_INVERT_NV
13714
13657
  #define GL_UNSIGNED_INVERT_NV 0x8537
13715
13658
  #endif
13716
- #ifndef GL_UNSIGNED_NEGATE_NV
13717
- #define GL_UNSIGNED_NEGATE_NV 0x853D
13718
- #endif
13719
13659
  #ifndef GL_UNSIGNED_NORMALIZED
13720
13660
  #define GL_UNSIGNED_NORMALIZED 0x8C17
13721
13661
  #endif
@@ -15,17 +15,17 @@
15
15
 
16
16
  #include "common.h"
17
17
 
18
- VALUE error_checking = Qtrue;
19
-
20
18
  VALUE Class_GLError;
21
19
 
22
20
  #define BUFSIZE 256
23
21
 
24
- void check_for_glerror(const char *caller)
22
+ void check_for_glerror(VALUE obj, const char *caller)
25
23
  {
26
24
  GLenum error;
25
+ DECL_GL_FUNC_PTR(GLenum,glGetError,(void));
27
26
 
28
- error = glGetError();
27
+ LOAD_GL_FUNC(glGetError, NULL);
28
+ error = fptr_glGetError();
29
29
 
30
30
  if (error==GL_NO_ERROR) { /* no errors == instant return */
31
31
  return;
@@ -41,13 +41,13 @@ void check_for_glerror(const char *caller)
41
41
  } else {
42
42
  caller = "";
43
43
  }
44
-
44
+
45
45
  /* check for queued errors */
46
46
  for(queued_errors = 0;
47
- glGetError()!=GL_NO_ERROR;
47
+ fptr_glGetError()!=GL_NO_ERROR;
48
48
  queued_errors++)
49
49
  ;
50
-
50
+
51
51
  switch(error) {
52
52
  case GL_INVALID_ENUM: error_string = "invalid enumerant"; break;
53
53
  case GL_INVALID_VALUE: error_string = "invalid value"; break;
@@ -59,7 +59,7 @@ void check_for_glerror(const char *caller)
59
59
  case GL_INVALID_FRAMEBUFFER_OPERATION_EXT: error_string = "invalid framebuffer operation"; break;
60
60
  default: error_string = "unknown error"; break;
61
61
  }
62
-
62
+
63
63
  if (queued_errors==0) {
64
64
  snprintf(message, BUFSIZE, "%s%s%s", error_string, from, caller);
65
65
  } else {
@@ -82,31 +82,29 @@ VALUE GLError_initialize(VALUE obj,VALUE message, VALUE error_id)
82
82
 
83
83
  static VALUE enable_error_checking(VALUE obj)
84
84
  {
85
- error_checking = Qtrue;
85
+ SET_GLIMPL_VARIABLE(error_checking, Qtrue);
86
86
  return Qnil;
87
87
  }
88
88
 
89
89
  static VALUE disable_error_checking(VALUE obj)
90
90
  {
91
- error_checking = Qfalse;
91
+ SET_GLIMPL_VARIABLE(error_checking, Qfalse);
92
92
  return Qnil;
93
93
  }
94
94
 
95
95
  static VALUE is_error_checking_enabled(VALUE obj)
96
96
  {
97
- return error_checking;
97
+ return GET_GLIMPL_VARIABLE(error_checking);
98
98
  }
99
99
 
100
- void gl_init_error(VALUE module)
100
+ void gl_init_error(VALUE klass, VALUE module)
101
101
  {
102
102
  Class_GLError = rb_define_class_under(module, "Error", rb_eStandardError);
103
103
 
104
104
  rb_define_method(Class_GLError, "initialize", GLError_initialize, 2);
105
105
  rb_define_attr(Class_GLError, "id", 1, 0);
106
106
 
107
- rb_define_module_function(module, "enable_error_checking", enable_error_checking, 0);
108
- rb_define_module_function(module, "disable_error_checking", disable_error_checking, 0);
109
- rb_define_module_function(module, "is_error_checking_enabled?", is_error_checking_enabled, 0);
110
-
111
- rb_global_variable(&error_checking);
107
+ rb_define_method(klass, "enable_error_checking", enable_error_checking, 0);
108
+ rb_define_method(klass, "disable_error_checking", disable_error_checking, 0);
109
+ rb_define_method(klass, "is_error_checking_enabled?", is_error_checking_enabled, 0);
112
110
  }
@@ -13,16 +13,13 @@
13
13
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14
14
  */
15
15
 
16
- void gl_init_error(VALUE);
16
+ void gl_init_error(VALUE, VALUE);
17
17
 
18
- extern VALUE error_checking;
19
- extern VALUE inside_begin_end;
20
-
21
- void check_for_glerror(const char *);
18
+ void check_for_glerror(VALUE self, const char *);
22
19
 
23
20
  #define CHECK_GLERROR_FROM(caller) \
24
21
  do { \
25
- if (error_checking == Qtrue && inside_begin_end == Qfalse) \
26
- check_for_glerror(caller); \
22
+ if (GET_GLIMPL_VARIABLE(error_checking) == Qtrue && GET_GLIMPL_VARIABLE(inside_begin_end) == Qfalse) \
23
+ check_for_glerror(obj, caller); \
27
24
  } while (0)
28
25
 
@@ -20,8 +20,8 @@
20
20
  /* #208 - GL_3DFX_tbuffer */
21
21
  GL_FUNC_LOAD_1(TbufferMask3DFX,GLvoid, GLuint, "GL_3DFX_tbuffer")
22
22
 
23
- void gl_init_functions_ext_3dfx(VALUE module)
23
+ void gl_init_functions_ext_3dfx(VALUE klass)
24
24
  {
25
25
  /* #208 - GL_3DFX_tbuffer */
26
- rb_define_module_function(module, "glTbufferMask3DFX", gl_TbufferMask3DFX, 1);
26
+ rb_define_method(klass, "glTbufferMask3DFX", gl_TbufferMask3DFX, 1);
27
27
  }
@@ -19,12 +19,12 @@
19
19
 
20
20
  /* #3 GL_ARB_transpose_matrix */
21
21
  #define TRANSPOSEMATRIX_FUNC(_name_,_type_,_conv_) \
22
- static void (APIENTRY * fptr_gl##_name_)(const _type_[]); \
23
22
  static VALUE \
24
23
  gl_##_name_(obj,arg1) \
25
24
  VALUE obj,arg1; \
26
25
  { \
27
26
  _type_ m[4*4]; \
27
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(const _type_[])); \
28
28
  LOAD_GL_FUNC(gl##_name_, "GL_ARB_transpose_matrix"); \
29
29
  _conv_(arg1, m, 4, 4); \
30
30
  fptr_gl##_name_(m); \
@@ -45,12 +45,12 @@ GL_FUNC_LOAD_2(SampleCoverageARB,GLvoid, GLclampf,GLboolean, "GL_ARB_multisample
45
45
  /* #14 GL_ARB_point_parameters */
46
46
  GL_FUNC_LOAD_2(PointParameterfARB,GLvoid, GLenum,GLfloat, "GL_ARB_point_parameters")
47
47
 
48
- static void (APIENTRY * fptr_glPointParameterfvARB)(GLenum,GLfloat *);
49
48
  static VALUE gl_PointParameterfvARB(VALUE obj,VALUE arg1,VALUE arg2)
50
49
  {
51
50
  GLfloat params[3] = {(GLfloat)0.0,(GLfloat)0.0,(GLfloat)0.0};
52
51
  GLenum pname;
53
52
  GLint size;
53
+ DECL_GL_FUNC_PTR(GLvoid,glPointParameterfvARB,(GLenum,GLfloat *));
54
54
  LOAD_GL_FUNC(glPointParameterfvARB, "GL_ARB_point_parameters");
55
55
  pname = NUM2UINT(arg1);
56
56
  Check_Type(arg2,T_ARRAY);
@@ -75,10 +75,10 @@ GL_FUNC_LOAD_3(WindowPos3iARB,GLvoid, GLint,GLint,GLint, "GL_ARB_window_pos")
75
75
  GL_FUNC_LOAD_3(WindowPos3sARB,GLvoid, GLshort,GLshort,GLshort, "GL_ARB_window_pos")
76
76
 
77
77
  #define WINDOWPOSFUNCV(_name_,_type_,_conv_,_size_,_ext_) \
78
- static void (APIENTRY * fptr_gl##_name_)(const _type_ *); \
79
78
  static VALUE gl_##_name_(VALUE obj,VALUE arg1) \
80
79
  { \
81
80
  _type_ cary[_size_]; \
81
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(const _type_ *)); \
82
82
  LOAD_GL_FUNC(gl##_name_, _ext_); \
83
83
  Check_Type(arg1,T_ARRAY); \
84
84
  if (RARRAY_LEN(arg1) != _size_) \
@@ -101,9 +101,9 @@ WINDOWPOSFUNCV(WindowPos3svARB,GLshort,ary2cshort,3,"GL_ARB_window_pos")
101
101
 
102
102
 
103
103
  /* #26 GL_ARB_vertex_program */
104
- static void (APIENTRY * fptr_glProgramStringARB)(GLenum,GLenum,GLsizei,const void *);
105
104
  static VALUE gl_ProgramStringARB(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3)
106
105
  {
106
+ DECL_GL_FUNC_PTR(GLvoid,glProgramStringARB,(GLenum,GLenum,GLsizei,const void *));
107
107
  LOAD_GL_FUNC(glProgramStringARB, "GL_ARB_vertex_program");
108
108
  Check_Type(arg3,T_STRING);
109
109
  fptr_glProgramStringARB((GLenum)NUM2INT(arg1),(GLenum)NUM2INT(arg2),(GLsizei)RSTRING_LENINT(arg3),RSTRING_PTR(arg3));
@@ -111,23 +111,24 @@ static VALUE gl_ProgramStringARB(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3)
111
111
  return Qnil;
112
112
  }
113
113
 
114
- static void (APIENTRY * fptr_glGetProgramivARB)(GLenum,GLenum,GLint *);
115
114
  static VALUE gl_GetProgramivARB(VALUE obj,VALUE arg1,VALUE arg2)
116
115
  {
117
116
  GLint ret = 0;
117
+ DECL_GL_FUNC_PTR(GLvoid,glGetProgramivARB,(GLenum,GLenum,GLint *));
118
118
  LOAD_GL_FUNC(glGetProgramivARB, "GL_ARB_vertex_program");
119
119
  fptr_glGetProgramivARB(NUM2INT(arg1),NUM2INT(arg2),&ret);
120
120
  CHECK_GLERROR_FROM("glGetProgramivARB");
121
121
  return cond_GLBOOL2RUBY(NUM2INT(arg2),ret);
122
122
  }
123
123
 
124
- static void (APIENTRY * fptr_glGetProgramStringARB)(GLenum,GLenum,void *string);
125
124
  static VALUE gl_GetProgramStringARB(VALUE obj,VALUE arg1,VALUE arg2)
126
125
  {
127
126
  GLsizei len = 0;
128
127
  char *buffer;
129
128
  VALUE ret_buffer;
130
129
 
130
+ DECL_GL_FUNC_PTR(GLvoid,glGetProgramStringARB,(GLenum,GLenum,void *string));
131
+ DECL_GL_FUNC_PTR(GLvoid,glGetProgramivARB,(GLenum,GLenum,GLint *));
131
132
  LOAD_GL_FUNC(glGetProgramStringARB, "GL_ARB_vertex_program");
132
133
  LOAD_GL_FUNC(glGetProgramivARB, "GL_ARB_vertex_program");
133
134
 
@@ -153,9 +154,6 @@ GL_FUNC_LOAD_1(IsProgramARB,GLboolean, GLuint, "GL_ARB_vertex_program")
153
154
  GL_FUNC_LOAD_1(EnableVertexAttribArrayARB,GLvoid, GLuint, "GL_ARB_vertex_program")
154
155
  GL_FUNC_LOAD_1(DisableVertexAttribArrayARB,GLvoid, GLuint, "GL_ARB_vertex_program")
155
156
 
156
- extern VALUE g_VertexAttrib_ptr[];
157
-
158
- static void (APIENTRY * fptr_glVertexAttribPointerARB)(GLuint,GLint,GLenum,GLboolean,GLsizei,const GLvoid *);
159
157
  static VALUE gl_VertexAttribPointerARB(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3,VALUE arg4,VALUE arg5,VALUE arg6)
160
158
  {
161
159
  GLuint index;
@@ -164,6 +162,7 @@ static VALUE gl_VertexAttribPointerARB(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg
164
162
  GLboolean normalized;
165
163
  GLsizei stride;
166
164
 
165
+ DECL_GL_FUNC_PTR(GLvoid,glVertexAttribPointerARB,(GLuint,GLint,GLenum,GLboolean,GLsizei,const GLvoid *));
167
166
  LOAD_GL_FUNC(glVertexAttribPointerARB, "GL_ARB_vertex_program");
168
167
 
169
168
  index = (GLuint)NUM2UINT(arg1);
@@ -174,14 +173,14 @@ static VALUE gl_VertexAttribPointerARB(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg
174
173
  if (index>_MAX_VERTEX_ATTRIBS)
175
174
  rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS);
176
175
 
177
- if (CheckBufferBinding(GL_ARRAY_BUFFER_BINDING)) {
178
- g_VertexAttrib_ptr[index] = arg6;
176
+ if (CHECK_BUFFER_BINDING(GL_ARRAY_BUFFER_BINDING)) {
177
+ GET_GLIMPL_VARIABLE(VertexAttrib_ptr)[index] = arg6;
179
178
  fptr_glVertexAttribPointerARB(index,size,type,normalized,stride,(GLvoid *)NUM2SIZET(arg6));
180
179
  } else {
181
180
  VALUE data;
182
181
  data = pack_array_or_pass_string(type,arg6);
183
182
  rb_str_freeze(data);
184
- g_VertexAttrib_ptr[index] = data;
183
+ GET_GLIMPL_VARIABLE(VertexAttrib_ptr)[index] = data;
185
184
  fptr_glVertexAttribPointerARB(index,size,type,normalized,stride,(GLvoid *)RSTRING_PTR(data));
186
185
  }
187
186
 
@@ -190,18 +189,18 @@ static VALUE gl_VertexAttribPointerARB(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg
190
189
  }
191
190
 
192
191
 
193
- static void (APIENTRY * fptr_glGetVertexAttribPointervARB)(GLuint,GLenum,GLvoid **);
194
192
  static VALUE
195
193
  gl_GetVertexAttribPointervARB(obj,arg1)
196
194
  VALUE obj,arg1;
197
195
  {
198
196
  GLuint index;
197
+ DECL_GL_FUNC_PTR(GLvoid,glGetVertexAttribPointervARB,(GLuint,GLenum,GLvoid **));
199
198
  LOAD_GL_FUNC(glGetVertexAttribPointervARB, "GL_ARB_vertex_program");
200
199
  index =(GLuint) NUM2INT(arg1);
201
200
  if (index>_MAX_VERTEX_ATTRIBS)
202
201
  rb_raise(rb_eArgError, "Index too large, maximum allowed value '%i'",_MAX_VERTEX_ATTRIBS);
203
202
 
204
- return g_VertexAttrib_ptr[index];
203
+ return GET_GLIMPL_VARIABLE(VertexAttrib_ptr)[index];
205
204
  }
206
205
 
207
206
  GL_FUNC_LOAD_6(ProgramEnvParameter4dARB,GLvoid, GLenum,GLuint,GLdouble,GLdouble,GLdouble,GLdouble, "GL_ARB_vertex_program")
@@ -210,12 +209,12 @@ GL_FUNC_LOAD_6(ProgramLocalParameter4dARB,GLvoid, GLenum,GLuint,GLdouble,GLdoubl
210
209
  GL_FUNC_LOAD_6(ProgramLocalParameter4fARB,GLvoid, GLenum,GLuint,GLfloat,GLfloat,GLfloat,GLfloat, "GL_ARB_vertex_program")
211
210
 
212
211
  #define PROGRAMPARAM_FUNC_V(_name_,_type_,_conv_,_extension_) \
213
- static void (APIENTRY * fptr_gl##_name_)(GLenum,GLuint,const _type_ *); \
214
212
  static VALUE \
215
213
  gl_##_name_(obj,arg1,arg2,arg3) \
216
214
  VALUE obj,arg1,arg2,arg3; \
217
215
  { \
218
216
  _type_ cary[4]; \
217
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLenum,GLuint,const _type_ *)); \
219
218
  LOAD_GL_FUNC(gl##_name_, _extension_); \
220
219
  _conv_(arg3,cary,4); \
221
220
  fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),cary); \
@@ -230,12 +229,12 @@ PROGRAMPARAM_FUNC_V(ProgramLocalParameter4fvARB,GLfloat,ary2cflt,"GL_ARB_vertex_
230
229
  #undef PROGRAMPARAM_FUNC_V
231
230
 
232
231
  #define GETPROGRAMPARAM_FUNC(_name_,_type_,_extension_) \
233
- static void (APIENTRY * fptr_gl##_name_)(GLenum,GLuint,_type_ *); \
234
232
  static VALUE \
235
233
  gl_##_name_(obj,arg1,arg2) \
236
234
  VALUE obj,arg1,arg2; \
237
235
  { \
238
236
  _type_ cary[4] = {(_type_)0.0,(_type_)0.0,(_type_)0.0,(_type_)0.0}; \
237
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLenum,GLuint,_type_ *)); \
239
238
  LOAD_GL_FUNC(gl##_name_, _extension_); \
240
239
  fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),cary); \
241
240
  RET_ARRAY_OR_SINGLE("gl" #_name_, 4, RETCONV_##_type_, cary); \
@@ -263,13 +262,13 @@ GL_FUNC_LOAD_5(VertexAttrib4sARB,GLvoid, GLuint,GLshort,GLshort,GLshort,GLshort,
263
262
  GL_FUNC_LOAD_5(VertexAttrib4NubARB,GLvoid, GLuint,GLubyte,GLubyte,GLubyte,GLubyte, "GL_ARB_vertex_program")
264
263
 
265
264
  #define VERTEXATTRIB_FUNC_V(_name_,_type_,_conv_,_size_,_extension_) \
266
- static void (APIENTRY * fptr_gl##_name_)(GLuint,_type_ *); \
267
265
  static VALUE \
268
266
  gl_##_name_(obj,arg1,arg2) \
269
267
  VALUE obj,arg1,arg2; \
270
268
  { \
271
269
  GLuint index; \
272
270
  _type_ v[_size_]; \
271
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLuint,_type_ *)); \
273
272
  LOAD_GL_FUNC(gl##_name_, _extension_); \
274
273
  index = (GLuint)NUM2UINT(arg1); \
275
274
  _conv_(arg2,v,_size_); \
@@ -304,7 +303,6 @@ VERTEXATTRIB_FUNC_V(VertexAttrib1svARB,GLshort,ary2cshort,1,"GL_ARB_vertex_progr
304
303
  #undef VERTEXATTRIB_FUNC_V
305
304
 
306
305
  #define GETVERTEXATTRIB_FUNC(_name_,_type_,_extension_) \
307
- static void (APIENTRY * fptr_gl##_name_)(GLuint,GLenum,_type_ *); \
308
306
  static VALUE \
309
307
  gl_##_name_(obj,arg1,arg2) \
310
308
  VALUE obj,arg1,arg2; \
@@ -313,6 +311,7 @@ VALUE obj,arg1,arg2; \
313
311
  GLenum pname; \
314
312
  _type_ params[4] = {0,0,0,0}; \
315
313
  GLint size; \
314
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLuint,GLenum,_type_ *)); \
316
315
  LOAD_GL_FUNC(gl##_name_, _extension_); \
317
316
  index = (GLuint)NUM2UINT(arg1); \
318
317
  pname = (GLenum)NUM2INT(arg2); \
@@ -329,7 +328,6 @@ GETVERTEXATTRIB_FUNC(GetVertexAttribfvARB,GLfloat,"GL_ARB_vertex_program")
329
328
  //GETVERTEXATTRIB_FUNC(GetVertexAttribivARB,GLint,INT2NUM,"GL_ARB_vertex_program")
330
329
  #undef GETVERTEXATTRIB_FUNC
331
330
 
332
- static void (APIENTRY * fptr_glGetVertexAttribivARB)(GLuint,GLenum,GLint *);
333
331
  static VALUE
334
332
  gl_GetVertexAttribivARB(obj,arg1,arg2)
335
333
  VALUE obj,arg1,arg2;
@@ -338,6 +336,7 @@ VALUE obj,arg1,arg2;
338
336
  GLenum pname;
339
337
  GLint params[4] = {0,0,0,0};
340
338
  GLint size;
339
+ DECL_GL_FUNC_PTR(GLvoid,glGetVertexAttribivARB,(GLuint,GLenum,GLint *));
341
340
  LOAD_GL_FUNC(glGetVertexAttribivARB, "GL_ARB_vertex_program");
342
341
  index = (GLuint)NUM2UINT(arg1);
343
342
  pname = (GLenum)NUM2INT(arg2);
@@ -359,10 +358,10 @@ GL_FUNC_LOAD_2(BeginQueryARB,GLvoid, GLuint,GLuint, "GL_ARB_occlusion_query")
359
358
  GL_FUNC_LOAD_1(EndQueryARB,GLvoid, GLenum, "GL_ARB_occlusion_query")
360
359
 
361
360
  #define GETQUERY_FUNC(_name_,_type_,_conv_) \
362
- static void (APIENTRY * fptr_gl##_name_)(GLuint,GLenum,_type_ *); \
363
361
  static VALUE gl_##_name_(VALUE obj,VALUE arg1,VALUE arg2) \
364
362
  { \
365
363
  _type_ ret = 0; \
364
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLuint,GLenum,_type_ *)); \
366
365
  LOAD_GL_FUNC(gl##_name_, "GL_ARB_occlusion_query"); \
367
366
  fptr_gl##_name_(NUM2INT(arg1),NUM2INT(arg2),&ret); \
368
367
  CHECK_GLERROR_FROM("gl" #_name_); \
@@ -386,7 +385,6 @@ GL_FUNC_LOAD_1(GetHandleARB,GLuint, GLenum, "GL_ARB_shader_objects")
386
385
  GL_FUNC_LOAD_1(CreateShaderObjectARB,GLuint, GLenum, "GL_ARB_shader_objects")
387
386
  GL_FUNC_LOAD_0(CreateProgramObjectARB,GLuint, "GL_ARB_shader_objects")
388
387
 
389
- static void (APIENTRY * fptr_glShaderSourceARB)(GLuint,GLsizei,GLchar**,GLint *);
390
388
  static VALUE
391
389
  gl_ShaderSourceARB(obj,arg1,arg2)
392
390
  VALUE obj,arg1,arg2;
@@ -394,6 +392,7 @@ VALUE obj,arg1,arg2;
394
392
  GLuint shader;
395
393
  GLint length;
396
394
  GLchar *str;
395
+ DECL_GL_FUNC_PTR(GLvoid,glShaderSourceARB,(GLuint,GLsizei,GLchar**,GLint *));
397
396
  LOAD_GL_FUNC(glShaderSourceARB, "GL_ARB_shader_objects");
398
397
  shader = (GLuint)NUM2UINT(arg1);
399
398
  Check_Type(arg2,T_STRING);
@@ -414,7 +413,6 @@ GL_FUNC_LOAD_4(Uniform3iARB,GLvoid, GLint,GLint,GLint,GLint, "GL_ARB_shader_obje
414
413
  GL_FUNC_LOAD_5(Uniform4iARB,GLvoid, GLint,GLint,GLint,GLint,GLint, "GL_ARB_shader_objects")
415
414
 
416
415
  #define GLUNIFORM_VFUNC(_name_,_type_,_conv_,_size_) \
417
- static void (APIENTRY * fptr_gl##_name_)(GLint,GLsizei,const _type_ *); \
418
416
  static VALUE \
419
417
  gl_##_name_(obj,arg1,arg2) \
420
418
  VALUE obj,arg1,arg2; \
@@ -422,6 +420,7 @@ VALUE obj,arg1,arg2; \
422
420
  GLint location; \
423
421
  GLsizei count; \
424
422
  _type_ *value; \
423
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLint,GLsizei,const _type_ *)); \
425
424
  LOAD_GL_FUNC(gl##_name_, "GL_ARB_shader_objects"); \
426
425
  Check_Type(arg2,T_ARRAY); \
427
426
  count = (GLsizei)RARRAY_LENINT(arg2); \
@@ -447,7 +446,6 @@ GLUNIFORM_VFUNC(Uniform4ivARB,GLint,ary2cint,4)
447
446
  #undef GLUNIFORM_VFUNC
448
447
 
449
448
  #define UNIFORMMATRIX_FUNC(_name_,_size_) \
450
- static void (APIENTRY * fptr_gl##_name_)(GLint,GLsizei,GLboolean,GLfloat *); \
451
449
  static VALUE \
452
450
  gl_##_name_(obj,arg1,arg2,arg3) \
453
451
  VALUE obj,arg1,arg2,arg3; \
@@ -456,6 +454,7 @@ VALUE obj,arg1,arg2,arg3; \
456
454
  GLsizei count; \
457
455
  GLboolean transpose; \
458
456
  GLfloat *value; \
457
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLint,GLsizei,GLboolean,GLfloat *)); \
459
458
  LOAD_GL_FUNC(gl##_name_, "GL_ARB_shader_objects"); \
460
459
  location = (GLint)NUM2INT(arg1); \
461
460
  count = (GLsizei)RARRAY_LENINT(rb_funcall(rb_Array(arg3),rb_intern("flatten"),0)); \
@@ -474,7 +473,6 @@ UNIFORMMATRIX_FUNC(UniformMatrix4fvARB,4)
474
473
  #undef UNIFORMMATRIX_FUNC
475
474
 
476
475
  #define GETOBJECTPARAMETER_FUNC(_name_,_type_,_conv_) \
477
- static void (APIENTRY * fptr_gl##_name_)(GLuint,GLenum,_type_ *); \
478
476
  static VALUE \
479
477
  gl_##_name_(obj,arg1,arg2) \
480
478
  VALUE obj,arg1,arg2; \
@@ -482,6 +480,7 @@ VALUE obj,arg1,arg2; \
482
480
  GLuint program; \
483
481
  GLenum pname; \
484
482
  _type_ params = 0; \
483
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLuint,GLenum,_type_ *)); \
485
484
  LOAD_GL_FUNC(gl##_name_, "GL_ARB_shader_objects"); \
486
485
  program = (GLuint)NUM2UINT(arg1); \
487
486
  pname = (GLenum)NUM2INT(arg2); \
@@ -495,7 +494,6 @@ GETOBJECTPARAMETER_FUNC(GetObjectParameterfvARB,GLfloat,cond_GLBOOL2RUBY_F)
495
494
 
496
495
  #undef GETOBJECTPARAMETER_FUNC
497
496
 
498
- static void (APIENTRY * fptr_glGetInfoLogARB)(GLuint,GLsizei,GLsizei *,GLchar *);
499
497
  static VALUE
500
498
  gl_GetInfoLogARB(obj,arg1)
501
499
  VALUE obj,arg1;
@@ -504,6 +502,8 @@ VALUE obj,arg1;
504
502
  GLint max_size = 0;
505
503
  GLsizei ret_length = 0;
506
504
  VALUE buffer;
505
+ DECL_GL_FUNC_PTR(GLvoid,glGetInfoLogARB,(GLuint,GLsizei,GLsizei *,GLchar *));
506
+ DECL_GL_FUNC_PTR(GLvoid,glGetObjectParameterivARB,(GLuint,GLenum,GLint *));
507
507
  LOAD_GL_FUNC(glGetInfoLogARB, "GL_ARB_shader_objects");
508
508
  LOAD_GL_FUNC(glGetObjectParameterivARB, "GL_ARB_shader_objects");
509
509
  program = (GLuint)NUM2UINT(arg1);
@@ -517,7 +517,6 @@ VALUE obj,arg1;
517
517
  return buffer;
518
518
  }
519
519
 
520
- static void (APIENTRY * fptr_glGetShaderSourceARB)(GLuint,GLsizei,GLsizei *,GLchar *);
521
520
  static VALUE
522
521
  gl_GetShaderSourceARB(obj,arg1)
523
522
  VALUE obj,arg1;
@@ -526,6 +525,8 @@ VALUE obj,arg1;
526
525
  GLint max_size = 0;
527
526
  GLsizei ret_length = 0;
528
527
  VALUE buffer;
528
+ DECL_GL_FUNC_PTR(GLvoid,glGetShaderSourceARB,(GLuint,GLsizei,GLsizei *,GLchar *));
529
+ DECL_GL_FUNC_PTR(GLvoid,glGetObjectParameterivARB,(GLuint,GLenum,GLint *));
529
530
  LOAD_GL_FUNC(glGetShaderSourceARB, "GL_ARB_shader_objects");
530
531
  LOAD_GL_FUNC(glGetObjectParameterivARB, "GL_ARB_shader_objects");
531
532
  shader = (GLuint)NUM2UINT(arg1);
@@ -539,7 +540,6 @@ VALUE obj,arg1;
539
540
  return buffer;
540
541
  }
541
542
 
542
- static void (APIENTRY * fptr_glGetActiveUniformARB)(GLuint,GLuint,GLsizei,GLsizei*,GLint*,GLenum*,GLchar*);
543
543
  static VALUE
544
544
  gl_GetActiveUniformARB(obj,arg1,arg2)
545
545
  VALUE obj,arg1,arg2;
@@ -552,6 +552,8 @@ VALUE obj,arg1,arg2;
552
552
  GLenum uniform_type = 0;
553
553
  VALUE buffer;
554
554
  VALUE retary;
555
+ DECL_GL_FUNC_PTR(GLvoid,glGetActiveUniformARB,(GLuint,GLuint,GLsizei,GLsizei*,GLint*,GLenum*,GLchar*));
556
+ DECL_GL_FUNC_PTR(GLvoid,glGetObjectParameterivARB,(GLuint,GLenum,GLint *));
555
557
  LOAD_GL_FUNC(glGetActiveUniformARB, "GL_ARB_shader_objects");
556
558
  LOAD_GL_FUNC(glGetObjectParameterivARB, "GL_ARB_shader_objects");
557
559
  program = (GLuint)NUM2UINT(arg1);
@@ -574,7 +576,6 @@ VALUE obj,arg1,arg2;
574
576
  }
575
577
 
576
578
  #define GETUNIFORM_FUNC(_name_,_type_) \
577
- static void (APIENTRY * fptr_gl##_name_)(GLuint,GLint,_type_ *); \
578
579
  static VALUE \
579
580
  gl_##_name_(obj,arg1,arg2) \
580
581
  VALUE obj,arg1,arg2; \
@@ -586,6 +587,8 @@ VALUE obj,arg1,arg2; \
586
587
  GLenum uniform_type = 0; \
587
588
  GLint uniform_size = 0; \
588
589
  \
590
+ DECL_GL_FUNC_PTR(GLvoid,gl##_name_,(GLuint,GLint,_type_ *)); \
591
+ DECL_GL_FUNC_PTR(GLvoid,glGetActiveUniformARB,(GLuint,GLuint,GLsizei,GLsizei*,GLint*,GLenum*,GLchar*)); \
589
592
  LOAD_GL_FUNC(gl##_name_, "GL_ARB_shader_objects"); \
590
593
  LOAD_GL_FUNC(glGetActiveUniformARB, "GL_ARB_shader_objects"); \
591
594
  program = (GLuint)NUM2UINT(arg1); \
@@ -608,13 +611,13 @@ GETUNIFORM_FUNC(GetUniformfvARB,GLfloat)
608
611
  GETUNIFORM_FUNC(GetUniformivARB,GLint)
609
612
  #undef GETUNIFORM_FUNC
610
613
 
611
- static GLint (APIENTRY * fptr_glGetUniformLocationARB)(GLuint,const GLchar*);
612
614
  static VALUE
613
615
  gl_GetUniformLocationARB(obj,arg1,arg2)
614
616
  VALUE obj,arg1,arg2;
615
617
  {
616
618
  GLuint program;
617
619
  GLint ret;
620
+ DECL_GL_FUNC_PTR(GLint,glGetUniformLocationARB,(GLuint,const GLchar*));
618
621
  LOAD_GL_FUNC(glGetUniformLocationARB, "GL_ARB_shader_objects");
619
622
  program=(GLuint)NUM2UINT(arg1);
620
623
  Check_Type(arg2,T_STRING);
@@ -623,7 +626,6 @@ VALUE obj,arg1,arg2;
623
626
  return INT2NUM(ret);
624
627
  }
625
628
 
626
- static void (APIENTRY * fptr_glGetAttachedObjectsARB)(GLuint,GLsizei,GLsizei *,GLuint *);
627
629
  static VALUE
628
630
  gl_GetAttachedObjectsARB(obj,arg1)
629
631
  VALUE obj,arg1;
@@ -632,6 +634,8 @@ VALUE obj,arg1;
632
634
  GLint shaders_num = 0;
633
635
  GLuint *shaders;
634
636
  GLsizei count = 0;
637
+ DECL_GL_FUNC_PTR(GLvoid,glGetAttachedObjectsARB,(GLuint,GLsizei,GLsizei *,GLuint *));
638
+ DECL_GL_FUNC_PTR(GLvoid,glGetObjectParameterivARB,(GLuint,GLenum,GLint *));
635
639
  LOAD_GL_FUNC(glGetAttachedObjectsARB, "GL_ARB_shader_objects");
636
640
  LOAD_GL_FUNC(glGetObjectParameterivARB, "GL_ARB_shader_objects");
637
641
  program = (GLuint)NUM2UINT(arg1);
@@ -647,13 +651,13 @@ VALUE obj,arg1;
647
651
 
648
652
  /* #31 GL_ARB_vertex_shader */
649
653
 
650
- static void (APIENTRY * fptr_glBindAttribLocationARB)(GLuint,GLuint,GLchar *);
651
654
  static VALUE
652
655
  gl_BindAttribLocationARB(obj,arg1,arg2,arg3)
653
656
  VALUE obj,arg1,arg2,arg3;
654
657
  {
655
658
  GLuint program;
656
659
  GLuint index;
660
+ DECL_GL_FUNC_PTR(GLvoid,glBindAttribLocationARB,(GLuint,GLuint,GLchar *));
657
661
  LOAD_GL_FUNC(glBindAttribLocationARB, "GL_ARB_vertex_shader");
658
662
  program = (GLuint)NUM2UINT(arg1);
659
663
  index = (GLuint)NUM2UINT(arg2);
@@ -663,7 +667,6 @@ VALUE obj,arg1,arg2,arg3;
663
667
  return Qnil;
664
668
  }
665
669
 
666
- static void (APIENTRY * fptr_glGetActiveAttribARB)(GLuint,GLuint,GLsizei,GLsizei *,GLint *,GLenum *,GLchar *);
667
670
  static VALUE
668
671
  gl_GetActiveAttribARB(obj,arg1,arg2)
669
672
  VALUE obj,arg1,arg2;
@@ -676,6 +679,8 @@ VALUE obj,arg1,arg2;
676
679
  GLenum attrib_type = 0;
677
680
  VALUE buffer;
678
681
  VALUE retary;
682
+ DECL_GL_FUNC_PTR(GLvoid,glGetActiveAttribARB,(GLuint,GLuint,GLsizei,GLsizei *,GLint *,GLenum *,GLchar *));
683
+ DECL_GL_FUNC_PTR(GLvoid,glGetObjectParameterivARB,(GLuint,GLenum,GLint *));
679
684
  LOAD_GL_FUNC(glGetActiveAttribARB, "GL_ARB_vertex_shader");
680
685
  LOAD_GL_FUNC(glGetObjectParameterivARB, "GL_ARB_vertex_shader");
681
686
  program = (GLuint)NUM2UINT(arg1);
@@ -697,13 +702,13 @@ VALUE obj,arg1,arg2;
697
702
  return retary;
698
703
  }
699
704
 
700
- static GLint (APIENTRY * fptr_glGetAttribLocationARB)(GLuint,const GLchar*);
701
705
  static VALUE
702
706
  gl_GetAttribLocationARB(obj,arg1,arg2)
703
707
  VALUE obj,arg1,arg2;
704
708
  {
705
709
  GLuint program;
706
710
  GLint ret;
711
+ DECL_GL_FUNC_PTR(GLint,glGetAttribLocationARB,(GLuint,const GLchar*));
707
712
  LOAD_GL_FUNC(glGetAttribLocationARB, "GL_ARB_shader_objects");
708
713
  program=(GLuint)NUM2UINT(arg1);
709
714
  Check_Type(arg2,T_STRING);
@@ -716,160 +721,160 @@ VALUE obj,arg1,arg2;
716
721
  /* #39 GL_ARB_color_buffer_float */
717
722
  GL_FUNC_LOAD_2(ClampColorARB,GLvoid, GLenum,GLenum, "GL_ARB_color_buffer_float")
718
723
 
719
- void gl_init_functions_ext_arb(VALUE module)
724
+ void gl_init_functions_ext_arb(VALUE klass)
720
725
  {
721
726
  /* #3 GL_ARB_transpose_matrix */
722
- rb_define_module_function(module, "glLoadTransposeMatrixfARB", gl_LoadTransposeMatrixfARB, 1);
723
- rb_define_module_function(module, "glLoadTransposeMatrixdARB", gl_LoadTransposeMatrixdARB, 1);
724
- rb_define_module_function(module, "glMultTransposeMatrixfARB", gl_MultTransposeMatrixfARB, 1);
725
- rb_define_module_function(module, "glMultTransposeMatrixdARB", gl_MultTransposeMatrixdARB, 1);
727
+ rb_define_method(klass, "glLoadTransposeMatrixfARB", gl_LoadTransposeMatrixfARB, 1);
728
+ rb_define_method(klass, "glLoadTransposeMatrixdARB", gl_LoadTransposeMatrixdARB, 1);
729
+ rb_define_method(klass, "glMultTransposeMatrixfARB", gl_MultTransposeMatrixfARB, 1);
730
+ rb_define_method(klass, "glMultTransposeMatrixdARB", gl_MultTransposeMatrixdARB, 1);
726
731
 
727
732
  /* #5 GL_ARB_multisample */
728
- rb_define_module_function(module, "glSampleCoverageARB", gl_SampleCoverageARB, 2);
733
+ rb_define_method(klass, "glSampleCoverageARB", gl_SampleCoverageARB, 2);
729
734
 
730
735
  /* #14 GL_ARB_point_parameters */
731
- rb_define_module_function(module, "glPointParameterfARB", gl_PointParameterfARB, 2);
732
- rb_define_module_function(module, "glPointParameterfvARB", gl_PointParameterfvARB, 2);
736
+ rb_define_method(klass, "glPointParameterfARB", gl_PointParameterfARB, 2);
737
+ rb_define_method(klass, "glPointParameterfvARB", gl_PointParameterfvARB, 2);
733
738
 
734
739
  /* #26 GL_ARB_window_pos */
735
- rb_define_module_function(module, "glWindowPos2dARB", gl_WindowPos2dARB, 2);
736
- rb_define_module_function(module, "glWindowPos2fARB", gl_WindowPos2fARB, 2);
737
- rb_define_module_function(module, "glWindowPos2iARB", gl_WindowPos2iARB, 2);
738
- rb_define_module_function(module, "glWindowPos2sARB", gl_WindowPos2sARB, 2);
739
- rb_define_module_function(module, "glWindowPos3dARB", gl_WindowPos3dARB, 3);
740
- rb_define_module_function(module, "glWindowPos3fARB", gl_WindowPos3fARB, 3);
741
- rb_define_module_function(module, "glWindowPos3iARB", gl_WindowPos3iARB, 3);
742
- rb_define_module_function(module, "glWindowPos3sARB", gl_WindowPos3sARB, 3);
743
-
744
- rb_define_module_function(module, "glWindowPos2dvARB", gl_WindowPos2dvARB, 1);
745
- rb_define_module_function(module, "glWindowPos2fvARB", gl_WindowPos2fvARB, 1);
746
- rb_define_module_function(module, "glWindowPos2ivARB", gl_WindowPos2ivARB, 1);
747
- rb_define_module_function(module, "glWindowPos2svARB", gl_WindowPos2svARB, 1);
748
- rb_define_module_function(module, "glWindowPos3dvARB", gl_WindowPos3dvARB, 1);
749
- rb_define_module_function(module, "glWindowPos3fvARB", gl_WindowPos3fvARB, 1);
750
- rb_define_module_function(module, "glWindowPos3ivARB", gl_WindowPos3ivARB, 1);
751
- rb_define_module_function(module, "glWindowPos3svARB", gl_WindowPos3svARB, 1);
740
+ rb_define_method(klass, "glWindowPos2dARB", gl_WindowPos2dARB, 2);
741
+ rb_define_method(klass, "glWindowPos2fARB", gl_WindowPos2fARB, 2);
742
+ rb_define_method(klass, "glWindowPos2iARB", gl_WindowPos2iARB, 2);
743
+ rb_define_method(klass, "glWindowPos2sARB", gl_WindowPos2sARB, 2);
744
+ rb_define_method(klass, "glWindowPos3dARB", gl_WindowPos3dARB, 3);
745
+ rb_define_method(klass, "glWindowPos3fARB", gl_WindowPos3fARB, 3);
746
+ rb_define_method(klass, "glWindowPos3iARB", gl_WindowPos3iARB, 3);
747
+ rb_define_method(klass, "glWindowPos3sARB", gl_WindowPos3sARB, 3);
748
+
749
+ rb_define_method(klass, "glWindowPos2dvARB", gl_WindowPos2dvARB, 1);
750
+ rb_define_method(klass, "glWindowPos2fvARB", gl_WindowPos2fvARB, 1);
751
+ rb_define_method(klass, "glWindowPos2ivARB", gl_WindowPos2ivARB, 1);
752
+ rb_define_method(klass, "glWindowPos2svARB", gl_WindowPos2svARB, 1);
753
+ rb_define_method(klass, "glWindowPos3dvARB", gl_WindowPos3dvARB, 1);
754
+ rb_define_method(klass, "glWindowPos3fvARB", gl_WindowPos3fvARB, 1);
755
+ rb_define_method(klass, "glWindowPos3ivARB", gl_WindowPos3ivARB, 1);
756
+ rb_define_method(klass, "glWindowPos3svARB", gl_WindowPos3svARB, 1);
752
757
 
753
758
  /* #26 GL_ARB_vertex_program */
754
- rb_define_module_function(module, "glProgramStringARB", gl_ProgramStringARB, 3);
755
- rb_define_module_function(module, "glGetProgramStringARB", gl_GetProgramStringARB, 2);
756
- rb_define_module_function(module, "glGetProgramivARB", gl_GetProgramivARB, 2);
757
- rb_define_module_function(module, "glBindProgramARB", gl_BindProgramARB, 2);
758
- rb_define_module_function(module, "glGenProgramsARB", gl_GenProgramsARB, 1);
759
- rb_define_module_function(module, "glDeleteProgramsARB", gl_DeleteProgramsARB, 1);
760
- rb_define_module_function(module, "glIsProgramARB", gl_IsProgramARB, 1);
761
- rb_define_module_function(module, "glEnableVertexAttribArrayARB", gl_EnableVertexAttribArrayARB, 1);
762
- rb_define_module_function(module, "glDisableVertexAttribArrayARB", gl_DisableVertexAttribArrayARB, 1);
763
- rb_define_module_function(module, "glVertexAttribPointerARB", gl_VertexAttribPointerARB, 6);
764
- rb_define_module_function(module, "glGetVertexAttribPointervARB", gl_GetVertexAttribPointervARB, 1);
765
- rb_define_module_function(module, "glProgramEnvParameter4dARB", gl_ProgramEnvParameter4dARB, 6);
766
- rb_define_module_function(module, "glProgramEnvParameter4fARB", gl_ProgramEnvParameter4fARB, 6);
767
- rb_define_module_function(module, "glProgramLocalParameter4dARB", gl_ProgramLocalParameter4dARB, 6);
768
- rb_define_module_function(module, "glProgramLocalParameter4fARB", gl_ProgramLocalParameter4fARB, 6);
769
- rb_define_module_function(module, "glProgramEnvParameter4dvARB", gl_ProgramEnvParameter4dvARB, 3);
770
- rb_define_module_function(module, "glProgramEnvParameter4fvARB", gl_ProgramEnvParameter4fvARB, 3);
771
- rb_define_module_function(module, "glProgramLocalParameter4dvARB", gl_ProgramLocalParameter4dvARB, 3);
772
- rb_define_module_function(module, "glProgramLocalParameter4fvARB", gl_ProgramLocalParameter4fvARB, 3);
773
- rb_define_module_function(module, "glGetProgramEnvParameterdvARB", gl_GetProgramEnvParameterdvARB, 2);
774
- rb_define_module_function(module, "glGetProgramEnvParameterfvARB", gl_GetProgramEnvParameterfvARB, 2);
775
- rb_define_module_function(module, "glGetProgramLocalParameterdvARB", gl_GetProgramLocalParameterdvARB, 2);
776
- rb_define_module_function(module, "glGetProgramLocalParameterfvARB", gl_GetProgramLocalParameterfvARB, 2);
777
- rb_define_module_function(module, "glVertexAttrib1dARB", gl_VertexAttrib1dARB, 2);
778
- rb_define_module_function(module, "glVertexAttrib1fARB", gl_VertexAttrib1fARB, 2);
779
- rb_define_module_function(module, "glVertexAttrib1sARB", gl_VertexAttrib1sARB, 2);
780
- rb_define_module_function(module, "glVertexAttrib2dARB", gl_VertexAttrib2dARB, 3);
781
- rb_define_module_function(module, "glVertexAttrib2fARB", gl_VertexAttrib2fARB, 3);
782
- rb_define_module_function(module, "glVertexAttrib2sARB", gl_VertexAttrib2sARB, 3);
783
- rb_define_module_function(module, "glVertexAttrib3dARB", gl_VertexAttrib3dARB, 4);
784
- rb_define_module_function(module, "glVertexAttrib3fARB", gl_VertexAttrib3fARB, 4);
785
- rb_define_module_function(module, "glVertexAttrib3sARB", gl_VertexAttrib3sARB, 4);
786
- rb_define_module_function(module, "glVertexAttrib4NbvARB", gl_VertexAttrib4NbvARB, 2);
787
- rb_define_module_function(module, "glVertexAttrib4NivARB", gl_VertexAttrib4NivARB, 2);
788
- rb_define_module_function(module, "glVertexAttrib4NsvARB", gl_VertexAttrib4NsvARB, 2);
789
- rb_define_module_function(module, "glVertexAttrib4NubARB", gl_VertexAttrib4NubARB, 5);
790
- rb_define_module_function(module, "glVertexAttrib4NubvARB", gl_VertexAttrib4NubvARB, 2);
791
- rb_define_module_function(module, "glVertexAttrib4NuivARB", gl_VertexAttrib4NuivARB, 2);
792
- rb_define_module_function(module, "glVertexAttrib4NusvARB", gl_VertexAttrib4NusvARB, 2);
793
- rb_define_module_function(module, "glVertexAttrib4bvARB", gl_VertexAttrib4bvARB, 2);
794
- rb_define_module_function(module, "glVertexAttrib4dARB", gl_VertexAttrib4dARB, 5);
795
- rb_define_module_function(module, "glVertexAttrib4fARB", gl_VertexAttrib4fARB, 5);
796
- rb_define_module_function(module, "glVertexAttrib4ivARB", gl_VertexAttrib4ivARB, 2);
797
- rb_define_module_function(module, "glVertexAttrib4sARB", gl_VertexAttrib4sARB, 5);
798
- rb_define_module_function(module, "glVertexAttrib4ubvARB", gl_VertexAttrib4ubvARB, 2);
799
- rb_define_module_function(module, "glVertexAttrib4uivARB", gl_VertexAttrib4uivARB, 2);
800
- rb_define_module_function(module, "glVertexAttrib4usvARB", gl_VertexAttrib4usvARB, 2);
801
- rb_define_module_function(module, "glVertexAttrib1dvARB", gl_VertexAttrib1dvARB, 2);
802
- rb_define_module_function(module, "glVertexAttrib1fvARB", gl_VertexAttrib1fvARB, 2);
803
- rb_define_module_function(module, "glVertexAttrib1svARB", gl_VertexAttrib1svARB, 2);
804
- rb_define_module_function(module, "glVertexAttrib2dvARB", gl_VertexAttrib2dvARB, 2);
805
- rb_define_module_function(module, "glVertexAttrib2fvARB", gl_VertexAttrib2fvARB, 2);
806
- rb_define_module_function(module, "glVertexAttrib2svARB", gl_VertexAttrib2svARB, 2);
807
- rb_define_module_function(module, "glVertexAttrib3dvARB", gl_VertexAttrib3dvARB, 2);
808
- rb_define_module_function(module, "glVertexAttrib3fvARB", gl_VertexAttrib3fvARB, 2);
809
- rb_define_module_function(module, "glVertexAttrib3svARB", gl_VertexAttrib3svARB, 2);
810
- rb_define_module_function(module, "glVertexAttrib4dvARB", gl_VertexAttrib4dvARB, 2);
811
- rb_define_module_function(module, "glVertexAttrib4fvARB", gl_VertexAttrib4fvARB, 2);
812
- rb_define_module_function(module, "glVertexAttrib4svARB", gl_VertexAttrib4svARB, 2);
813
- rb_define_module_function(module, "glGetVertexAttribdvARB", gl_GetVertexAttribdvARB, 2);
814
- rb_define_module_function(module, "glGetVertexAttribfvARB", gl_GetVertexAttribfvARB, 2);
815
- rb_define_module_function(module, "glGetVertexAttribivARB", gl_GetVertexAttribivARB, 2);
759
+ rb_define_method(klass, "glProgramStringARB", gl_ProgramStringARB, 3);
760
+ rb_define_method(klass, "glGetProgramStringARB", gl_GetProgramStringARB, 2);
761
+ rb_define_method(klass, "glGetProgramivARB", gl_GetProgramivARB, 2);
762
+ rb_define_method(klass, "glBindProgramARB", gl_BindProgramARB, 2);
763
+ rb_define_method(klass, "glGenProgramsARB", gl_GenProgramsARB, 1);
764
+ rb_define_method(klass, "glDeleteProgramsARB", gl_DeleteProgramsARB, 1);
765
+ rb_define_method(klass, "glIsProgramARB", gl_IsProgramARB, 1);
766
+ rb_define_method(klass, "glEnableVertexAttribArrayARB", gl_EnableVertexAttribArrayARB, 1);
767
+ rb_define_method(klass, "glDisableVertexAttribArrayARB", gl_DisableVertexAttribArrayARB, 1);
768
+ rb_define_method(klass, "glVertexAttribPointerARB", gl_VertexAttribPointerARB, 6);
769
+ rb_define_method(klass, "glGetVertexAttribPointervARB", gl_GetVertexAttribPointervARB, 1);
770
+ rb_define_method(klass, "glProgramEnvParameter4dARB", gl_ProgramEnvParameter4dARB, 6);
771
+ rb_define_method(klass, "glProgramEnvParameter4fARB", gl_ProgramEnvParameter4fARB, 6);
772
+ rb_define_method(klass, "glProgramLocalParameter4dARB", gl_ProgramLocalParameter4dARB, 6);
773
+ rb_define_method(klass, "glProgramLocalParameter4fARB", gl_ProgramLocalParameter4fARB, 6);
774
+ rb_define_method(klass, "glProgramEnvParameter4dvARB", gl_ProgramEnvParameter4dvARB, 3);
775
+ rb_define_method(klass, "glProgramEnvParameter4fvARB", gl_ProgramEnvParameter4fvARB, 3);
776
+ rb_define_method(klass, "glProgramLocalParameter4dvARB", gl_ProgramLocalParameter4dvARB, 3);
777
+ rb_define_method(klass, "glProgramLocalParameter4fvARB", gl_ProgramLocalParameter4fvARB, 3);
778
+ rb_define_method(klass, "glGetProgramEnvParameterdvARB", gl_GetProgramEnvParameterdvARB, 2);
779
+ rb_define_method(klass, "glGetProgramEnvParameterfvARB", gl_GetProgramEnvParameterfvARB, 2);
780
+ rb_define_method(klass, "glGetProgramLocalParameterdvARB", gl_GetProgramLocalParameterdvARB, 2);
781
+ rb_define_method(klass, "glGetProgramLocalParameterfvARB", gl_GetProgramLocalParameterfvARB, 2);
782
+ rb_define_method(klass, "glVertexAttrib1dARB", gl_VertexAttrib1dARB, 2);
783
+ rb_define_method(klass, "glVertexAttrib1fARB", gl_VertexAttrib1fARB, 2);
784
+ rb_define_method(klass, "glVertexAttrib1sARB", gl_VertexAttrib1sARB, 2);
785
+ rb_define_method(klass, "glVertexAttrib2dARB", gl_VertexAttrib2dARB, 3);
786
+ rb_define_method(klass, "glVertexAttrib2fARB", gl_VertexAttrib2fARB, 3);
787
+ rb_define_method(klass, "glVertexAttrib2sARB", gl_VertexAttrib2sARB, 3);
788
+ rb_define_method(klass, "glVertexAttrib3dARB", gl_VertexAttrib3dARB, 4);
789
+ rb_define_method(klass, "glVertexAttrib3fARB", gl_VertexAttrib3fARB, 4);
790
+ rb_define_method(klass, "glVertexAttrib3sARB", gl_VertexAttrib3sARB, 4);
791
+ rb_define_method(klass, "glVertexAttrib4NbvARB", gl_VertexAttrib4NbvARB, 2);
792
+ rb_define_method(klass, "glVertexAttrib4NivARB", gl_VertexAttrib4NivARB, 2);
793
+ rb_define_method(klass, "glVertexAttrib4NsvARB", gl_VertexAttrib4NsvARB, 2);
794
+ rb_define_method(klass, "glVertexAttrib4NubARB", gl_VertexAttrib4NubARB, 5);
795
+ rb_define_method(klass, "glVertexAttrib4NubvARB", gl_VertexAttrib4NubvARB, 2);
796
+ rb_define_method(klass, "glVertexAttrib4NuivARB", gl_VertexAttrib4NuivARB, 2);
797
+ rb_define_method(klass, "glVertexAttrib4NusvARB", gl_VertexAttrib4NusvARB, 2);
798
+ rb_define_method(klass, "glVertexAttrib4bvARB", gl_VertexAttrib4bvARB, 2);
799
+ rb_define_method(klass, "glVertexAttrib4dARB", gl_VertexAttrib4dARB, 5);
800
+ rb_define_method(klass, "glVertexAttrib4fARB", gl_VertexAttrib4fARB, 5);
801
+ rb_define_method(klass, "glVertexAttrib4ivARB", gl_VertexAttrib4ivARB, 2);
802
+ rb_define_method(klass, "glVertexAttrib4sARB", gl_VertexAttrib4sARB, 5);
803
+ rb_define_method(klass, "glVertexAttrib4ubvARB", gl_VertexAttrib4ubvARB, 2);
804
+ rb_define_method(klass, "glVertexAttrib4uivARB", gl_VertexAttrib4uivARB, 2);
805
+ rb_define_method(klass, "glVertexAttrib4usvARB", gl_VertexAttrib4usvARB, 2);
806
+ rb_define_method(klass, "glVertexAttrib1dvARB", gl_VertexAttrib1dvARB, 2);
807
+ rb_define_method(klass, "glVertexAttrib1fvARB", gl_VertexAttrib1fvARB, 2);
808
+ rb_define_method(klass, "glVertexAttrib1svARB", gl_VertexAttrib1svARB, 2);
809
+ rb_define_method(klass, "glVertexAttrib2dvARB", gl_VertexAttrib2dvARB, 2);
810
+ rb_define_method(klass, "glVertexAttrib2fvARB", gl_VertexAttrib2fvARB, 2);
811
+ rb_define_method(klass, "glVertexAttrib2svARB", gl_VertexAttrib2svARB, 2);
812
+ rb_define_method(klass, "glVertexAttrib3dvARB", gl_VertexAttrib3dvARB, 2);
813
+ rb_define_method(klass, "glVertexAttrib3fvARB", gl_VertexAttrib3fvARB, 2);
814
+ rb_define_method(klass, "glVertexAttrib3svARB", gl_VertexAttrib3svARB, 2);
815
+ rb_define_method(klass, "glVertexAttrib4dvARB", gl_VertexAttrib4dvARB, 2);
816
+ rb_define_method(klass, "glVertexAttrib4fvARB", gl_VertexAttrib4fvARB, 2);
817
+ rb_define_method(klass, "glVertexAttrib4svARB", gl_VertexAttrib4svARB, 2);
818
+ rb_define_method(klass, "glGetVertexAttribdvARB", gl_GetVertexAttribdvARB, 2);
819
+ rb_define_method(klass, "glGetVertexAttribfvARB", gl_GetVertexAttribfvARB, 2);
820
+ rb_define_method(klass, "glGetVertexAttribivARB", gl_GetVertexAttribivARB, 2);
816
821
 
817
822
  /* #29 GL_ARB_occlusion_query */
818
- rb_define_module_function(module, "glGenQueriesARB", gl_GenQueriesARB, 1);
819
- rb_define_module_function(module, "glDeleteQueriesARB", gl_DeleteQueriesARB, 1);
820
- rb_define_module_function(module, "glIsQueryARB", gl_IsQueryARB, 1);
821
- rb_define_module_function(module, "glBeginQueryARB", gl_BeginQueryARB, 2);
822
- rb_define_module_function(module, "glEndQueryARB", gl_EndQueryARB, 1);
823
- rb_define_module_function(module, "glGetQueryivARB", gl_GetQueryivARB, 2);
824
- rb_define_module_function(module, "glGetQueryObjectivARB", gl_GetQueryObjectivARB, 2);
825
- rb_define_module_function(module, "glGetQueryObjectuivARB", gl_GetQueryObjectuivARB, 2);
823
+ rb_define_method(klass, "glGenQueriesARB", gl_GenQueriesARB, 1);
824
+ rb_define_method(klass, "glDeleteQueriesARB", gl_DeleteQueriesARB, 1);
825
+ rb_define_method(klass, "glIsQueryARB", gl_IsQueryARB, 1);
826
+ rb_define_method(klass, "glBeginQueryARB", gl_BeginQueryARB, 2);
827
+ rb_define_method(klass, "glEndQueryARB", gl_EndQueryARB, 1);
828
+ rb_define_method(klass, "glGetQueryivARB", gl_GetQueryivARB, 2);
829
+ rb_define_method(klass, "glGetQueryObjectivARB", gl_GetQueryObjectivARB, 2);
830
+ rb_define_method(klass, "glGetQueryObjectuivARB", gl_GetQueryObjectuivARB, 2);
826
831
 
827
832
  /* #30 GL_ARB_shader_objects */
828
- rb_define_module_function(module, "glDeleteObjectARB", gl_DeleteObjectARB, 1);
829
- rb_define_module_function(module, "glGetHandleARB", gl_GetHandleARB, 1);
830
- rb_define_module_function(module, "glDetachObjectARB", gl_DetachObjectARB, 2);
831
- rb_define_module_function(module, "glCreateShaderObjectARB", gl_CreateShaderObjectARB, 1);
832
- rb_define_module_function(module, "glShaderSourceARB", gl_ShaderSourceARB, 2);
833
- rb_define_module_function(module, "glCompileShaderARB", gl_CompileShaderARB, 1);
834
- rb_define_module_function(module, "glCreateProgramObjectARB", gl_CreateProgramObjectARB, 0);
835
- rb_define_module_function(module, "glAttachObjectARB", gl_AttachObjectARB, 2);
836
- rb_define_module_function(module, "glLinkProgramARB", gl_LinkProgramARB, 1);
837
- rb_define_module_function(module, "glUseProgramObjectARB", gl_UseProgramObjectARB, 1);
838
- rb_define_module_function(module, "glValidateProgramARB", gl_ValidateProgramARB, 1);
839
- rb_define_module_function(module, "glUniform1fARB", gl_Uniform1fARB, 2);
840
- rb_define_module_function(module, "glUniform2fARB", gl_Uniform2fARB, 3);
841
- rb_define_module_function(module, "glUniform3fARB", gl_Uniform3fARB, 4);
842
- rb_define_module_function(module, "glUniform4fARB", gl_Uniform4fARB, 5);
843
- rb_define_module_function(module, "glUniform1iARB", gl_Uniform1iARB, 2);
844
- rb_define_module_function(module, "glUniform2iARB", gl_Uniform2iARB, 3);
845
- rb_define_module_function(module, "glUniform3iARB", gl_Uniform3iARB, 4);
846
- rb_define_module_function(module, "glUniform4iARB", gl_Uniform4iARB, 5);
847
- rb_define_module_function(module, "glUniform1fvARB", gl_Uniform1fvARB, 2);
848
- rb_define_module_function(module, "glUniform2fvARB", gl_Uniform2fvARB, 2);
849
- rb_define_module_function(module, "glUniform3fvARB", gl_Uniform3fvARB, 2);
850
- rb_define_module_function(module, "glUniform4fvARB", gl_Uniform4fvARB, 2);
851
- rb_define_module_function(module, "glUniform1ivARB", gl_Uniform1ivARB, 2);
852
- rb_define_module_function(module, "glUniform2ivARB", gl_Uniform2ivARB, 2);
853
- rb_define_module_function(module, "glUniform3ivARB", gl_Uniform3ivARB, 2);
854
- rb_define_module_function(module, "glUniform4ivARB", gl_Uniform4ivARB, 2);
855
- rb_define_module_function(module, "glUniformMatrix2fvARB", gl_UniformMatrix2fvARB, 3);
856
- rb_define_module_function(module, "glUniformMatrix3fvARB", gl_UniformMatrix3fvARB, 3);
857
- rb_define_module_function(module, "glUniformMatrix4fvARB", gl_UniformMatrix4fvARB, 3);
858
- rb_define_module_function(module, "glGetObjectParameterfvARB", gl_GetObjectParameterfvARB, 2);
859
- rb_define_module_function(module, "glGetObjectParameterivARB", gl_GetObjectParameterivARB, 2);
860
- rb_define_module_function(module, "glGetInfoLogARB", gl_GetInfoLogARB, 1);
861
- rb_define_module_function(module, "glGetShaderSourceARB", gl_GetShaderSourceARB, 1);
862
- rb_define_module_function(module, "glGetAttachedObjectsARB", gl_GetAttachedObjectsARB, 1);
863
- rb_define_module_function(module, "glGetUniformLocationARB", gl_GetUniformLocationARB, 2);
864
- rb_define_module_function(module, "glGetActiveUniformARB", gl_GetActiveUniformARB, 2);
865
- rb_define_module_function(module, "glGetUniformfvARB", gl_GetUniformfvARB, 2);
866
- rb_define_module_function(module, "glGetUniformivARB", gl_GetUniformivARB, 2);
833
+ rb_define_method(klass, "glDeleteObjectARB", gl_DeleteObjectARB, 1);
834
+ rb_define_method(klass, "glGetHandleARB", gl_GetHandleARB, 1);
835
+ rb_define_method(klass, "glDetachObjectARB", gl_DetachObjectARB, 2);
836
+ rb_define_method(klass, "glCreateShaderObjectARB", gl_CreateShaderObjectARB, 1);
837
+ rb_define_method(klass, "glShaderSourceARB", gl_ShaderSourceARB, 2);
838
+ rb_define_method(klass, "glCompileShaderARB", gl_CompileShaderARB, 1);
839
+ rb_define_method(klass, "glCreateProgramObjectARB", gl_CreateProgramObjectARB, 0);
840
+ rb_define_method(klass, "glAttachObjectARB", gl_AttachObjectARB, 2);
841
+ rb_define_method(klass, "glLinkProgramARB", gl_LinkProgramARB, 1);
842
+ rb_define_method(klass, "glUseProgramObjectARB", gl_UseProgramObjectARB, 1);
843
+ rb_define_method(klass, "glValidateProgramARB", gl_ValidateProgramARB, 1);
844
+ rb_define_method(klass, "glUniform1fARB", gl_Uniform1fARB, 2);
845
+ rb_define_method(klass, "glUniform2fARB", gl_Uniform2fARB, 3);
846
+ rb_define_method(klass, "glUniform3fARB", gl_Uniform3fARB, 4);
847
+ rb_define_method(klass, "glUniform4fARB", gl_Uniform4fARB, 5);
848
+ rb_define_method(klass, "glUniform1iARB", gl_Uniform1iARB, 2);
849
+ rb_define_method(klass, "glUniform2iARB", gl_Uniform2iARB, 3);
850
+ rb_define_method(klass, "glUniform3iARB", gl_Uniform3iARB, 4);
851
+ rb_define_method(klass, "glUniform4iARB", gl_Uniform4iARB, 5);
852
+ rb_define_method(klass, "glUniform1fvARB", gl_Uniform1fvARB, 2);
853
+ rb_define_method(klass, "glUniform2fvARB", gl_Uniform2fvARB, 2);
854
+ rb_define_method(klass, "glUniform3fvARB", gl_Uniform3fvARB, 2);
855
+ rb_define_method(klass, "glUniform4fvARB", gl_Uniform4fvARB, 2);
856
+ rb_define_method(klass, "glUniform1ivARB", gl_Uniform1ivARB, 2);
857
+ rb_define_method(klass, "glUniform2ivARB", gl_Uniform2ivARB, 2);
858
+ rb_define_method(klass, "glUniform3ivARB", gl_Uniform3ivARB, 2);
859
+ rb_define_method(klass, "glUniform4ivARB", gl_Uniform4ivARB, 2);
860
+ rb_define_method(klass, "glUniformMatrix2fvARB", gl_UniformMatrix2fvARB, 3);
861
+ rb_define_method(klass, "glUniformMatrix3fvARB", gl_UniformMatrix3fvARB, 3);
862
+ rb_define_method(klass, "glUniformMatrix4fvARB", gl_UniformMatrix4fvARB, 3);
863
+ rb_define_method(klass, "glGetObjectParameterfvARB", gl_GetObjectParameterfvARB, 2);
864
+ rb_define_method(klass, "glGetObjectParameterivARB", gl_GetObjectParameterivARB, 2);
865
+ rb_define_method(klass, "glGetInfoLogARB", gl_GetInfoLogARB, 1);
866
+ rb_define_method(klass, "glGetShaderSourceARB", gl_GetShaderSourceARB, 1);
867
+ rb_define_method(klass, "glGetAttachedObjectsARB", gl_GetAttachedObjectsARB, 1);
868
+ rb_define_method(klass, "glGetUniformLocationARB", gl_GetUniformLocationARB, 2);
869
+ rb_define_method(klass, "glGetActiveUniformARB", gl_GetActiveUniformARB, 2);
870
+ rb_define_method(klass, "glGetUniformfvARB", gl_GetUniformfvARB, 2);
871
+ rb_define_method(klass, "glGetUniformivARB", gl_GetUniformivARB, 2);
867
872
 
868
873
  /* #31 GL_ARB_vertex_shader */
869
- rb_define_module_function(module, "glBindAttribLocationARB", gl_BindAttribLocationARB, 3);
870
- rb_define_module_function(module, "glGetActiveAttribARB", gl_GetActiveAttribARB, 2);
871
- rb_define_module_function(module, "glGetAttribLocationARB", gl_GetAttribLocationARB, 2);
874
+ rb_define_method(klass, "glBindAttribLocationARB", gl_BindAttribLocationARB, 3);
875
+ rb_define_method(klass, "glGetActiveAttribARB", gl_GetActiveAttribARB, 2);
876
+ rb_define_method(klass, "glGetAttribLocationARB", gl_GetAttribLocationARB, 2);
872
877
 
873
878
  /* #39 GL_ARB_color_buffer_float */
874
- rb_define_module_function(module, "glClampColorARB", gl_ClampColorARB, 2);
879
+ rb_define_method(klass, "glClampColorARB", gl_ClampColorARB, 2);
875
880
  }