mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-14 06:00:07 +02:00
openglcontrol: red,green,blue bits for windows
git-svn-id: trunk@40252 -
This commit is contained in:
parent
99777d6c19
commit
ee92fdee19
@ -29,7 +29,8 @@ function LOpenGLMakeCurrent(Handle: HWND): boolean;
|
||||
function LOpenGLCreateContext(AWinControl: TWinControl;
|
||||
WSPrivate: TWSPrivateClass; SharedControl: TWinControl;
|
||||
DoubleBuffered, RGBA: boolean;
|
||||
const MultiSampling, AlphaBits, DepthBits, StencilBits, AUXBuffers: Cardinal;
|
||||
const RedBits, GreenBits, BlueBits,
|
||||
MultiSampling, AlphaBits, DepthBits, StencilBits, AUXBuffers: Cardinal;
|
||||
const AParams: TCreateParams): HWND;
|
||||
procedure LOpenGLDestroyContextInfo(AWinControl: TWinControl);
|
||||
|
||||
@ -353,7 +354,8 @@ begin
|
||||
end;
|
||||
|
||||
function LGlMsCreateOpenGLContextAttrList(DoubleBuffered: boolean; RGBA: boolean;
|
||||
const MultiSampling, AlphaBits, DepthBits, StencilBits, AUXBuffers: Cardinal): PInteger;
|
||||
const RedBits, GreenBits, BlueBits, MultiSampling, AlphaBits, DepthBits,
|
||||
StencilBits, AUXBuffers: Cardinal): PInteger;
|
||||
var
|
||||
p: integer;
|
||||
|
||||
@ -377,7 +379,10 @@ var
|
||||
else
|
||||
Add(WGL_TYPE_COLORINDEX_ARB);
|
||||
|
||||
Add(WGL_COLOR_BITS_ARB); Add(24);
|
||||
Add(WGL_RED_BITS_ARB); Add(RedBits);
|
||||
Add(WGL_GREEN_BITS_ARB); Add(GreenBits);
|
||||
Add(WGL_BLUE_BITS_ARB); Add(BlueBits);
|
||||
Add(WGL_COLOR_BITS_ARB); Add(RedBits+GreenBits+BlueBits);
|
||||
Add(WGL_ALPHA_BITS_ARB); Add(AlphaBits);
|
||||
Add(WGL_DEPTH_BITS_ARB); Add(DepthBits);
|
||||
Add(WGL_STENCIL_BITS_ARB); Add(StencilBits);
|
||||
@ -402,7 +407,8 @@ end;
|
||||
function LOpenGLCreateContext(AWinControl: TWinControl;
|
||||
WSPrivate: TWSPrivateClass; SharedControl: TWinControl;
|
||||
DoubleBuffered, RGBA: boolean;
|
||||
const MultiSampling, AlphaBits, DepthBits, StencilBits, AUXBuffers: Cardinal;
|
||||
const RedBits, GreenBits, BlueBits,
|
||||
MultiSampling, AlphaBits, DepthBits, StencilBits, AUXBuffers: Cardinal;
|
||||
const AParams: TCreateParams): HWND;
|
||||
var
|
||||
Params: TCreateWindowExParams;
|
||||
@ -449,7 +455,10 @@ begin
|
||||
iPixelType:=PFD_TYPE_RGBA
|
||||
else
|
||||
iPixelType:=PFD_TYPE_COLORINDEX;
|
||||
cColorBits:=24; // color depth
|
||||
cColorBits:=RedBits+GreenBits+BlueBits; // color depth
|
||||
cRedBits:=RedBits;
|
||||
cGreenBits:=GreenBits;
|
||||
cBlueBits:=BlueBits;
|
||||
cAlphaBits:=AlphaBits;
|
||||
cDepthBits:=DepthBits; // Z-Buffer
|
||||
cStencilBits:=StencilBits;
|
||||
@ -461,8 +470,9 @@ begin
|
||||
if (MultiSampling > 1) and WGL_ARB_multisample and WGL_ARB_pixel_format
|
||||
and Assigned(wglChoosePixelFormatARB) then
|
||||
begin
|
||||
VisualAttrList := LGlMsCreateOpenGLContextAttrList(DoubleBuffered, RGBA,
|
||||
MultiSampling, AlphaBits, DepthBits, StencilBits, AUXBuffers);
|
||||
VisualAttrList := LGlMsCreateOpenGLContextAttrList(DoubleBuffered, RGBA,
|
||||
RedBits, GreenBits, BlueBits, MultiSampling, AlphaBits, DepthBits,
|
||||
StencilBits, AUXBuffers);
|
||||
try
|
||||
FillChar(VisualAttrFloat, SizeOf(VisualAttrFloat), 0);
|
||||
MsInitSuccess := wglChoosePixelFormatARB(Info^.DC, PGLint(VisualAttrList),
|
||||
|
@ -77,6 +77,7 @@ uses
|
||||
{$ENDIF}
|
||||
{$IFDEF UseWin32WGL}
|
||||
GLWin32WGLContext;
|
||||
{$DEFINE HasRGBBits}
|
||||
{$ENDIF}
|
||||
{$IFDEF UseQTGLX}
|
||||
GLQTContext;
|
||||
|
Loading…
Reference in New Issue
Block a user