gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gm2] error with ARRAY OF CHAR


From: Martin Kalbfuß
Subject: [Gm2] error with ARRAY OF CHAR
Date: Thu, 26 Nov 2009 19:36:43 +0100

the following code doesn't work

-- module test --

testSurface := SKVideo.LoadBMP('test.bmp');

-- module SKVideo --

PROCEDURE LoadBMP(file : ARRAY OF CHAR) : VideoBase.SurfacePtr;
VAR
     src   : VideoBase.RWOpS;
     BMP   : VideoBase.SurfacePtr;
BEGIN
     src := VideoBase.SDL_RWFromFile(file, 'rb');
     IF src = NIL THEN
          SKGeneral.Raise();
     END;

     BMP := VideoBase.SDL_LoadBMP_RW(src , 0);
     IF BMP = NIL THEN
          SKGeneral.Raise();
     END;
     RETURN BMP;
END LoadBMP;

-- C module VideoBase --

PROCEDURE SDL_LoadBMP_RW(src : RWOpS; freesrc : INTEGER) : SurfacePtr;

PROCEDURE SDL_RWFromFile(file, mode : ARRAY OF CHAR) : RWOpS;

I get:

terminate called after throwing an instance of 'int'

If I pass 'test.bmp' directly to SDL_RWFromFile inside LoadBMP it works.
Doing STextIO.WriteString(file); inside LoadBMP shows the correct
string. Looks like a problem with modules and ARRAY OF CHAR But I have
no idea what's wrong.


-- 
Martin Kalbfuß <address@hidden>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]