in reply to Re^3: SDL_Perl for Win32?
in thread SDL_Perl for Win32?

Personally, I've found the C parser of Win32::API something I don't rely on - it's a recent addition and did not seem to work in all cases. I prefer using the "pack"-style parameter templates:

use strict; use Win32::API; my $gl_getstring = Win32::API->new('OpenGL32', 'glGetString', 'I', 'P' +); die "Could not load glGetString : $! / $^E" unless $gl_getstring; print "Vendor(a): ", unpack "p", $gl_getstring->Call(0x1F00);

I can't test this on my system, as both your variant and my variant seem to crash somewhere, and I don't know how this system here is set up/crippled. You need to change the library to OpenGL32 though, as that's the name of the library on Win32.

I just noticed - I had to change your call some more, before Win32::API accepted it at all:

my $gl_vendor = Win32::API->new( "OpenGL32", "char* glGetString(int a)" )->Call( 0x1F00 ); print "Vendor (b): ", $gl_vendor;

I've done some work with OpenGL::Simple and have had relatively good success with it, but I haven't delved into the depths of OpenGL programming. If you want/need a test account, I can make you the same offer I already made to Michael Schwern, that you can mail me files that get run on my Win32 machine (when it's on). My personal interest in SDL is limited though, so I won't be working on it.