#define HAVE_TLS_CONTEXT
#endif
-#include "src/defines.h"
+/* For windows */
+#ifndef SDL_PERL_DEFINES_H
+#define SDL_PERL_DEFINES_H
+
+#ifdef HAVE_TLS_CONTEXT
+PerlInterpreter *parent_perl = NULL;
+extern PerlInterpreter *parent_perl;
+#define GET_TLS_CONTEXT parent_perl = PERL_GET_CONTEXT;
+#define ENTER_TLS_CONTEXT \
+ PerlInterpreter *current_perl = PERL_GET_CONTEXT; \
+ PERL_SET_CONTEXT(parent_perl); { \
+ PerlInterpreter *my_perl = parent_perl;
+#define LEAVE_TLS_CONTEXT \
+ } PERL_SET_CONTEXT(current_perl);
+#else
+#define GET_TLS_CONTEXT /* TLS context not enabled */
+#define ENTER_TLS_CONTEXT /* TLS context not enabled */
+#define LEAVE_TLS_CONTEXT /* TLS context not enabled */
+#endif
+
+#endif
Uint32
sdl_perl_timer_callback ( Uint32 interval, void* param )
OUTPUT:
RETVAL
+
+void
+ColorRGB ( color, ... )
+ SDL_Color *color
+ PPCODE:
+ if (items > 1 ) {
+ color->r = SvIV(ST(1));
+ color->g = SvIV(ST(2));
+ color->b = SvIV(ST(3));
+ }
+ mXPUSHi( color->r );
+ mXPUSHi( color->g );
+ mXPUSHi( color->b );
+ XSRETURN(3);
+
void
FreeColor ( color )
SDL_Color *color
int w,h;
RETVAL = newAV();
TTF_SizeUTF8(font,text,&w,&h);
- av_push(RETVAL,newSViv(w));
- av_push(RETVAL,newSViv(h));
+ av_push(RETVAL,newSViv(w));
+ av_push(RETVAL,newSViv(h));
+
+ sv_2mortal((SV*)RETVAL);
+
OUTPUT:
RETVAL