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.
Binary file
@@ -23,7 +23,7 @@ static VALUE gl_StringMarkerGREMEDY(VALUE obj,VALUE arg1)
23
23
  {
24
24
  LOAD_GL_FUNC(glStringMarkerGREMEDY,"GL_GREMEDY_string_marker")
25
25
  Check_Type(arg1,T_STRING);
26
- fptr_glStringMarkerGREMEDY(RSTRING_LEN(arg1),RSTRING_PTR(arg1));
26
+ fptr_glStringMarkerGREMEDY((GLsizei)RSTRING_LEN(arg1),RSTRING_PTR(arg1));
27
27
  CHECK_GLERROR
28
28
  return Qnil;
29
29
  }
Binary file
@@ -30,9 +30,9 @@ static VALUE gl_GetFenceivNV(VALUE obj,VALUE arg1,VALUE arg2)
30
30
  {
31
31
  GLint ret = 0;
32
32
  LOAD_GL_FUNC(glGetFenceivNV,"GL_NV_fence")
33
- fptr_glGetFenceivNV(NUM2INT(arg1),NUM2INT(arg2),&ret);
33
+ fptr_glGetFenceivNV((GLuint)NUM2INT(arg1),(GLenum)NUM2INT(arg2),&ret);
34
34
  CHECK_GLERROR
35
- return cond_GLBOOL2RUBY(NUM2INT(arg2),ret);
35
+ return cond_GLBOOL2RUBY((GLenum)NUM2INT(arg2),ret);
36
36
  }
37
37
 
38
38
  /* #233 GL_NV_vertex_program */
@@ -41,7 +41,7 @@ static VALUE gl_LoadProgramNV(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3)
41
41
  {
42
42
  LOAD_GL_FUNC(glLoadProgramNV,"GL_NV_vertex_program")
43
43
  Check_Type(arg3,T_STRING);
44
- fptr_glLoadProgramNV(NUM2INT(arg1),NUM2UINT(arg2),RSTRING_LEN(arg3),(GLubyte *)RSTRING_PTR(arg3));
44
+ fptr_glLoadProgramNV((GLenum)NUM2INT(arg1),(GLuint)NUM2UINT(arg2),(GLsizei)RSTRING_LEN(arg3),(GLubyte *)RSTRING_PTR(arg3));
45
45
  CHECK_GLERROR
46
46
  return Qnil;
47
47
  }
@@ -51,9 +51,9 @@ static VALUE gl_GetProgramivNV(VALUE obj,VALUE arg1,VALUE arg2)
51
51
  {
52
52
  GLint ret = 0;
53
53
  LOAD_GL_FUNC(glGetProgramivNV,"GL_NV_vertex_program")
54
- fptr_glGetProgramivNV(NUM2INT(arg1),NUM2INT(arg2),&ret);
54
+ fptr_glGetProgramivNV((GLuint)NUM2INT(arg1),(GLenum)NUM2INT(arg2),&ret);
55
55
  CHECK_GLERROR
56
- return cond_GLBOOL2RUBY(NUM2INT(arg2),ret);
56
+ return cond_GLBOOL2RUBY((GLenum)NUM2INT(arg2),ret);
57
57
  }
58
58
 
59
59
  static void (APIENTRY * fptr_glGetProgramStringNV)(GLuint,GLenum,void *string);
@@ -66,14 +66,14 @@ static VALUE gl_GetProgramStringNV(VALUE obj,VALUE arg1,VALUE arg2)
66
66
  LOAD_GL_FUNC(glGetProgramStringNV,"GL_NV_vertex_program")
67
67
  LOAD_GL_FUNC(glGetProgramivNV,"GL_NV_vertex_program")
68
68
 
69
- fptr_glGetProgramivNV(NUM2INT(arg1),GL_PROGRAM_LENGTH_NV,&len);
69
+ fptr_glGetProgramivNV((GLuint)NUM2INT(arg1),GL_PROGRAM_LENGTH_NV,&len);
70
70
  CHECK_GLERROR
71
71
  if (len<=0)
72
72
  return rb_str_new2("");
73
73
 
74
74
  buffer = ALLOC_N(GLchar,len+1);
75
75
  memset(buffer,0,sizeof(GLchar) * (len+1));
76
- fptr_glGetProgramStringNV(NUM2INT(arg1),NUM2INT(arg2),buffer);
76
+ fptr_glGetProgramStringNV((GLuint)NUM2INT(arg1),(GLenum)NUM2INT(arg2),buffer);
77
77
  ret_buffer = rb_str_new2(buffer);
78
78
  xfree(buffer);
79
79
 
@@ -92,7 +92,7 @@ static VALUE gl_ExecuteProgramNV(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3)
92
92
  GLfloat params[4] = {0,0,0,0};
93
93
  LOAD_GL_FUNC(glExecuteProgramNV,"GL_NV_vertex_program")
