Now it does not accepts the GL2PSBeginPage function. If I let that one in, it just crashes. This is my current code:
Code:
type
GL2PSrgba = array[0..3] of GLfloat;
GLVWarray = array[0..3] of GLInt;
PGL2PSrgba = ^GL2PSrgba;
function gl2PSBeginPage(const title: PAnsiChar; const producer: PAnsiChar;
viewport: GLVWarray;
format,sort,options,colormode,colorsize: GLInt;
colormap: PGL2PSrgba;
nr, ng, nb, buffersize: GLInt;
stream: TStream;
const filename: PAnsiChar): GLInt;
cdecl; external 'gl2ps.dll';
This is how I call the code:
Code:
const cExportTitle = 'test';
const cExportCreator = 'test';
var
buffsize, state: GLInt;
viewport: GLVWarray;
fp: TFileStream;
FileName : PAnsiChar;
begin
FileName := PAnsiChar(Name);
fp := TFileStream.Create(Name, fmOpenWrite or fmCreate);
buffsize := 0;
state := GL2PS_OVERFLOW;
glGetIntegerv(GL_VIEWPORT, @viewport);
gl2psBeginPage (cExportTitle, cExportCreator, viewport,
GL2PS_EPS, GL2PS_NO_SORT, GL2PS_SILENT OR
GL2PS_SIMPLE_LINE_OFFSET OR GL2PS_OCCLUSION_CULL OR
GL2PS_BEST_ROOT,
GL_RGBA, 0, nil, 0, 0, 0, buffsize,
fp, FileName);
The dll and the unit that I created can be found at htpp://www.jsv6.nl/gl2PS.zip.
Bookmarks