ruby-opengl2 0.60.3 → 0.60.4

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -60,7 +60,7 @@ task :test_all => [:test]
60
60
  # common specification for source and binary gems
61
61
  spec = Gem::Specification.new do |s|
62
62
  s.name = "ruby-opengl2"
63
- s.version = "0.60.3"
63
+ s.version = "0.60.4"
64
64
  s.authors = [ "Alain Hoang", "Jan Dvorak", "Minh Thu Vo", "James Adam", "Paolo Bosetti" ]
65
65
  s.homepage = "http://github.com/pbosetti/ruby-opengl"
66
66
  s.email = "p4010@me.com"
@@ -72,6 +72,19 @@ spec = Gem::Specification.new do |s|
72
72
  s.has_rdoc = false
73
73
  s.files = FileList["{lib,ext,examples,test}/**/*"]
74
74
  s.extensions = ['Rakefile']
75
+
76
+ if s.respond_to? :specification_version then
77
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
78
+ s.specification_version = 3
79
+
80
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
81
+ s.add_runtime_dependency(%q<mkrf>, [">= 0.2.3"])
82
+ else
83
+ s.add_dependency(%q<mkrf>, [">= 0.2.3"])
84
+ end
85
+ else
86
+ s.add_dependency(%q<mkrf>, [">= 0.2.3"])
87
+ end
75
88
  end
76
89
 
77
90
  # Create a task for creating a ruby source gem
@@ -125,7 +125,7 @@ cond_GLBOOL2RUBY_FUNC(cond_GLBOOL2RUBY_D,GLdouble,rb_float_new)
125
125
  static inline int ary2c##_type_( arg, cary, maxlen ) \
126
126
  VALUE arg; \
127
127
  GL##_type_ cary[]; \
