Skip to content
This repository was archived by the owner on Mar 19, 2025. It is now read-only.

Commit d7ca39a

Browse files
author
Chris Marshall
committed
More XS split and move PackCallbackST to pgopogl.h
Another checkpoint in the XS file partition process. A bit of cleanup on the #defines and move a macro definition from the XS file to pgopogl.h.
1 parent cc6c9bf commit d7ca39a

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

OpenGL.xs

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* Last saved: Fri 29 May 2009 04:48:33 PM */
2+
13
/* Copyright (c) 1998 Kenneth Albanowski. All rights reserved.
24
* Copyright (c) 2007 Bob Free. All rights reserved.
35
* This program is free software; you can redistribute it and/or
@@ -316,6 +318,7 @@ neoconstant(char * name, int arg)
316318
#undef f
317319
#endif /* End IN_POGL_CONST_XS */
318320

321+
#ifdef IN_POGL_GL_XS
319322
/* Note: this is caching procs once for all contexts */
320323
/* !!! This should instead cache per context */
321324
#ifdef HAVE_GL
@@ -334,8 +337,10 @@ neoconstant(char * name, int arg)
334337
#define testProc(proc,name) 1
335338
#endif
336339
#endif
340+
#endif /* End IN_POGL_GL_XS */
337341

338342

343+
#ifdef IN_POGL_GLX_XS
339344
#ifdef HAVE_GLX
340345
# define HAVE_GLpc /* Perl interface */
341346
# define nativeWindowId(d, w) (w)
@@ -358,8 +363,6 @@ AV *EventAv;
358363
unsigned long LastEventMask; /* !! Common for all the windows */
359364
Display myDisplay;
360365

361-
#else
362-
# define InitSys()
363366
#endif /* defined __PM__ */
364367

365368
#ifdef HAVE_GLpc
@@ -381,6 +384,9 @@ static int default_attributes[] = { GLX_DOUBLEBUFFER, GLX_RGBA };
381384
static int DBUFFER_HACK = 0;
382385
#define __had_dbuffer_hack() (DBUFFER_HACK)
383386

387+
#endif /* End IN_POGL_GLX_XS */
388+
389+
/*
384390
#define PackCallbackST(av,first) \
385391
if (SvROK(ST(first)) && (SvTYPE(SvRV(ST(first))) == SVt_PVAV)){ \
386392
int i; \
@@ -393,6 +399,7 @@ static int DBUFFER_HACK = 0;
393399
for(i=first;i<items;i++) \
394400
av_push(av, newSVsv(ST(i))); \
395401
}
402+
*/
396403

397404
#ifdef GLUT_API_VERSION
398405

@@ -17894,4 +17901,6 @@ glpHasGPGPU()
1789417901

1789517902

1789617903
BOOT:
17904+
#ifdef __PM__
1789717905
InitSys();
17906+
#endif /* defined __PM__ */

pgopogl.h

+13
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,17 @@ void _pgopogl_call_XS (pTHX_ void (*subaddr) (pTHX_ CV *), CV * cv, SV ** mark);
4444
_pgopogl_call_XS (aTHX_ name, cv, mark); \
4545
}
4646

47+
#define PackCallbackST(av,first) \
48+
if (SvROK(ST(first)) && (SvTYPE(SvRV(ST(first))) == SVt_PVAV)){ \
49+
int i; \
50+
AV * x = (AV*)SvRV(ST(first)); \
51+
for(i=0;i<=av_len(x);i++) { \
52+
av_push(av, newSVsv(*av_fetch(x, i, 0))); \
53+
} \
54+
} else { \
55+
int i; \
56+
for(i=first;i<items;i++) \
57+
av_push(av, newSVsv(ST(i))); \
58+
}
59+
4760
#endif

0 commit comments

Comments
 (0)