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.


In reply to Re^4: SDL_Perl for Win32? by Corion
in thread SDL_Perl for Win32? by jryan

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.