128
- int maxlen; \
128
+ long maxlen; \
129
129
  { \
130
130
  int i; \
131
131
  VALUE ary = rb_Array(arg); \
@@ -206,7 +206,7 @@ static VALUE gl_##_name_(VALUE obj,VALUE arg1) \
206
206
  GLsizei n; \
207
207
  GLuint *objects; \
208
208
  VALUE ret; \
209
- unsigned int i; \
209
+ GLsizei i; \
210
210
  LOAD_GL_FUNC(gl##_name_,_ver_) \
211
211
  n = CONV_GLsizei(arg1); \
212
212
  objects = ALLOC_N(GLuint, n); \
@@ -245,7 +245,7 @@ static VALUE gl_##_name_(VALUE obj,VALUE arg1) \
245
245
  LOAD_GL_FUNC(gl##_name_,_ver_) \
246
246
  if (TYPE(arg1)==T_ARRAY) { \
247
247
  GLuint *objects; \
248
- n = RARRAY_LEN(arg1); \
248
+ n = (GLsizei)RARRAY_LEN(arg1); \
249
249
  objects = ALLOC_N(GLuint,n); \
250
250
  ary2cuint(arg1,objects,n); \
251
251
  fptr_gl##_name_(n,objects); \
@@ -265,7 +265,7 @@ static VALUE gl_##_name_(VALUE obj,VALUE arg1) \
265
265
  GLsizei n; \
266
266
  if (TYPE(arg1)==T_ARRAY) { \
267
267
  GLuint *objects; \
268
- n = RARRAY_LEN(arg1); \
268
+ n = (GLsizei)RARRAY_LEN(arg1); \
269
269
  objects = ALLOC_N(GLuint,n); \
270
270
  ary2cuint(arg1,objects,n); \
271
271
  gl##_name_(n,objects); \
@@ -0,0 +1,43 @@
1
+ # Generated by mkrf
2
+ require 'rake/clean'
3
+
4
+ CLEAN.include('*.o')
5
+ CLOBBER.include('gl.bundle', 'mkrf.log')
6
+
7
+ SRC = FileList['*.c']
8
+ OBJ = SRC.ext('o')
9
+ CC = 'clang'
10
+
11
+ ADDITIONAL_OBJECTS = ''
12
+
13
+ LDSHARED = "clang -dynamic -bundle -framework OpenGL"
14
+
15
+ LIBPATH = "-L/Users/p4010/.rvm/rubies/ruby-1.9.3-p194/lib "
16
+
17
+ INCLUDES = "-I/Users/p4010/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1 -I/Users/p4010/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/x86_64-darwin12.0.0 -I/Users/p4010/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/x86_64-darwin12.0.0 -I/Users/p4010/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1 -I."
18
+
19
+ LIBS = "-lpthread -ldl -lobjc"
20
+
21
+ CFLAGS = "-fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=shorten-64-to-32 -Werror=implicit-function-declaration -fno-common -pipe -DRUBY_VERSION=193 "
22
+
23
+ RUBYARCHDIR = "#{ENV["RUBYARCHDIR"]}"
24
+ LIBRUBYARG_SHARED = "-lruby.1.9.1"
25
+
26
+ task :default => ['gl.bundle']
27
+
28
+ rule '.o' => '.c' do |t|
29
+ sh "#{CC} #{CFLAGS} #{INCLUDES} -c #{t.source}"
30
+ end
31
+
32
+ desc "Build this extension"
33
+ file 'gl.bundle' => OBJ do
34
+ sh "#{LDSHARED} #{LIBPATH} -o gl.bundle #{OBJ} #{ADDITIONAL_OBJECTS} #{LIBS} #{LIBRUBYARG_SHARED}"
35
+ end
36
+
37
+ desc "Install this extension"
38
+ task :install => 'gl.bundle' do
39
+ makedirs "#{RUBYARCHDIR}"
40
+ install "gl.bundle", "#{RUBYARCHDIR}"
41
+ end
42
+
43
+
@@ -235,7 +235,7 @@ VALUE obj,arg1,arg2;
235
235
  VALUE lists;
236
236
  type = CONV_GLenum(arg1);
237
237
  lists = pack_array_or_pass_string(type,arg2);
238
- n = RSTRING_LEN(lists) / gltype_glformat_unit_size(type,1);
238
+ n = (GLsizei)RSTRING_LEN(lists) / gltype_glformat_unit_size(type,1);
239
239
  glCallLists(n, type, RSTRING_PTR(lists));
240
240
  CHECK_GLERROR
241
241
  return Qnil;
@@ -902,7 +902,7 @@ VALUE obj; \
902
902
  rb_raise(rb_eArgError, "Pixel unpack buffer bound, but offset argument missing"); \
903
903
  map = (GLenum)NUM2INT(args[0]); \
904
904
  Check_Type(args[1],T_ARRAY); \
905
- size = RARRAY_LEN(args[1]); \
905
+ size = (GLsizei)RARRAY_LEN(args[1]); \
906
906
  values = ALLOC_N(_vartype_,size); \
907
907
  _convert_(args[1],values,size); \
908
908
  glPixelMap##_type_##v(map,size,values); \
@@ -946,8 +946,8 @@ VALUE obj;
946
946
  y = (GLint)NUM2INT(args[1]);
947
947
  width = (GLsizei)NUM2UINT(args[2]);
948
948
  height = (GLsizei)NUM2UINT(args[3]);
949
- format = NUM2INT(args[4]);
950
- type = NUM2INT(args[5]);
949
+ format = (int)NUM2INT(args[4]);
950
+ type = (int)NUM2INT(args[5]);
951
951
 
952
952
  switch(numargs) {
953
953
  default:
@@ -1026,7 +1026,7 @@ VALUE obj,arg1; \
1026
1026
  VALUE ary, ary2; \
1027
1027
  int i,j; \
1028
1028
  _type_ items[64]; \
1029
- pname = NUM2INT(arg1); \
1029
+ pname = (GLenum)NUM2INT(arg1); \
1030
1030
  switch(pname) { \
1031
1031
  case GL_ACCUM_CLEAR_VALUE: \
1032
1032
  case GL_BLEND_COLOR: \
@@ -1985,7 +1985,7 @@ VALUE obj,arg1;
1985
1985
  VALUE ary;
1986
1986
  int i;
1987
1987
  ary = rb_Array(arg1);
1988
- size = RARRAY_LEN(ary);
1988
+ size = (GLsizei)RARRAY_LEN(ary);
1989
1989
  textures = ALLOC_N(GLuint,size);
1990
1990
  residences = ALLOC_N(GLboolean,size);
1991
1991
  ary2cuint(ary,textures,size);
@@ -2016,7 +2016,7 @@ VALUE obj,arg1,arg2;
2016
2016
  GLsizei size;
2017
2017
  Check_Type(arg1,T_ARRAY);
2018
2018
  Check_Type(arg2,T_ARRAY);
2019
- if ((size = RARRAY_LEN(arg1)) != RARRAY_LEN(arg2))
2019
+ if ((size = (GLsizei)RARRAY_LEN(arg1)) != RARRAY_LEN(arg2))
2020
2020
  rb_raise(rb_eArgError, "passed arrays must have the same length");
2021
2021
  textures = ALLOC_N(GLuint,size);
2022
2022
  priorities = ALLOC_N(GLclampf,size);
Binary file
Binary file
Binary file
@@ -102,8 +102,8 @@ VALUE obj,arg1,arg2,arg3;
102
102
  GLsizei *ary2;
103
103
  int len1,len2;
104
104
  LOAD_GL_FUNC(glMultiDrawArrays,"1.4")
105
- len1 = RARRAY_LEN(arg2);
106
- len2 = RARRAY_LEN(arg3);
105
+ len1 = (int)RARRAY_LEN(arg2);
106
+ len2 = (int)RARRAY_LEN(arg3);
107
107
  if (len1!=len2)
108
108
  rb_raise(rb_eArgError, "Passed arrays must have same length");
109
109
  mode = (GLenum)NUM2INT(arg1);
@@ -142,14 +142,14 @@ VALUE obj;
142
142
  type = (GLenum)NUM2INT(args[1]);
143
143
  Check_Type(args[2],T_ARRAY);
144
144
  ary = args[2];
145
- size = RARRAY_LEN(ary);
145
+ size = (GLint)RARRAY_LEN(ary);
146
146
  counts = ALLOC_N(GLsizei,size);
147
147
  indices = ALLOC_N(GLvoid*,size);
148
148
  for (i=0;i<size;i++) {
149
149
  VALUE data;
150
150
  data = pack_array_or_pass_string(type,RARRAY_PTR(ary)[i]);
151
151
  indices[i] = RSTRING_PTR(data);
152
- counts[i] = RSTRING_LEN(data);
152
+ counts[i] = (GLsizei)RSTRING_LEN(data);
153
153
  }
154
154
  fptr_glMultiDrawElements(mode,counts,type,indices,size);
155
155
  xfree(counts);
@@ -165,12 +165,12 @@ VALUE obj;
165
165
  if (RARRAY_LEN(args[2]) != RARRAY_LEN(args[3]))
166
166
  rb_raise(rb_eArgError, "Count and indices offset array must have same length");
167
167
 
168
- size = RARRAY_LEN(args[2]);
168
+ size = (GLint)RARRAY_LEN(args[2]);
169
169
 
170
170
  counts = ALLOC_N(GLsizei,size);
171
171
  indices = ALLOC_N(GLvoid*,size);
172
172
  for (i=0;i<size;i++) {
173
- counts[i] = NUM2INT(rb_ary_entry(args[2],i));
173
+ counts[i] = (GLsizei)NUM2INT(rb_ary_entry(args[2],i));
174
174
  indices[i] = (GLvoid *) NUM2INT(rb_ary_entry(args[3],i));
175
175
  }
176
176
  fptr_glMultiDrawElements(mode,counts,type,indices,size);
Binary file
@@ -129,7 +129,7 @@ VALUE obj,arg1,arg2,arg3;
129
129
  target = (GLenum)NUM2INT(arg1);
130
130
  offset = (GLintptr)NUM2INT(arg2);
131
131
  size = (GLsizeiptr)NUM2INT(arg3);
132
- data = allocate_buffer_with_string(size);
132
+ data = allocate_buffer_with_string((int)size);
133
133
  fptr_glGetBufferSubData(target,offset,size,(GLvoid *)RSTRING_PTR(data));
134
134
  CHECK_GLERROR
135
135
  return data;
Binary file
@@ -64,7 +64,7 @@ VALUE obj,arg1;
64
64
  GLenum *buffers;
65
65
  LOAD_GL_FUNC(glDrawBuffers,"2.0")
66
66
  Check_Type(arg1,T_ARRAY);
67
- size = RARRAY_LEN(arg1);
67
+ size = (GLsizei)RARRAY_LEN(arg1);
68
68
  buffers = ALLOC_N(GLenum,size);
69
69
  ary2cuint(arg1,buffers,size);
70
70
  fptr_glDrawBuffers(size,buffers);
@@ -413,7 +413,7 @@ VALUE obj,arg1,arg2;
413
413
  shader = (GLuint)NUM2UINT(arg1);
414
414
  Check_Type(arg2,T_STRING);
415
415
  str = RSTRING_PTR(arg2);
416
- length = RSTRING_LEN(arg2);
416
+ length = (GLint)RSTRING_LEN(arg2);
417
417
  fptr_glShaderSource(shader,1,&str,&length);
418
418
  CHECK_GLERROR
419
419
  return Qnil;
@@ -430,7 +430,7 @@ VALUE obj,arg1,arg2; \
430
430
  _type_ *value; \
431
431
  LOAD_GL_FUNC(gl##_name_,"2.0") \
432
432
  Check_Type(arg2,T_ARRAY); \
433
- count = RARRAY_LEN(arg2); \
433
+ count = (GLsizei)RARRAY_LEN(arg2); \
434
434
  if (count<=0 || (count % _size_) != 0) \
435
435
  rb_raise(rb_eArgError, "Parameter array size must be multiplication of %i",_size_); \
436
436
  location = (GLint)NUM2INT(arg1); \
@@ -464,7 +464,7 @@ VALUE obj,arg1,arg2,arg3; \
464
464
  GLfloat *value; \
465
465
  LOAD_GL_FUNC(gl##_name_,"2.0") \
466
466
  location = (GLint)NUM2INT(arg1); \
467
- count = RARRAY_LEN(rb_funcall(rb_Array(arg3),rb_intern("flatten"),0)); \
467
+ count = (GLsizei)RARRAY_LEN(rb_funcall(rb_Array(arg3),rb_intern("flatten"),0)); \
468
468
  transpose = (GLboolean)NUM2INT(arg2); \
469
469
  value = ALLOC_N(GLfloat, count); \
470
470
  ary2cmatfloatcount(arg3,value,_size_,_size_); \
Binary file
@@ -27,7 +27,7 @@ VALUE obj,arg1,arg2,arg3; \
27
27
  GLfloat *value; \
28
28
  LOAD_GL_FUNC(glUniformMatrix##_x_##x##_y_##fv,"2.1") \
29
29
  location = (GLint)NUM2INT(arg1); \
30
- count = RARRAY_LEN(rb_funcall(rb_Array(arg3),rb_intern("flatten"),0)); \
30
+ count = (GLsizei)RARRAY_LEN(rb_funcall(rb_Array(arg3),rb_intern("flatten"),0)); \
31
31
  transpose = (GLboolean)NUM2INT(arg2); \
32
32
  value = ALLOC_N(GLfloat, count); \
33
33
  ary2cmatfloatcount(arg3,value, _x_, _y_); \
Binary file
Binary file
Binary file
Binary file
@@ -52,7 +52,7 @@ static VALUE gl_PointParameterfvARB(VALUE obj,VALUE arg1,VALUE arg2)
52
52
  GLenum pname;
53
53
  GLint size;
54
54
  LOAD_GL_FUNC(glPointParameterfvARB,"GL_ARB_point_parameters")
55
- pname = NUM2UINT(arg1);
55
+ pname = (GLenum)NUM2UINT(arg1);
56
56
  Check_Type(arg2,T_ARRAY);
57
57
  if (pname==GL_POINT_DISTANCE_ATTENUATION)
58
58
  size = 3;
@@ -106,7 +106,7 @@ static VALUE gl_ProgramStringARB(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3)
106
106
  {
107
107
  LOAD_GL_FUNC(glProgramStringARB,"GL_ARB_vertex_program")
108
108
  Check_Type(arg3,T_STRING);
109
- fptr_glProgramStringARB(NUM2INT(arg1),NUM2INT(arg2),RSTRING_LEN(arg3),RSTRING_PTR(arg3));
109
+ fptr_glProgramStringARB((GLenum)NUM2INT(arg1),(GLenum)NUM2INT(arg2),(GLsizei)RSTRING_LEN(arg3),RSTRING_PTR(arg3));
110
110
  CHECK_GLERROR
111
111
  return Qnil;
112
112
  }
@@ -116,9 +116,9 @@ static VALUE gl_GetProgramivARB(VALUE obj,VALUE arg1,VALUE arg2)
116
116
  {
117
117
  GLint ret = 0;
118
118
  LOAD_GL_FUNC(glGetProgramivARB,"GL_ARB_vertex_program")
119
- fptr_glGetProgramivARB(NUM2INT(arg1),NUM2INT(arg2),&ret);
119
+ fptr_glGetProgramivARB((GLenum)NUM2INT(arg1),(GLenum)NUM2INT(arg2),&ret);
120
120
  CHECK_GLERROR
121
- return cond_GLBOOL2RUBY(NUM2INT(arg2),ret);
121
+ return cond_GLBOOL2RUBY((GLenum)NUM2INT(arg2),ret);
122
122
  }
123
123
 
124
124
  static void (APIENTRY * fptr_glGetProgramStringARB)(GLenum,GLenum,void *string);
@@ -131,14 +131,14 @@ static VALUE gl_GetProgramStringARB(VALUE obj,VALUE arg1,VALUE arg2)
131
131
  LOAD_GL_FUNC(glGetProgramStringARB,"GL_ARB_vertex_program")
132
132
  LOAD_GL_FUNC(glGetProgramivARB,"GL_ARB_vertex_program")
133
133
 
134
- fptr_glGetProgramivARB(NUM2INT(arg1),GL_PROGRAM_LENGTH_ARB,&len);
134
+ fptr_glGetProgramivARB((GLenum)NUM2INT(arg1),GL_PROGRAM_LENGTH_ARB,&len);
135
135
  CHECK_GLERROR
136
136
  if (len<=0)
137
137
  return rb_str_new2("");
138
138
 
139
139
  buffer = ALLOC_N(GLchar,len+1);
140
140
  memset(buffer,0,sizeof(GLchar) * (len+1));
141
- fptr_glGetProgramStringARB(NUM2INT(arg1),NUM2INT(arg2),buffer);
141
+ fptr_glGetProgramStringARB((GLenum)NUM2INT(arg1),(GLenum)NUM2INT(arg2),buffer);
142
142
  ret_buffer = rb_str_new2(buffer);
143
143
  xfree(buffer);
144
144
 
@@ -218,7 +218,7 @@ VALUE obj,arg1,arg2,arg3; \
218
218
  _type_ cary[4]; \
219
219
  LOAD_GL_FUNC(gl##_name_,_extension_) \
220
220
  _conv_(arg3,cary,4); \
221
- fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),cary); \
221
+ fptr_gl##_name_((GLenum)NUM2UINT(arg1),(GLuint)NUM2UINT(arg2),cary); \
222
222
  CHECK_GLERROR \
223
223
  return Qnil; \
224
224
  }
@@ -237,7 +237,7 @@ VALUE obj,arg1,arg2; \
237
237
  { \
238
238
  _type_ cary[4] = {0.0,0.0,0.0,0.0}; \
239
239
  LOAD_GL_FUNC(gl##_name_,_extension_) \
240
- fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),cary); \
240
+ fptr_gl##_name_((GLenum)NUM2UINT(arg1),(GLuint)NUM2UINT(arg2),cary); \
241
241
  RET_ARRAY_OR_SINGLE(4,RETCONV_##_type_,cary) \
242
242
  }
243
243
 
@@ -363,9 +363,9 @@ static VALUE gl_##_name_(VALUE obj,VALUE arg1,VALUE arg2) \
363
363
  { \
364
364
  _type_ ret = 0; \
365
365
  LOAD_GL_FUNC(gl##_name_,"GL_ARB_occlusion_query") \
366
- fptr_gl##_name_(NUM2INT(arg1),NUM2INT(arg2),&ret); \
366
+ fptr_gl##_name_((GLuint)NUM2INT(arg1),(GLenum)NUM2INT(arg2),&ret); \
367
367
  CHECK_GLERROR \
368
- return _conv_(NUM2INT(arg2),ret); \
368
+ return _conv_((GLenum)NUM2INT(arg2),ret); \
369
369
  }
370
370
 
371
371
  GETQUERY_FUNC(GetQueryivARB,GLint,cond_GLBOOL2RUBY)
@@ -397,7 +397,7 @@ VALUE obj,arg1,arg2;
397
397
  shader = (GLuint)NUM2UINT(arg1);
398
398
  Check_Type(arg2,T_STRING);
399
399
  str = RSTRING_PTR(arg2);
400
- length = RSTRING_LEN(arg2);
400
+ length = (GLint)RSTRING_LEN(arg2);
401
401
  fptr_glShaderSourceARB(shader,1,&str,&length);
402
402
  CHECK_GLERROR
403
403
  return Qnil;
@@ -423,7 +423,7 @@ VALUE obj,arg1,arg2; \
423
423
  _type_ *value; \
424
424
  LOAD_GL_FUNC(gl##_name_,"GL_ARB_shader_objects") \
425
425
  Check_Type(arg2,T_ARRAY); \
426
- count = RARRAY_LEN(arg2); \
426
+ count = (GLsizei)RARRAY_LEN(arg2); \
427
427
  if (count<=0 || (count % _size_) != 0) \
428
428
  rb_raise(rb_eArgError, "Parameter array size must be multiplication of %i",_size_); \
429
429
  location = (GLint)NUM2INT(arg1); \
@@ -457,7 +457,7 @@ VALUE obj,arg1,arg2,arg3; \
457
457
  GLfloat *value; \
458
458
  LOAD_GL_FUNC(gl##_name_,"GL_ARB_shader_objects") \
459
459
  location = (GLint)NUM2INT(arg1); \
460
- count = RARRAY_LEN(rb_funcall(rb_Array(arg3),rb_intern("flatten"),0)); \
460
+ count = (GLsizei)RARRAY_LEN(rb_funcall(rb_Array(arg3),rb_intern("flatten"),0)); \
461
461
  transpose = (GLboolean)NUM2INT(arg2); \
462
462
  value = ALLOC_N(GLfloat, count); \
463
463
  ary2cmatfloatcount(arg3,value,_size_,_size_); \
Binary file
@@ -25,7 +25,7 @@ static VALUE gl_DrawBuffersATI(VALUE obj,VALUE arg1)
25
25
  GLenum *buffers;
26
26
  LOAD_GL_FUNC(glDrawBuffersATI,"GL_ATI_draw_buffers")
27
27
  Check_Type(arg1,T_ARRAY);
28
- size = RARRAY_LEN(arg1);
28
+ size = (GLsizei)RARRAY_LEN(arg1);
29
29
  buffers = ALLOC_N(GLenum,size);
30
30
  ary2cuint(arg1,buffers,size);
31
31
  fptr_glDrawBuffersATI(size,buffers);
Binary file
@@ -41,7 +41,7 @@ VALUE obj,arg1,arg2;
41
41
  LOAD_GL_FUNC(glPrioritizeTexturesEXT,"GL_EXT_texture_object")
42
42
  Check_Type(arg1,T_ARRAY);
43
43
  Check_Type(arg2,T_ARRAY);
44
- if ((size = RARRAY_LEN(arg1)) != RARRAY_LEN(arg2))
44
+ if ((size = (GLsizei)RARRAY_LEN(arg1)) != (GLsizei)RARRAY_LEN(arg2))
45
45
  rb_raise(rb_eArgError, "passed arrays must have the same length");
46
46
  textures = ALLOC_N(GLuint,size);
47
47
  priorities = ALLOC_N(GLclampf,size);
@@ -68,7 +68,7 @@ VALUE obj,arg1;
68
68
  int i;
69
69
  LOAD_GL_FUNC(glAreTexturesResidentEXT,"GL_EXT_texture_object")
70
70
  ary = rb_Array(arg1);
71
- size = RARRAY_LEN(ary);
71
+ size = (GLsizei)RARRAY_LEN(ary);
72
72
  textures = ALLOC_N(GLuint,size);
73
73
  residences = ALLOC_N(GLboolean,size);
74
74
  ary2cuint(ary,textures,size);
@@ -102,7 +102,7 @@ static VALUE gl_PointParameterfvEXT(VALUE obj,VALUE arg1,VALUE arg2)
102
102
  GLenum pname;
103
103
  GLint size;
104
104
  LOAD_GL_FUNC(glPointParameterfvEXT,"GL_EXT_point_parameters")
105
- pname = NUM2UINT(arg1);
105
+ pname = (GLenum)NUM2UINT(arg1);
106
106
  Check_Type(arg2,T_ARRAY);
107
107
  if (pname==GL_POINT_DISTANCE_ATTENUATION)
108
108
  size = 3;
@@ -215,7 +215,7 @@ VALUE obj,arg1,arg2,arg3;
215
215
  GLenum mode;
216
216
  GLint *ary1;
217
217
  GLsizei *ary2;
218
- int len1,len2;
218
+ long len1,len2;
219
219
  LOAD_GL_FUNC(glMultiDrawArraysEXT,"GL_EXT_multi_draw_arrays")
220
220
  len1 = RARRAY_LEN(arg2);
221
221
  len2 = RARRAY_LEN(arg3);
@@ -226,7 +226,7 @@ VALUE obj,arg1,arg2,arg3;
226
226
  ary2 = ALLOC_N(GLsizei,len2);
227
227
  ary2cint(arg2,ary1,len1);
228
228
  ary2cint(arg3,ary2,len2);
229
- fptr_glMultiDrawArraysEXT(mode,ary1,ary2,len1);
229
+ fptr_glMultiDrawArraysEXT(mode,ary1,ary2,(GLsizei)len1);
230
230
  xfree(ary1);
231
231
  xfree(ary2);
232
232
  CHECK_GLERROR
@@ -257,7 +257,7 @@ VALUE obj;
257
257
  type = (GLenum)NUM2INT(args[1]);
258
258
  Check_Type(args[2],T_ARRAY);
259
259
  ary = args[2];
260
- size = RARRAY_LEN(ary);
260
+ size = (GLint)RARRAY_LEN(ary);
261
261
  counts = ALLOC_N(GLsizei,size);
262
262
  indices = ALLOC_N(GLvoid*,size);
263
263
  for (i=0;i<size;i++) {
@@ -265,7 +265,7 @@ VALUE obj;
265
265
  data = pack_array_or_pass_string(type,RARRAY_PTR(ary)[i]);
266
266
 
267
267
  indices[i] = RSTRING_PTR(data);
268
- counts[i] = RSTRING_LEN(data);
268
+ counts[i] = (GLsizei)RSTRING_LEN(data);
269
269
  }
270
270
  fptr_glMultiDrawElementsEXT(mode,counts,type,indices,size);
271
271
  xfree(counts);
@@ -281,12 +281,12 @@ VALUE obj;
281
281
  if (RARRAY_LEN(args[2]) != RARRAY_LEN(args[3]))
282
282
  rb_raise(rb_eArgError, "Count and indices offset array must have same length");
283
283
 
284
- size = RARRAY_LEN(args[2]);
284
+ size = (GLint)RARRAY_LEN(args[2]);
285
285
 
286
286
  counts = ALLOC_N(GLsizei,size);
287
287
  indices = ALLOC_N(GLvoid*,size);
288
288
  for (i=0;i<size;i++) {
289
- counts[i] = NUM2INT(rb_ary_entry(args[2],i));
289
+ counts[i] = (GLsizei)NUM2INT(rb_ary_entry(args[2],i));
290
290
  indices[i] = (GLvoid *) NUM2INT(rb_ary_entry(args[3],i));
291
291
  }
292
292
  fptr_glMultiDrawElementsEXT(mode,counts,type,indices,size);
@@ -367,7 +367,7 @@ static VALUE gl_GetRenderbufferParameterivEXT(VALUE obj,VALUE arg1,VALUE arg2)
367
367
  {
368
368
  GLint param = 0;
369
369
  LOAD_GL_FUNC(glGetRenderbufferParameterivEXT,"GL_EXT_framebuffer_object")
370
- fptr_glGetRenderbufferParameterivEXT(NUM2UINT(arg1),NUM2UINT(arg2),&param);
370
+ fptr_glGetRenderbufferParameterivEXT((GLenum)NUM2UINT(arg1),(GLenum)NUM2UINT(arg2),&param);
371
371
  CHECK_GLERROR
372
372
  return INT2NUM(param);
373
373
  }
@@ -388,9 +388,9 @@ static VALUE gl_GetFramebufferAttachmentParameterivEXT(VALUE obj,VALUE arg1, VAL
388
388
  {
389
389
  GLint ret = 0;
390
390
  LOAD_GL_FUNC(glGetFramebufferAttachmentParameterivEXT,"GL_EXT_framebuffer_object")
391
- fptr_glGetFramebufferAttachmentParameterivEXT(NUM2UINT(arg1),NUM2UINT(arg2),NUM2UINT(arg3),&ret);
391
+ fptr_glGetFramebufferAttachmentParameterivEXT((GLenum)NUM2UINT(arg1),(GLenum)NUM2UINT(arg2),(GLenum)NUM2UINT(arg3),&ret);
392
392
  CHECK_GLERROR
393
- return cond_GLBOOL2RUBY(NUM2UINT(arg3),ret);
393
+ return cond_GLBOOL2RUBY((GLenum)NUM2UINT(arg3),ret);
394
394
  }
395
395
 
396
396
  GL_FUNC_LOAD_1(GenerateMipmapEXT,GLvoid, GLenum, "GL_EXT_framebuffer_object")
@@ -412,9 +412,9 @@ static VALUE gl_##_name_(VALUE obj,VALUE arg1,VALUE arg2) \
412
412
  { \
413
413
  _type_ ret = 0; \
414
414
  LOAD_GL_FUNC(gl##_name_,"GL_EXT_timer_query") \
415
- fptr_gl##_name_(NUM2INT(arg1),NUM2INT(arg2),&ret); \
415
+ fptr_gl##_name_((GLuint)NUM2INT(arg1),(GLenum)NUM2INT(arg2),&ret); \
416
416
  CHECK_GLERROR \
417
- return _conv_(NUM2INT(arg2),ret); \
417
+ return _conv_((GLenum)NUM2INT(arg2),ret); \
418
418
  }
419
419
 
420
420
  GETQUERY_FUNC(GetQueryObjecti64vEXT,GLint64EXT,cond_GLBOOL2RUBY_LL)
@@ -430,14 +430,14 @@ gl_##_name_(obj,arg1,arg2,arg3) \
430
430
  VALUE obj,arg1,arg2,arg3; \
431
431
  { \
432
432
  _type_ *cary; \
433
- int len; \
433
+ long len; \
434
434
  LOAD_GL_FUNC(gl##_name_,_extension_) \
435
435
  len = RARRAY_LEN(rb_Array(arg3)); \
436
436
  if (len<=0 || (len % 4) != 0) \
437
437
  rb_raise(rb_eArgError, "Parameter array size must be multiplication of 4"); \
438
438
  cary = ALLOC_N(_type_,len); \
439
439
  _conv_(arg3,cary,len); \
440
- fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),len / 4, cary); \
440
+ fptr_gl##_name_((GLenum)NUM2UINT(arg1),(GLuint)NUM2UINT(arg2),len / 4, cary); \
441
441
  xfree(cary); \
442
442
  CHECK_GLERROR \
443
443
  return Qnil; \
@@ -469,7 +469,7 @@ VALUE obj,arg1,arg2; \
469
469
  _type_ value[_size_]; \
470
470
  LOAD_GL_FUNC(gl##_name_,"GL_ARB_shader_objects") \
471
471
  _conv_(arg2,value,_size_); \
472
- fptr_gl##_name_(NUM2UINT(arg1),value); \
472
+ fptr_gl##_name_((GLuint)NUM2UINT(arg1),value); \
473
473
  CHECK_GLERROR \
474
474
  return Qnil; \
475
475
  }
@@ -563,7 +563,7 @@ VALUE obj,arg1,arg2; \
563
563
  _type_ *value; \
564
564
  LOAD_GL_FUNC(gl##_name_,"GL_EXT_gpu_shader4") \
565
565
  Check_Type(arg2,T_ARRAY); \
566
- count = RARRAY_LEN(arg2); \
566
+ count = (GLsizei)RARRAY_LEN(arg2); \
567
567
  if (count<=0 || (count % _size_) != 0) \
568
568
  rb_raise(rb_eArgError, "Parameter array size must be multiplication of %i",_size_); \
569
569
  location = (GLint)NUM2INT(arg1); \
@@ -620,7 +620,7 @@ static VALUE gl_BindFragDataLocationEXT(VALUE obj,VALUE arg1,VALUE arg2,VALUE ar
620
620
  {
621
621
  LOAD_GL_FUNC(glBindFragDataLocationEXT,"GL_EXT_gpu_shader4")
622
622
  Check_Type(arg3,T_STRING);
623
- fptr_glBindFragDataLocationEXT(NUM2UINT(arg1),NUM2UINT(arg2),RSTRING_PTR(arg3));
623
+ fptr_glBindFragDataLocationEXT((GLuint)NUM2UINT(arg1),(GLuint)NUM2UINT(arg2),RSTRING_PTR(arg3));
624
624
  CHECK_GLERROR
625
625
  return Qnil;
626
626
  }
@@ -631,7 +631,7 @@ static VALUE gl_GetFragDataLocationEXT(VALUE obj,VALUE arg1,VALUE arg2)
631
631
  GLint ret;
632
632
  LOAD_GL_FUNC(glGetFragDataLocationEXT,"GL_EXT_gpu_shader4")
633
633
  Check_Type(arg2,T_STRING);
634
- ret = fptr_glGetFragDataLocationEXT(NUM2UINT(arg1),RSTRING_PTR(arg2));
634
+ ret = fptr_glGetFragDataLocationEXT((GLuint)NUM2UINT(arg1),RSTRING_PTR(arg2));
635
635
  CHECK_GLERROR
636
636
  return INT2NUM(ret);
637
637
  }