Hi all,

Yet more problems (as such)...

Originally i was using SDL, however due to several non-ending problems with SDL, OpenGL and multisampling (using dglOpenGL and GL.pas, GLU.pas, etc) i decided to not use it and use win32 instead, however the appearence is very different, in SDL the view was nice & smooth, how ever now it is big and chunky.. does anyone know how SDL creates the contexts etc?

Secondly, im having problems setting up multisampling... my card does support it (i have checked via GLView, its a fairly new card and i have used programs that had multisampling), it passes all the checks to see if it is supported, but when i go to create the PixelFormat, i get the result true, but i get the number of formats and the pixelformat back as 0.

The code is:
[pascal]
function InitializeMultiSample: Boolean;
var
pFormat: Integer;
valid: Boolean;
nFormats: UInt;
fAttrib: Array Of Single;
iAttrib: Array Of Integer;
begin
Result := False;
If Not GL_ARB_MULTISAMPLE Then Exit;
If Not Assigned(wglChoosePixelFormatARB) Then Exit;

SetLength(fAttrib, 2);
fAttrib[0] := 0;
fAttrib[1] := 0;

SetLength(iAttrib, 22);
iAttrib[0] := WGL_DRAW_TO_WINDOW_ARB;
iAttrib[1] := 1;
iAttrib[2] := WGL_SUUPORT_OPENGL_ARB;
iAttrib[3] := 1;
iAttrib[4] := WGL_ACCELERATION_ARB;
iAttrib[5] := WGL_FULL_ACCELERATION_ARB;
iAttrib[6] := WGL_COLOR_BITS_ARB;
iAttrib[7] := 24;
iAttrib[8] := WGL_ALPHA_BITS_ARB;
iAttrib[9] := 8;
iAttrib[10] := WGL_DEPTH_BITS_ARB;
iAttrib[11] := 16;
iAttrib[12] := WGL_STENCIL_BITS_ARB;
iAttrib[13] := 0;
iAttrib[14] := WGL_DOUBLE_BUFFER_ARB;
iAttrib[15] := 1;
iAttrib[16] := WGL_SAMPLE_BUFFERS_ARB;
iAttrib[17] := 1;
iAttrib[18] := WGL_SAMPLES_ARB;
iAttrib[19] := 4;
iAttrib[20] := 0;
iAttrib[21] := 0;

valid := wglChoosePixelFormatARB(_hDC, @iAttrib, @fAttrib, 1, @pFormat, @nFormats);
If (valid) And (nFormats > 0) Then
Begin
Result := True;
Exit;
End;

iAttrib[19] := 2;
valid := wglChoosePixelFormatARB(_hDC, @iAttrib, @fAttrib, 1, @pFormat, @nFormats);
If (valid) And (nFormats > 0) Then
Begin
Result := True;
Exit;
End;
end;
[/pascal]

I cant figure out why is would result in true but not return anything else, im using dglOpenGL.pas.

Thanks