forked from wchristian/OpenGL.pm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pogl_gl_Pixe_Ver2.xs
1563 lines (1399 loc) · 29.8 KB
/
pogl_gl_Pixe_Ver2.xs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* Last saved: Fri 26 Aug 2011 10:48:16 AM */
/* Copyright (c) 1998 Kenneth Albanowski. All rights reserved.
* Copyright (c) 2007 Bob Free. All rights reserved.
* Copyright (c) 2009 Chris Marshall. All rights reserved.
* This program is free software; you can redistribute it and/or
* modify it under the same terms as Perl itself.
*/
/* OpenGL GLX bindings */
#define IN_POGL_GLX_XS
#include <stdio.h>
#include "pgopogl.h"
#ifdef HAVE_GL
#include "gl_util.h"
/* Note: this is caching procs once for all contexts */
/* !!! This should instead cache per context */
#if defined(_WIN32) || (defined(__CYGWIN__) && defined(HAVE_W32API))
#define loadProc(proc,name) \
{ \
if (!proc) \
{ \
proc = (void *)wglGetProcAddress(name); \
if (!proc) croak(name " is not supported by this renderer"); \
} \
}
#define testProc(proc,name) ((proc) ? 1 : !!(proc = (void *)wglGetProcAddress(name)))
#else /* not using WGL */
#define loadProc(proc,name)
#define testProc(proc,name) 1
#endif /* not defined _WIN32, __CYGWIN__, and HAVE_W32API */
#endif /* defined HAVE_GL */
#ifdef HAVE_GLX
#include "glx_util.h"
#endif /* defined HAVE_GLX */
#ifdef HAVE_GLU
#include "glu_util.h"
#endif /* defined HAVE_GLU */
MODULE = Acme::MITHALDU::BleedingOpenGL::GL::PixeVer2 PACKAGE = Acme::MITHALDU::BleedingOpenGL
#ifdef HAVE_GL
#// 1.0
#//# glPixelMapfv_c($map, $mapsize, (CPTR)values);
void
glPixelMapfv_c(map, mapsize, values)
GLenum map
GLsizei mapsize
void * values
CODE:
glPixelMapfv(map, mapsize, values);
#// 1.0
#//# glPixelMapuiv_c($map, $mapsize, (CPTR)values);
void
glPixelMapuiv_c(map, mapsize, values)
GLenum map
GLsizei mapsize
void * values
CODE:
glPixelMapuiv(map, mapsize, values);
#// 1.0
#//# glPixelMapusv_c($map, $mapsize, (CPTR)values);
void
glPixelMapusv_c(map, mapsize, values)
GLenum map
GLsizei mapsize
void * values
CODE:
glPixelMapusv(map, mapsize, values);
#// 1.0
#//# glPixelMapfv_s($map, $mapsize, (PACKED)values);
void
glPixelMapfv_s(map, mapsize, values)
GLenum map
GLsizei mapsize
SV * values
CODE:
{
GLfloat * values_s = EL(values, sizeof(GLfloat)*mapsize);
glPixelMapfv(map, mapsize, values_s);
}
#// 1.0
#//# glPixelMapuiv_s($map, $mapsize, (PACKED)values);
void
glPixelMapuiv_s(map, mapsize, values)
GLenum map
GLsizei mapsize
SV * values
CODE:
{
GLuint * values_s = EL(values, sizeof(GLuint)*mapsize);
glPixelMapuiv(map, mapsize, values_s);
}
#// 1.0
#//# glPixelMapusv_s($map, $mapsize, (PACKED)values);
void
glPixelMapusv_s(map, mapsize, values)
GLenum map
GLsizei mapsize
SV * values
CODE:
{
GLushort * values_s = EL(values, sizeof(GLushort)*mapsize);
glPixelMapusv(map, mapsize, values_s);
}
#// 1.0
#//# glPixelMapfv_p($map, @values);
void
glPixelMapfv_p(map, ...)
GLenum map
CODE:
{
GLint mapsize = items-1;
GLfloat * values;
int i;
values = malloc(sizeof(GLfloat) * (mapsize+1));
for (i=0;i<mapsize;i++)
values[i] = (GLfloat)SvNV(ST(i+1));
glPixelMapfv(map, mapsize, values);
free(values);
}
#// 1.0
#//# glPixelMapuiv_p($map, @values);
void
glPixelMapuiv_p(map, ...)
GLenum map
CODE:
{
GLint mapsize = items-1;
GLuint * values;
int i;
values = malloc(sizeof(GLuint) * (mapsize+1));
for (i=0;i<mapsize;i++)
values[i] = SvIV(ST(i+1));
glPixelMapuiv(map, mapsize, values);
free(values);
}
#// 1.0
#//# glPixelMapusv_p($map, @values);
void
glPixelMapusv_p(map, ...)
GLenum map
CODE:
{
GLint mapsize = items-1;
GLushort * values;
int i;
values = malloc(sizeof(GLushort) * (mapsize+1));
for (i=0;i<mapsize;i++)
values[i] = (GLushort)SvIV(ST(i+1));
glPixelMapusv(map, mapsize, values);
free(values);
}
#// 1.0
#//# glPixelStoref($pname, $param);
void
glPixelStoref(pname, param)
GLenum pname
GLfloat param
#// 1.0
#//# glPixelStorei($pname, $param);
void
glPixelStorei(pname, param)
GLenum pname
GLint param
#// 1.0
#//# glPixelTransferf($pname, $param);
void
glPixelTransferf(pname, param)
GLenum pname
GLfloat param
#// 1.0
#//# glPixelTransferi($pname, $param);
void
glPixelTransferi(pname, param)
GLenum pname
GLint param
#// 1.0
#//# glPixelZoom($xfactor, $yfactor);
void
glPixelZoom(xfactor, yfactor)
GLfloat xfactor
GLfloat yfactor
#// 1.0
#//# glPointSize($size);
void
glPointSize(size)
GLfloat size
#// 1.0
#//# glPolygonMode($face, $mode);
void
glPolygonMode(face, mode)
GLenum face
GLenum mode
#ifdef GL_VERSION_1_1
#// 1.1
#//# glPolygonOffset($factor, $units);
void
glPolygonOffset(factor, units)
GLfloat factor
GLfloat units
#endif
#// 1.0
#//# glPolygonStipple_c((CPTR)mask);
void
glPolygonStipple_c(mask)
void * mask
CODE:
glPolygonStipple(mask);
#// 1.0
#//# glPolygonStipple_s((PACKED)mask);
void
glPolygonStipple_s(mask)
SV * mask
CODE:
{
GLubyte * ptr = ELI(mask, 32, 32, GL_COLOR_INDEX, GL_BITMAP, 0);
glPolygonStipple(ptr);
}
#//# glPolygonStipple_p(@mask);
void
glPolygonStipple_p(...)
CODE:
{
GLvoid * ptr;
glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
ptr = pack_image_ST(&(ST(0)), items, 32, 32, 1,
GL_COLOR_INDEX, GL_BITMAP, 0);
glPolygonStipple(ptr);
glPopClientAttrib();
free(ptr);
}
#ifdef GL_VERSION_1_1
#// 1.1
#//# glPrioritizeTextures_c($n, (CPTR)textures, (CPTR)priorities);
void
glPrioritizeTextures_c(n, textures, priorities)
GLsizei n
void * textures
void * priorities
CODE:
glPrioritizeTextures(n, textures, priorities);
#// 1.1
#//# glPrioritizeTextures_s($n, (PACKED)textures, (PACKED)priorities);
void
glPrioritizeTextures_s(n, textures, priorities)
GLsizei n
SV * textures
SV * priorities
CODE:
{
GLuint * textures_s = EL(textures, sizeof(GLuint) * n);
GLclampf * priorities_s = EL(priorities, sizeof(GLclampf) * n);
glPrioritizeTextures(n, textures_s, priorities_s);
}
#// 1.1
#//# glPrioritizeTextures_p(@textureIDs, @priorities);
void
glPrioritizeTextures_p(...)
CODE:
{
GLsizei n = items/2;
GLuint * textures = malloc(sizeof(GLuint) * (n+1));
GLclampf * prior = malloc(sizeof(GLclampf) * (n+1));
int i;
for (i=0;i<n;i++) {
textures[i] = SvIV(ST(i * 2 + 0));
prior[i] = (GLclampf)SvNV(ST(i * 2 + 1));
}
glPrioritizeTextures(n, textures, prior);
free(textures);
free(prior);
}
#endif
#// 1.0
#//# glPushAttrib($mask);
void
glPushAttrib(mask)
GLbitfield mask
#// 1.0
#//# glPopAttrib();
void
glPopAttrib()
#// 1.0
#//# glPushClientAttrib($mask);
void
glPushClientAttrib(mask)
GLbitfield mask
#// 1.0
#//# glPopClientAttrib();
void
glPopClientAttrib()
#// 1.0
#//# glPushMatrix();
void
glPushMatrix()
#// 1.0
#//# glPopMatrix();
void
glPopMatrix()
#// 1.0
#//# glPushName($name);
void
glPushName(name)
GLuint name
#// 1.0
#//# glPopName();
void
glPopName()
#// 1.0
#//# glReadBuffer($mode);
void
glReadBuffer(mode)
GLenum mode
#// 1.0
#//# glReadPixels_c($x, $y, $width, $height, $format, $type, (CPTR)pixels);
void
glReadPixels_c(x, y, width, height, format, type, pixels)
GLint x
GLint y
GLsizei width
GLsizei height
GLenum format
GLenum type
void * pixels
CODE:
glReadPixels(x, y, width, height, format, type, pixels);
#// 1.0
#//# glReadPixels_s($x, $y, $width, $height, $format, $type, (PACKED)pixels);
void
glReadPixels_s(x, y, width, height, format, type, pixels)
GLint x
GLint y
GLsizei width
GLsizei height
GLenum format
GLenum type
SV * pixels
CODE:
{
void * ptr = ELI(pixels, width, height,
format, type, gl_pixelbuffer_pack);
glReadPixels(x, y, width, height, format, type, ptr);
}
#// 1.0
#//# @pixels = glReadPixels_p($x, $y, $width, $height, $format, $type);
void
glReadPixels_p(x, y, width, height, format, type)
GLint x
GLint y
GLsizei width
GLsizei height
GLenum format
GLenum type
PPCODE:
{
void * ptr;
glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
glPixelStorei(GL_PACK_ROW_LENGTH, 0);
glPixelStorei(GL_PACK_ALIGNMENT, 1);
ptr = allocate_image_ST(width, height, 1, format, type, 0);
glReadPixels(x, y, width, height, format, type, ptr);
sp = unpack_image_ST(sp, ptr, width, height, 1, format, type, 0);
free(ptr);
glPopClientAttrib();
}
#// 1.0
#//# glRecti($x1, $y1, $x2, $y2);
void
glRecti(x1, y1, x2, y2)
GLint x1
GLint y1
GLint x2
GLint y2
ALIAS:
glRectiv_p = 1
#// 1.0
#//# glRects($x1, $y1, $x2, $y2);
void
glRects(x1, y1, x2, y2)
GLshort x1
GLshort y1
GLshort x2
GLshort y2
ALIAS:
glRectsv_p = 1
#// 1.0
#//# glRectd($x1, $y1, $x2, $y2);
void
glRectd(x1, y1, x2, y2)
GLdouble x1
GLdouble y1
GLdouble x2
GLdouble y2
ALIAS:
glRectdv_p = 1
#// 1.0
#//# glRectf($x1, $y1, $x2, $y2);
void
glRectf(x1, y1, x2, y2)
GLfloat x1
GLfloat y1
GLfloat x2
GLfloat y2
ALIAS:
glRectfv_p = 1
#// 1.0
#//# glRectsv_c((CPTR)v1, (CPTR)v2);
void
glRectsv_c(v1, v2)
void * v1
void * v2
CODE:
glRectsv(v1, v2);
#// 1.0
#//# glRectiv_c((CPTR)v1, (CPTR)v2);
void
glRectiv_c(v1, v2)
void * v1
void * v2
CODE:
glRectiv(v1, v2);
#// 1.0
#//# glRectfv_c((CPTR)v1, (CPTR)v2);
void
glRectfv_c(v1, v2)
void * v1
void * v2
CODE:
glRectfv(v1, v2);
#// 1.0
#//# glRectdv_c((CPTR)v1, (CPTR)v2);
void
glRectdv_c(v1, v2)
void * v1
void * v2
CODE:
glRectdv(v1, v2);
#// 1.0
#//# glRectdv_s((PACKED)v1, (PACKED)v2);
void
glRectdv_s(v1, v2)
SV * v1
SV * v2
CODE:
{
GLdouble * v1_s = EL(v1, sizeof(GLdouble)*2);
GLdouble * v2_s = EL(v2, sizeof(GLdouble)*2);
glRectdv(v1_s, v2_s);
}
#// 1.0
#//# glRectfv_s((PACKED)v1, (PACKED)v2);
void
glRectfv_s(v1, v2)
SV * v1
SV * v2
CODE:
{
GLfloat * v1_s = EL(v1, sizeof(GLfloat)*2);
GLfloat * v2_s = EL(v2, sizeof(GLfloat)*2);
glRectfv(v1_s, v2_s);
}
#// 1.0
#//# glRectiv_s((PACKED)v1, (PACKED)v2);
void
glRectiv_s(v1, v2)
SV * v1
SV * v2
CODE:
{
GLint * v1_s = EL(v1, sizeof(GLint)*2);
GLint * v2_s = EL(v2, sizeof(GLint)*2);
glRectiv(v1_s, v2_s);
}
#// 1.0
#//# glRectsv_s((PACKED)v1, (PACKED)v2);
void
glRectsv_s(v1, v2)
SV * v1
SV * v2
CODE:
{
GLshort * v1_s = EL(v1, sizeof(GLshort)*2);
GLshort * v2_s = EL(v2, sizeof(GLshort)*2);
glRectsv(v1_s, v2_s);
}
#// 1.0
#//# glRenderMode($mode);
GLint
glRenderMode(mode)
GLenum mode
#// 1.0
#//# glRotated($angle, $x, $y, $z);
void
glRotated(angle, x, y, z)
GLdouble angle
GLdouble x
GLdouble y
GLdouble z
#// 1.0
#//# glRotatef($angle, $x, $y, $z);
void
glRotatef(angle, x, y, z)
GLfloat angle
GLfloat x
GLfloat y
GLfloat z
#// 1.0
#//# glScaled($x, $y, $z);
void
glScaled(x, y, z)
GLdouble x
GLdouble y
GLdouble z
#// 1.0
#//# glScalef($x, $y, $z);
void
glScalef(x, y, z)
GLfloat x
GLfloat y
GLfloat z
#// 1.0
#//# glScissor($x, $y, $width, $height);
void
glScissor(x, y, width, height)
GLint x
GLint y
GLsizei width
GLsizei height
#// 1.0
#//# glSelectBuffer_c($size, (CPTR)list);
void
glSelectBuffer_c(size, list)
GLsizei size
void * list
CODE:
glSelectBuffer(size, list);
#// 1.0
#//# glShadeModel($mode);
void
glShadeModel(mode)
GLenum mode
#// 1.0
#//# glStencilFunc($func, $ref, $mask);
void
glStencilFunc(func, ref, mask)
GLenum func
GLint ref
GLuint mask
#// 1.0
#//# glStencilMask($mask);
void
glStencilMask(mask)
GLuint mask
#// 1.0
#//# glStencilOp($fail, $zfail, $zpass);
void
glStencilOp(fail, zfail, zpass)
GLenum fail
GLenum zfail
GLenum zpass
#// 1.0
#//# glTexEnvf($target, $pname, $param);
void
glTexEnvf(target, pname, param)
GLenum target
GLenum pname
GLfloat param
#// 1.0
#//# glTexEnvi($target, $pname, $param);
void
glTexEnvi(target, pname, param)
GLenum target
GLenum pname
GLint param
#// 1.0
#//# glTexEnvfv_s(target, pname, (PACKED)params);
void
glTexEnvfv_s(target, pname, params)
GLenum target
GLenum pname
SV * params
CODE:
{
GLfloat * params_s = EL(params, sizeof(GLfloat)*gl_texenv_count(pname));
glTexEnvfv(target, pname, params_s);
}
#// 1.0
#//# glTexEnviv_s(target, pname, (PACKED)params);
void
glTexEnviv_s(target, pname, params)
GLenum target
GLenum pname
SV * params
CODE:
{
GLint * params_s = EL(params, sizeof(GLint)*gl_texenv_count(pname));
glTexEnviv(target, pname, params_s);
}
#// 1.0
#//# glTexEnvfv_p(target, pname, @params);
void
glTexEnvfv_p(target, pname, ...)
GLenum target
GLenum pname
CODE:
{
GLfloat p[MAX_GL_TEXENV_COUNT];
int n = items-2;
int i;
if (n != gl_texenv_count(pname))
croak("Incorrect number of arguments");
for (i=2;i<items;i++)
p[i-2] = (GLfloat)SvNV(ST(i));
glTexEnvfv(target, pname, &p[0]);
}
#// 1.0
#//# glTexEnviv_p(target, pname, @params);
void
glTexEnviv_p(target, pname, ...)
GLenum target
GLenum pname
CODE:
{
GLint p[MAX_GL_TEXENV_COUNT];
int n = items-2;
int i;
if (n != gl_texenv_count(pname))
croak("Incorrect number of arguments");
for (i=2;i<items;i++)
p[i-2] = SvIV(ST(i));
glTexEnviv(target, pname, &p[0]);
}
#// 1.0
#//# glTexGend($Coord, $pname, $param);
void
glTexGend(Coord, pname, param)
GLenum Coord
GLenum pname
GLdouble param
#// 1.0
#//# glTexGenf($Coord, $pname, $param);
void
glTexGenf(Coord, pname, param)
GLenum Coord
GLenum pname
GLfloat param
#// 1.0
#//# glTexGeni($Coord, $pname, $param);
void
glTexGeni(Coord, pname, param)
GLenum Coord
GLenum pname
GLint param
#// 1.0
#//# glTexGendv_c($Coord, $pname, (CPTR)params);
void
glTexGendv_c(Coord, pname, params)
GLenum Coord
GLenum pname
void * params
CODE:
glTexGendv(Coord, pname, params);
#// 1.0
#//# glTexGenfv_c($Coord, $pname, (CPTR)params);
void
glTexGenfv_c(Coord, pname, params)
GLenum Coord
GLenum pname
void * params
CODE:
glTexGenfv(Coord, pname, params);
#// 1.0
#//# glTexGeniv_c($Coord, $pname, (CPTR)params);
void
glTexGeniv_c(Coord, pname, params)
GLenum Coord
GLenum pname
void * params
CODE:
glTexGeniv(Coord, pname, params);
#// 1.0
#//# glTexGendv_s($Coord, $pname, (PACKED)params);
void
glTexGendv_s(Coord, pname, params)
GLenum Coord
GLenum pname
SV * params
CODE:
{
GLdouble * params_s = EL(params,
sizeof(GLdouble)* gl_texgen_count(pname));
glTexGendv(Coord, pname, params_s);
}
#// 1.0
#//# glTexGenfv_s($Coord, $pname, (PACKED)params);
void
glTexGenfv_s(Coord, pname, params)
GLenum Coord
GLenum pname
SV * params
CODE:
{
GLfloat * params_s = EL(params,
sizeof(GLfloat)* gl_texgen_count(pname));
glTexGenfv(Coord, pname, params_s);
}
#// 1.0
#//# glTexGeniv_s($Coord, $pname, (PACKED)params);
void
glTexGeniv_s(Coord, pname, params)
GLenum Coord
GLenum pname
SV * params
CODE:
{
GLint * params_s = EL(params,
sizeof(GLint)* gl_texgen_count(pname));
glTexGeniv(Coord, pname, params_s);
}
#// 1.0
#//# glTexGendv_p($Coord, $pname, @params);
void
glTexGendv_p(Coord, pname, ...)
GLenum Coord
GLenum pname
CODE:
{
GLdouble p[MAX_GL_TEXGEN_COUNT];
int n = items-2;
int i;
if (n != gl_texgen_count(pname))
croak("Incorrect number of arguments");
for (i=2;i<items;i++)
p[i-2] = SvNV(ST(i));
glTexGendv(Coord, pname, &p[0]);
}
#// 1.0
#//# glTexGenfv_p($Coord, $pname, @params);
void
glTexGenfv_p(Coord, pname, ...)
GLenum Coord
GLenum pname
CODE:
{
GLfloat p[MAX_GL_TEXGEN_COUNT];
int n = items-2;
int i;
if (n != gl_texgen_count(pname))
croak("Incorrect number of arguments");
for (i=2;i<items;i++)
p[i-2] = (GLfloat)SvNV(ST(i));
glTexGenfv(Coord, pname, &p[0]);
}
#// 1.0
#//# glTexGeniv_p($Coord, $pname, @params);
void
glTexGeniv_p(Coord, pname, ...)
GLenum Coord
GLenum pname
CODE:
{
GLint p[MAX_GL_TEXGEN_COUNT];
int n = items-2;
int i;
if (n != gl_texgen_count(pname))
croak("Incorrect number of arguments");
for (i=2;i<items;i++)
p[i-2] = SvIV(ST(i));
glTexGeniv(Coord, pname, &p[0]);
}
#// 1.0
#//# glTexImage1D_c($target, $level, $internalformat, $width, $border, $format, $type, (CPTR)pixels);
void
glTexImage1D_c(target, level, internalformat, width, border, format, type, pixels)
GLenum target
GLint level
GLint internalformat
GLsizei width
GLint border
GLenum format
GLenum type
void * pixels
CODE:
glTexImage1D(target, level, internalformat,
width, border, format, type, pixels);
#// 1.0
#//# glTexImage1D_s($target, $level, $internalformat, $width, $border, $format, $type, (PACKED)pixels);
void
glTexImage1D_s(target, level, internalformat, width, border, format, type, pixels)
GLenum target
GLint level
GLint internalformat
GLsizei width
GLint border
GLenum format
GLenum type
SV * pixels
CODE:
{
GLvoid * ptr = ELI(pixels, width, 1, format, type,
gl_pixelbuffer_unpack);
glTexImage1D(target, level, internalformat,
width, border, format, type, ptr);
}
#// 1.2
#//# glTexImage1D_p($target, $level, $internalformat, $width, $border, $format, $type, @pixels);
void
glTexImage1D_p(target, level, internalformat, width, border, format, type, ...)
GLenum target
GLint level
GLint internalformat
GLsizei width
GLint border
GLenum format
GLenum type
CODE:
{
GLvoid * ptr;
glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
ptr = pack_image_ST(&(ST(7)), items-7, width, 1, 1, format, type, 0);
glTexImage1D(target, level, internalformat,
width, border, format, type, ptr);
glPopClientAttrib();
free(ptr);
}
#// 1.0
#//# glTexImage2D_c($target, $level, $internalformat, $width, $height, $border, $format, $type, (CPTR)pixels);
void
glTexImage2D_c(target, level, internalformat, width, height, border, format, type, pixels)
GLenum target
GLint level
GLint internalformat
GLsizei width
GLsizei height
GLint border
GLenum format
GLenum type
void * pixels
CODE:
glTexImage2D(target, level, internalformat,
width, height, border, format, type, pixels);
#// 1.0
#//# glTexImage2D_s($target, $level, $internalformat, $width, $height, $border, $format, $type, (PACKED)pixels);
void
glTexImage2D_s(target, level, internalformat, width, height, border, format, type, pixels)
GLenum target
GLint level
GLint internalformat
GLsizei width
GLsizei height
GLint border
GLenum format
GLenum type
SV * pixels
CODE:
{
GLvoid * ptr = NULL;
if (pixels)
{
ptr = ELI(pixels, width, height,
format, type, gl_pixelbuffer_unpack);
}
glTexImage2D(target, level, internalformat,
width, height, border, format, type, ptr);
}
#// 1.2
#//# glTexImage2D_p($target, $level, $internalformat, $width, $height, $border, $format, $type, @pixels);
void
glTexImage2D_p(target, level, internalformat, width, height, border, format, type, ...)
GLenum target
GLint level
GLint internalformat
GLsizei width
GLsizei height
GLint border
GLenum format
GLenum type
CODE:
{
GLvoid * ptr;
glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
ptr = pack_image_ST(&(ST(8)), items-8, width, height,