94
94
  ary2cflt(arg3,params,4);
95
- fptr_glExecuteProgramNV(NUM2UINT(arg1),NUM2UINT(arg2),params);
95
+ fptr_glExecuteProgramNV((GLenum)NUM2UINT(arg1),(GLuint)NUM2UINT(arg2),params);
96
96
  CHECK_GLERROR
97
97
  return Qnil;
98
98
  }
@@ -158,7 +158,7 @@ VALUE obj,arg1,arg2,arg3; \
158
158
  _type_ cary[4]; \
159
159
  LOAD_GL_FUNC(gl##_name_,_extension_) \
160
160
  _conv_(arg3,cary,4); \
161
- fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),cary); \
161
+ fptr_gl##_name_((GLenum)NUM2UINT(arg1),(GLuint)NUM2UINT(arg2),cary); \
162
162
  CHECK_GLERROR \
163
163
  return Qnil; \
164
164
  }
@@ -174,7 +174,7 @@ VALUE obj,arg1,arg2,arg3; \
174
174
  { \
175
175
  _type_ cary[4] = {0.0,0.0,0.0,0.0}; \
176
176
  LOAD_GL_FUNC(gl##_name_,_extension_) \
177
- fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),NUM2UINT(arg3),cary); \
177
+ fptr_gl##_name_((GLenum)NUM2UINT(arg1),(GLuint)NUM2UINT(arg2),(GLenum)NUM2UINT(arg3),cary); \
178
178
  RET_ARRAY_OR_SINGLE(4,RETCONV_##_type_,cary) \
179
179
  }
180
180
 
@@ -189,14 +189,14 @@ gl_##_name_(obj,arg1,arg2,arg3) \
189
189
  VALUE obj,arg1,arg2,arg3; \
190
190
  { \
191
191
  _type_ *cary; \
192
- int len; \
192
+ long len; \
193
193
  LOAD_GL_FUNC(gl##_name_,_extension_) \
194
194
  len = RARRAY_LEN(rb_Array(arg3)); \
195
195
  if (len<=0 || (len % 4) != 0) \
196
196
  rb_raise(rb_eArgError, "Parameter array size must be multiplication of 4"); \
197
197
  cary = ALLOC_N(_type_,len); \
198
198
  _conv_(arg3,cary,len); \
199
- fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),len / 4, cary); \
199
+ fptr_gl##_name_((GLenum)NUM2UINT(arg1),(GLuint)NUM2UINT(arg2),len / 4, cary); \
200
200
  xfree(cary); \
201
201
  CHECK_GLERROR \
202
202
  return Qnil; \
@@ -258,7 +258,7 @@ VALUE obj,arg1,arg2; \
258
258
  { \
259
259
  GLuint index; \
260
260
  _type_ *cary; \
261
- int len; \
261
+ long len; \
262
262
  LOAD_GL_FUNC(gl##_name_,_extension_) \
263
263
  len = RARRAY_LEN(rb_Array(arg2)); \
264
264
  if (len<=0 || (len % _size_) != 0) \
@@ -266,7 +266,7 @@ VALUE obj,arg1,arg2; \
266
266
  cary = ALLOC_N(_type_,len); \
267
267
  index = (GLuint)NUM2UINT(arg1); \
268
268
  _conv_(arg2,cary,len); \
269
- fptr_gl##_name_(index,len / _size_,cary); \
269
+ fptr_gl##_name_(index,(GLsizei)(len / _size_),cary); \
270
270
  xfree(cary); \
271
271
  CHECK_GLERROR \
272
272
  return Qnil; \
@@ -340,7 +340,7 @@ static VALUE gl_GetTrackMatrixivNV(VALUE obj,VALUE arg1,VALUE arg2,VALUE arg3)
340
340
  {
341
341
  GLint ret = 0;
342
342
  LOAD_GL_FUNC(glGetTrackMatrixivNV,"GL_NV_vertex_program")
343
- fptr_glGetTrackMatrixivNV(NUM2UINT(arg1),NUM2UINT(arg2),NUM2UINT(arg3),&ret);
343
+ fptr_glGetTrackMatrixivNV((GLenum)NUM2UINT(arg1),(GLuint)NUM2UINT(arg2),(GLenum)NUM2UINT(arg3),&ret);
344
344
  CHECK_GLERROR
345
345
  return INT2NUM(ret);
346
346
  }
@@ -352,14 +352,14 @@ static VALUE gl_RequestResidentProgramsNV(VALUE obj,VALUE arg1)
352
352
  if (TYPE(arg1)==T_ARRAY) {
353
353
  GLsizei n;
354
354
  GLuint *programs;
355
- n = RARRAY_LEN(arg1);
355
+ n = (GLsizei)RARRAY_LEN(arg1);
356
356
  programs = ALLOC_N(GLuint,n);
357
357
  ary2cuint(arg1,programs,n);
358
358
  fptr_glRequestResidentProgramsNV( n, programs);
359
359
  xfree(programs);
360
360
  } else {
361
361
  GLuint program;
362
- program = NUM2INT(arg1);
362
+ program = (GLuint)NUM2INT(arg1);
363
363
  fptr_glRequestResidentProgramsNV( 1, &program);
364
364
  }
365
365
  CHECK_GLERROR
@@ -378,7 +378,7 @@ static VALUE gl_AreProgramsResidentNV(VALUE obj,VALUE arg1)
378
378
  int i;
379
379
  LOAD_GL_FUNC(glAreProgramsResidentNV,"GL_NV_vertex_program")
380
380
  ary = rb_Array(arg1);
381
- size = RARRAY_LEN(ary);
381
+ size = (GLsizei)RARRAY_LEN(ary);
382
382
  programs = ALLOC_N(GLuint,size);
383
383
  residences = ALLOC_N(GLboolean,size);
384
384
  ary2cuint(ary,programs,size);
@@ -410,9 +410,9 @@ static VALUE gl_##_name_(VALUE obj,VALUE arg1,VALUE arg2) \
410
410
  { \
411
411
  _type_ ret = 0; \
412
412
  LOAD_GL_FUNC(gl##_name_,"GL_NV_occlusion_query") \
413
- fptr_gl##_name_(NUM2INT(arg1),NUM2INT(arg2),&ret); \
413
+ fptr_gl##_name_((GLuint)NUM2INT(arg1),(GLenum)NUM2INT(arg2),&ret); \
414
414
  CHECK_GLERROR \
415
- return _conv_(NUM2INT(arg2),ret); \
415
+ return _conv_((GLenum)NUM2INT(arg2),ret); \
416
416
  }
417
417
 
418
418
  GETOCCLUSIONQUERY_FUNC(GetOcclusionQueryivNV,GLint,cond_GLBOOL2RUBY)
@@ -428,7 +428,7 @@ static VALUE gl_PointParameterivNV(VALUE obj,VALUE arg1,VALUE arg2)
428
428
  GLint param = 0;
429
429
  LOAD_GL_FUNC(glPointParameterivNV,"GL_NV_point_sprite")
430
430
  ary2cint(arg2,&param,1);
431
- fptr_glPointParameterivNV(NUM2UINT(arg1),&param);
431
+ fptr_glPointParameterivNV((GLenum)NUM2UINT(arg1),&param);
432
432
  CHECK_GLERROR
433
433
  return Qnil;
434
434
  }
@@ -442,7 +442,7 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5,arg6; \
442
442
  { \
443
443
  LOAD_GL_FUNC(gl##_name_,_extension_) \
444
444
  Check_Type(arg2,T_STRING); \
445
- fptr_gl##_name_(NUM2UINT(arg1),RSTRING_LEN(arg2),(GLubyte *)RSTRING_PTR(arg2),_conv_(arg3),_conv_(arg4),_conv_(arg5),_conv_(arg6)); \
445
+ fptr_gl##_name_((GLuint)NUM2UINT(arg1),(GLsizei)RSTRING_LEN(arg2),(GLubyte *)RSTRING_PTR(arg2),_conv_(arg3),_conv_(arg4),_conv_(arg5),_conv_(arg6)); \
446
446
  CHECK_GLERROR \
447
447
  return Qnil; \
448
448
  }
@@ -461,7 +461,7 @@ VALUE obj,arg1,arg2,arg3; \
461
461
  LOAD_GL_FUNC(gl##_name_,_extension_) \
462
462
  Check_Type(arg2,T_STRING); \
463
463
  _conv_(arg3,cary,4); \
464
- fptr_gl##_name_(NUM2UINT(arg1),RSTRING_LEN(arg2),(GLubyte *)RSTRING_PTR(arg2),cary); \
464
+ fptr_gl##_name_((GLuint)NUM2UINT(arg1),(GLsizei)RSTRING_LEN(arg2),(GLubyte *)RSTRING_PTR(arg2),cary); \
465
465
  CHECK_GLERROR \
466
466
  return Qnil; \
467
467
  }
@@ -479,7 +479,7 @@ VALUE obj,arg1,arg2; \
479
479
  _type_ cary[4] = {0.0,0.0,0.0,0.0}; \
480
480
  LOAD_GL_FUNC(gl##_name_,_extension_) \
481
481
  Check_Type(arg2,T_STRING); \
482
- fptr_gl##_name_(NUM2UINT(arg1),RSTRING_LEN(arg2),(GLubyte *)RSTRING_PTR(arg2),cary); \
482
+ fptr_gl##_name_((GLuint)NUM2UINT(arg1),(GLsizei)RSTRING_LEN(arg2),(GLubyte *)RSTRING_PTR(arg2),cary); \
483
483
  RET_ARRAY_OR_SINGLE(4,RETCONV_##_type_,cary) \
484
484
  }
485
485
 
@@ -518,7 +518,7 @@ VALUE obj,arg1,arg2; \
518
518
  { \
519
519
  _type_ cary[4] = {0.0,0.0,0.0,0.0}; \
520
520
  LOAD_GL_FUNC(gl##_name_,_extension_) \
521
- fptr_gl##_name_(NUM2UINT(arg1),NUM2UINT(arg2),cary); \
521
+ fptr_gl##_name_((GLenum)NUM2UINT(arg1),(GLuint)NUM2UINT(arg2),cary); \
522
522
  RET_ARRAY_OR_SINGLE(4,RETCONV_##_type_,cary) \
523
523
  }
524
524
 
Binary file
Binary file
@@ -78,7 +78,7 @@ const char *GetOpenglExtensions(void)
78
78
  const char *estr = (const char *) glGetString(GL_EXTENSIONS);
79
79
  CHECK_GLERROR
80
80
  if (estr) {
81
- int len = strlen(estr);
81
+ size_t len = strlen(estr);
82
82
  opengl_extensions = ALLOC_N(GLchar,len+1+1); /* terminating null and added space */
83
83
  strcpy(opengl_extensions,estr);
84
84
  opengl_extensions[len] = ' '; /* add space char for easy searchs */
@@ -94,7 +94,7 @@ GLboolean CheckExtension(const char *name)
94
94
  {
95
95
  const char *extensions;
96
96
  char *name_tmp;
97
- int name_len;
97
+ size_t name_len;
98
98
  GLboolean res;
99
99
 
100
100
  extensions = GetOpenglExtensions();
Binary file
@@ -0,0 +1,2 @@
1
+ # Logfile created on 2012-08-03 16:02:49 +0200 by logger.rb/31641
2
+ I, [2012-08-03T16:02:49.356924 #22495] INFO -- : Rakefile written
@@ -20,6 +20,10 @@ require 'rbconfig'
20
20
  RUBYVER = " -DRUBY_VERSION=" + RUBY_VERSION.split(".").join
21
21
 
22
22
  Mkrf::Generator.new( 'gl' ) do |g|
23
+ puts "*" * 10
24
+ #Config::CONFIG["CC"] = `which gcc`.chomp
25
+ p Config::CONFIG
26
+ puts "*" * 10
23
27
  case RUBY_PLATFORM
24
28
  when /darwin/
25
29
  g.cflags << RUBYVER
@@ -0,0 +1,43 @@
1
+ # Generated by mkrf
2
+ require 'rake/clean'
3
+
4
+ CLEAN.include('*.o')
5
+ CLOBBER.include('glu.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 => ['glu.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 'glu.bundle' => OBJ do
34
+ sh "#{LDSHARED} #{LIBPATH} -o glu.bundle #{OBJ} #{ADDITIONAL_OBJECTS} #{LIBS} #{LIBRUBYARG_SHARED}"
35
+ end
36
+
37
+ desc "Install this extension"
38
+ task :install => 'glu.bundle' do
39
+ makedirs "#{RUBYARCHDIR}"
40
+ install "glu.bundle", "#{RUBYARCHDIR}"
41
+ end
42
+
43
+
Binary file
Binary file
@@ -310,7 +310,7 @@ VALUE obj;
310
310
 
311
311
  switch (rb_scan_args(argc, argv, "52", &args[0], &args[1], &args[2], &args[3], &args[4], &args[5], &args[6])) {
312
312
  case 5:
313
- uknot_count = RARRAY_LEN(args[1]);
313
+ uknot_count = (GLint)RARRAY_LEN(args[1]);
314
314
  uorder = (GLenum)NUM2INT(args[3]);
315
315
  type = (GLenum)NUM2INT(args[4]);
316
316
  u_stride = get_curve_dim(type);
@@ -401,11 +401,11 @@ VALUE obj;
401
401
 
402
402
  switch (rb_scan_args(argc, argv, "74", &args[0], &args[1], &args[2], &args[3], &args[4], &args[5], &args[6], &args[7], &args[8], &args[9], &args[10])) {
403
403
  case 7:
404
- sknot_count = RARRAY_LEN(args[1]);
404
+ sknot_count = (GLint)RARRAY_LEN(args[1]);
405
405
  sknot = ALLOC_N(GLfloat, sknot_count);
406
406
  ary2cflt(args[1], sknot, sknot_count);
407
407
 
408
- tknot_count = RARRAY_LEN(args[2]);
408
+ tknot_count = (GLint)RARRAY_LEN(args[2]);
409
409
  tknot = ALLOC_N(GLfloat, tknot_count);
410
410
  ary2cflt(args[2], tknot, tknot_count);
411
411
 
@@ -497,8 +497,8 @@ VALUE obj;
497
497
 
498
498
  switch (rb_scan_args(argc, argv, "32", &args[0], &args[1], &args[2], &args[3], &args[4])) {
499
499
  case 3:
500
- count = RARRAY_LEN(args[1]);
501
- type = NUM2INT(args[2]);
500
+ count = (GLint)RARRAY_LEN(args[1]);
501
+ type = (GLenum)NUM2INT(args[2]);
502
502
  stride = (type == GLU_MAP1_TRIM_2 ? 2 : 3);
503
503
 
504
504
  array = ALLOC_N(GLfloat, count*stride);
@@ -506,9 +506,9 @@ VALUE obj;
506
506
  ary2cflt(ary_ctl1, array, count*stride);
507
507
  break;
508
508
  case 5:
509
- count = NUM2INT(args[1]);
510
- stride = NUM2INT(args[3]);
511
- type = NUM2INT(args[4]);
509
+ count = (GLint)NUM2INT(args[1]);
510
+ stride = (GLint)NUM2INT(args[3]);
511
+ type = (GLint)NUM2INT(args[4]);
512
512
 
513
513
  array = ALLOC_N(GLfloat, count*stride);
514
514
  ary_ctl1 = rb_funcall(args[2],rb_intern("flatten"),0);
Binary file
@@ -0,0 +1,2 @@
1
+ # Logfile created on 2012-08-03 17:30:27 +0200 by logger.rb/31641
2
+ I, [2012-08-03T17:30:27.827119 #23428] INFO -- : Rakefile written
@@ -0,0 +1,43 @@
1
+ # Generated by mkrf
2
+ require 'rake/clean'
3
+
4
+ CLEAN.include('*.o')
5
+ CLOBBER.include('glut.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 GLUT -framework OpenGL -framework Cocoa"
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 => ['glut.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 'glut.bundle' => OBJ do
34
+ sh "#{LDSHARED} #{LIBPATH} -o glut.bundle #{OBJ} #{ADDITIONAL_OBJECTS} #{LIBS} #{LIBRUBYARG_SHARED}"
35
+ end
36
+
37
+ desc "Install this extension"
38
+ task :install => 'glut.bundle' do
39
+ makedirs "#{RUBYARCHDIR}"
40
+ install "glut.bundle", "#{RUBYARCHDIR}"
41
+ end
42
+
43
+
Binary file
@@ -22,7 +22,7 @@
22
22
 
23
23
  #include "../common/common.h"
24
24
 
25
- static int callId; /* 'call' method id */
25
+ static unsigned long callId; /* 'call' method id */
26
26
 
27
27
  /*
28
28
  macros for registering callbacks -
@@ -90,7 +90,7 @@ static VALUE glut_Init( int argc, VALUE * argv, VALUE obj)
90
90
  /* converts commandline parameters from ruby to C, passes them
91
91
  to glutInit and returns the parameters stripped of glut-specific
92
92
  commands ("-display","-geometry" etc.) */
93
- largc = RARRAY_LEN(orig_arg);
93
+ largc = (int)RARRAY_LEN(orig_arg);
94
94
  largv = ALLOCA_N(char*, largc);
95
95
  for (i = 0; i < largc; i++)
96
96
  largv[i] = StringValuePtr(RARRAY_PTR(orig_arg)[i]);
@@ -130,8 +130,8 @@ glut_InitWindowPosition(obj,arg1,arg2)
130
130
  VALUE obj,arg1,arg2;
131
131
  {
132
132
  int x,y;
133
- x = NUM2INT(arg1);
134
- y = NUM2INT(arg2);
133
+ x = (int)NUM2INT(arg1);
134
+ y = (int)NUM2INT(arg2);
135
135
  glutInitWindowPosition(x,y);
136
136
  return Qnil;
137
137
  }
@@ -142,8 +142,8 @@ glut_InitWindowSize(obj, arg1, arg2)
142
142
  VALUE obj,arg1,arg2;
143
143
  {
144
144
  int width,height;
145
- width = NUM2INT(arg1);
146
- height = NUM2INT(arg2);
145
+ width = (int)NUM2INT(arg1);
146
+ height = (int)NUM2INT(arg2);
147
147
  glutInitWindowSize(width,height);
148
148
  return Qnil;
149
149
  }
@@ -203,7 +203,7 @@ VALUE obj,arg1,arg2;
203
203
  int pollinterval;
204
204
  if (!rb_obj_is_kind_of(arg1,rb_cProc) && !NIL_P(arg1))
205
205
  rb_raise(rb_eTypeError, "glutJoystickFunc:%s", rb_class2name(CLASS_OF(arg1)));
206
- pollinterval=NUM2INT(arg2);
206
+ pollinterval=(int)NUM2INT(arg2);
207
207
  win = glutGetWindow();
208
208
  if (win == 0)
209
209
  rb_raise(rb_eRuntimeError, "glutJoystickFunc needs current window");
@@ -238,11 +238,11 @@ VALUE obj,arg1,arg2,arg3,arg4,arg5;
238
238
  {
239
239
  int win, x, y, width, height;
240
240
  int ret;
241
- win = NUM2INT(arg1);
242
- x = NUM2INT(arg2);
243
- y = NUM2INT(arg3);
244
- width = NUM2INT(arg4);
245
- height = NUM2INT(arg5);
241
+ win = (int)NUM2INT(arg1);
242
+ x = (int)NUM2INT(arg2);
243
+ y = (int)NUM2INT(arg3);
244
+ width = (int)NUM2INT(arg4);
245
+ height = (int)NUM2INT(arg5);
246
246
  ret = glutCreateSubWindow(win, x, y, width, height);
247
247
  return INT2NUM(ret);
248
248
  }
@@ -252,7 +252,7 @@ glut_DestroyWindow(obj,arg1)
252
252
  VALUE obj,arg1;
253
253
  {
254
254
  int win;
255
- win = NUM2INT(arg1);
255
+ win = (int)NUM2INT(arg1);
256
256
  glutDestroyWindow(win);
257
257
  return Qnil;
258
258
  }
@@ -276,7 +276,7 @@ glut_SetWindow(obj,arg1)
276
276
  VALUE obj,arg1;
277
277
  {
278
278
  int win;
279
- win = NUM2INT(arg1);
279
+ win = (int)NUM2INT(arg1);
280
280
  glutSetWindow(win);
281
281
  return Qnil;
282
282
  }
@@ -307,8 +307,8 @@ glut_PositionWindow(obj,arg1,arg2)
307
307
  VALUE obj,arg1,arg2;
308
308
  {
309
309
  int x,y;
310
- x = NUM2INT(arg1);
311
- y = NUM2INT(arg2);
310
+ x = (int)NUM2INT(arg1);
311
+ y = (int)NUM2INT(arg2);
312
312
  glutPositionWindow(x,y);
313
313
  return Qnil;
314
314
  }
@@ -319,8 +319,8 @@ glut_ReshapeWindow(obj,arg1,arg2)
319
319
  VALUE obj,arg1,arg2;
320
320
  {
321
321
  int width,height;
322
- width = NUM2INT(arg1);
323
- height = NUM2INT(arg2);
322
+ width = (int)NUM2INT(arg1);
323
+ height = (int)NUM2INT(arg2);
324
324
  glutReshapeWindow(width, height);
325
325
  return Qnil;
326
326
  }
@@ -339,7 +339,7 @@ glut_SetCursor(obj,arg1)
339
339
  VALUE obj,arg1;
340
340
  {
341
341
  int cursor;
342
- cursor = NUM2INT(arg1);
342
+ cursor = (int)NUM2INT(arg1);
343
343
  glutSetCursor(cursor);
344
344
  return Qnil;
345
345
  }
@@ -349,8 +349,8 @@ glut_WarpPointer(obj,arg1,arg2)
349
349
  VALUE obj,arg1,arg2;
350
350
  {
351
351
  int x,y;
352
- x = NUM2INT(arg1);
353
- y = NUM2INT(arg2);
352
+ x = (int)NUM2INT(arg1);
353
+ y = (int)NUM2INT(arg2);
354
354
  glutWarpPointer(x,y);
355
355
  return Qnil;
356
356
  }
@@ -407,7 +407,7 @@ glut_DestroyMenu(obj,arg1)
407
407
  VALUE obj,arg1;
408
408
  {
409
409
  int menu;
410
- menu = NUM2INT(arg1);
410
+ menu = (int)NUM2INT(arg1);
411
411
  glutDestroyMenu(menu);
412
412
  //rb_hash_aset(g_menucallback, menu, Qnil);
413
413
  //rb_hash_aset(g_menuargs, menu, Qnil);
@@ -429,7 +429,7 @@ static VALUE
429
429
  glut_SetMenu(obj,arg1)
430
430
  VALUE obj,arg1;
431
431
  {
432
- glutSetMenu(NUM2INT(arg1));
432
+ glutSetMenu((int)NUM2INT(arg1));
433
433
  return Qnil;
434
434
  }
435
435
 
@@ -439,7 +439,7 @@ glut_AddMenuEntry(obj,arg1,arg2)
439
439
  VALUE obj,arg1,arg2;
440
440
  {
441
441
  Check_Type(arg1,T_STRING);
442
- glutAddMenuEntry(RSTRING_PTR(arg1), NUM2INT(arg2));
442
+ glutAddMenuEntry(RSTRING_PTR(arg1), (int)NUM2INT(arg2));
443
443
  return Qnil;
444
444
  }
445
445
 
@@ -449,7 +449,7 @@ glut_AddSubMenu(obj,arg1,arg2)
449
449
  VALUE obj,arg1,arg2;
450
450
  {
451
451
  Check_Type(arg1,T_STRING);
452
- glutAddSubMenu(RSTRING_PTR(arg1), NUM2INT(arg2));
452
+ glutAddSubMenu(RSTRING_PTR(arg1), (int)NUM2INT(arg2));
453
453
  return Qnil;
454
454
  }
455
455
 
@@ -458,7 +458,7 @@ static VALUE glut_ChangeToMenuEntry(obj,arg1,arg2,arg3)
458
458
  VALUE obj,arg1,arg2,arg3;
459
459
  {
460
460
  Check_Type(arg2,T_STRING);
461
- glutChangeToMenuEntry(NUM2INT(arg1), RSTRING_PTR(arg2), NUM2INT(arg3));
461
+ glutChangeToMenuEntry((int)NUM2INT(arg1), RSTRING_PTR(arg2), (int)NUM2INT(arg3));
462
462
  return Qnil;
463
463
  }
464
464
 
@@ -467,14 +467,14 @@ static VALUE glut_ChangeToSubMenu(obj,arg1,arg2,arg3)
467
467
  VALUE obj,arg1,arg2,arg3;
468
468
  {
469
469
  Check_Type(arg2,T_STRING);
470
- glutChangeToSubMenu(NUM2INT(arg1), RSTRING_PTR(arg2), NUM2INT(arg3));
470
+ glutChangeToSubMenu((int)NUM2INT(arg1), RSTRING_PTR(arg2), (int)NUM2INT(arg3));
471
471
  return Qnil;
472
472
  }
473
473
 
474
474
 
475
475
  static VALUE glut_RemoveMenuItem( VALUE obj, VALUE arg1 )
476
476
  {
477
- glutRemoveMenuItem(NUM2INT(arg1));
477
+ glutRemoveMenuItem((int)NUM2INT(arg1));
478
478
  return Qnil;
479
479
  }
480
480
 
@@ -483,7 +483,7 @@ static VALUE
483
483
  glut_AttachMenu(obj,arg1)
484
484
  VALUE obj, arg1;
485
485
  {
486
- glutAttachMenu(NUM2INT(arg1));
486
+ glutAttachMenu((int)NUM2INT(arg1));
487
487
  return Qnil;
488
488
  }
489
489
 
@@ -492,7 +492,7 @@ static VALUE
492
492
  glut_DetachMenu(obj,arg1)
493
493
  VALUE obj, arg1;
494
494
  {
495
- glutDetachMenu(NUM2INT(arg1));
495
+ glutDetachMenu((int)NUM2INT(arg1));
496
496
  return Qnil;
497
497
  }
498
498
 
@@ -629,7 +629,7 @@ VALUE obj,arg1,arg2,arg3;
629
629
  unsigned int millis;
630
630
  int value;
631
631
  millis = (unsigned int)NUM2INT(arg1);
632
- value = NUM2INT(arg3);
632
+ value = (int)NUM2INT(arg3);
633
633
  if (!rb_obj_is_kind_of(arg2,rb_cProc))
634
634
  rb_raise(rb_eTypeError, "glutTimerFunc:%s", rb_class2name(CLASS_OF(arg2)));
635
635
  timer_func = arg2;
@@ -767,7 +767,7 @@ int button, state, x, y;
767
767
  VALUE func;
768
768
  func = rb_ary_entry(TabletButtonFunc, glutGetWindow());
769
769
  if (!NIL_P(func))
770
- rb_funcall(func, 4, INT2NUM(button), INT2NUM(state), INT2NUM(x), INT2NUM(y));
770
+ rb_funcall(func, 4, (int)INT2NUM(button), INT2NUM(state), INT2NUM(x), INT2NUM(y));
771
771
  }
772
772
 
773
773
 
@@ -839,7 +839,7 @@ VALUE obj,arg1,arg2,arg3,arg4;
839
839
  GLfloat red;
840
840
  GLfloat green;
841
841
  GLfloat blue;
842
- set = NUM2INT(arg1);
842
+ set = (int)NUM2INT(arg1);
843
843
  red = (GLfloat)NUM2DBL(arg2);
844
844
  green = (GLfloat)NUM2DBL(arg3);
845
845
  blue = (GLfloat)NUM2DBL(arg4);
@@ -855,8 +855,8 @@ VALUE obj,arg1,arg2;
855
855
  int ndx;
856
856
  int component;
857
857
  GLfloat ret;
858
- ndx = NUM2INT(arg1);
859
- component = NUM2INT(arg2);
858
+ ndx = (int)NUM2INT(arg1);
859
+ component = (int)NUM2INT(arg2);
860
860
  ret = (GLfloat)glutGetColor(ndx, component);
861
861
  return rb_float_new(ret);
862
862
  }
@@ -867,7 +867,7 @@ glut_CopyColormap(obj,arg1)
867
867
  VALUE obj,arg1;
868
868
  {
869
869
  int win;
870
- win = NUM2INT(arg1);
870
+ win = (int)NUM2INT(arg1);
871
871
  glutCopyColormap(win);
872
872
  return Qnil;
873
873
  }
@@ -971,8 +971,8 @@ VALUE obj,arg1,arg2;
971
971
  {
972
972
  int character;
973
973
  int font;
974
- font = NUM2INT(arg1);
975
- character = NUM2INT(arg2);
974
+ font = (int)NUM2INT(arg1);
975
+ character = (int)NUM2INT(arg2);
976
976
  glutBitmapCharacter(bitmap_font_map(font),character);
977
977
  return Qnil;
978
978
  }
@@ -984,8 +984,8 @@ VALUE obj,arg1,arg2;
984
984
  int font;
985
985
  int character;
986
986
  int ret;
987
- font = NUM2INT(arg1);
988
- character = NUM2INT(arg2);
987
+ font = (int)NUM2INT(arg1);
988
+ character = (int)NUM2INT(arg2);
989
989
  ret = glutBitmapWidth(bitmap_font_map(font), character);
990
990
  return INT2NUM(ret);
991
991
  }
@@ -997,8 +997,8 @@ VALUE obj,arg1,arg2;
997
997
  {
998
998
  int font;
999
999
  int character;
1000
- font = NUM2INT(arg1);
1001
- character = NUM2INT(arg2);
1000
+ font = (int)NUM2INT(arg1);
1001
+ character = (int)NUM2INT(arg2);
1002
1002
  glutStrokeCharacter(stroke_font_map(font), character);
1003
1003
  return Qnil;
1004
1004
  }
@@ -1011,8 +1011,8 @@ VALUE obj,arg1,arg2;
1011
1011
  int font;
1012
1012
  int character;
1013
1013
  int ret;
1014
- font = NUM2INT(arg1);
1015
- character = NUM2INT(arg2);
1014
+ font = (int)NUM2INT(arg1);
1015
+ character = (int)NUM2INT(arg2);
1016
1016
  ret = glutStrokeWidth(stroke_font_map(font), character);
1017
1017
  return INT2NUM(ret);
1018
1018
  }
@@ -1025,7 +1025,7 @@ VALUE obj,arg1,arg2;
1025
1025
  int font;
1026
1026
  int ret;
1027
1027
  Check_Type(arg2,T_STRING);
1028
- font = NUM2INT(arg1);
1028
+ font = (int)NUM2INT(arg1);
1029
1029
  ret = glutBitmapLength(bitmap_font_map(font), (const unsigned char*)RSTRING_PTR(arg2));
1030
1030
  return INT2NUM(ret);
1031
1031
  }
@@ -1038,7 +1038,7 @@ VALUE obj,arg1,arg2;
1038
1038
  int font;
1039
1039
  int ret;
1040
1040
  Check_Type(arg2,T_STRING);
1041
- font = NUM2INT(arg1);
1041
+ font = (int)NUM2INT(arg1);
1042
1042
  ret = glutStrokeLength(stroke_font_map(font), (const unsigned char*)RSTRING_PTR(arg2));
1043
1043
  return INT2NUM(ret);
1044
1044
  }
@@ -1218,10 +1218,10 @@ VALUE obj,arg1,arg2,arg3,arg4;
1218
1218
  int y;
1219
1219
  int width;
1220
1220
  int height;
1221
- x = NUM2INT(arg1);
1222
- y = NUM2INT(arg2);
1223
- width = NUM2INT(arg3);
1224
- height = NUM2INT(arg4);
1221
+ x = (int)NUM2INT(arg1);
1222
+ y = (int)NUM2INT(arg2);
1223
+ width = (int)NUM2INT(arg3);
1224
+ height = (int)NUM2INT(arg4);
1225
1225
  glutVideoResize(x,y, width, height);
1226
1226
  return Qnil;
1227
1227
  }
@@ -1234,10 +1234,10 @@ VALUE obj,arg1,arg2,arg3,arg4;
1234
1234
  int y;
1235
1235
  int width;
1236
1236
  int height;
1237
- x = NUM2INT(arg1);
1238
- y = NUM2INT(arg2);
1239
- width = NUM2INT(arg3);
1240
- height = NUM2INT(arg4);
1237
+ x = (int)NUM2INT(arg1);
1238
+ y = (int)NUM2INT(arg2);
1239
+ width = (int)NUM2INT(arg3);
1240
+ height = (int)NUM2INT(arg4);
1241
1241
  glutVideoPan(x,y, width, height);
1242
1242
  return Qnil;
1243
1243
  }