mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
WGL srgb framebuffer support
This commit is contained in:
parent
601922e49e
commit
1dc15d821f
@ -174,7 +174,7 @@ get_properties_advanced(FrameBufferProperties &properties,
|
||||
|
||||
int acceleration_i, pixel_type_i, double_buffer_i, stereo_i,
|
||||
color_bits_i, alpha_bits_i, accum_bits_i, depth_bits_i,
|
||||
stencil_bits_i, multisamples_i;
|
||||
stencil_bits_i, multisamples_i, srgb_capable_i;
|
||||
|
||||
iattrib_list[acceleration_i = ni++] = WGL_ACCELERATION_ARB;
|
||||
iattrib_list[pixel_type_i = ni++] = WGL_PIXEL_TYPE_ARB;
|
||||
@ -185,6 +185,7 @@ get_properties_advanced(FrameBufferProperties &properties,
|
||||
iattrib_list[accum_bits_i = ni++] = WGL_ACCUM_BITS_ARB;
|
||||
iattrib_list[depth_bits_i = ni++] = WGL_DEPTH_BITS_ARB;
|
||||
iattrib_list[stencil_bits_i = ni++] = WGL_STENCIL_BITS_ARB;
|
||||
iattrib_list[srgb_capable_i = ni++] = WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB;
|
||||
|
||||
if (_supports_wgl_multisample) {
|
||||
iattrib_list[multisamples_i = ni++] = WGL_SAMPLES_ARB;
|
||||
@ -203,15 +204,15 @@ get_properties_advanced(FrameBufferProperties &properties,
|
||||
|
||||
int frame_buffer_mode = 0;
|
||||
if (ivalue_list[acceleration_i] == WGL_NO_ACCELERATION_ARB) {
|
||||
properties.set_force_software(1);
|
||||
properties.set_force_software(true);
|
||||
} else {
|
||||
properties.set_force_hardware(1);
|
||||
properties.set_force_hardware(true);
|
||||
}
|
||||
|
||||
if (ivalue_list[pixel_type_i] == WGL_TYPE_COLORINDEX_ARB) {
|
||||
properties.set_indexed_color(1);
|
||||
properties.set_indexed_color(true);
|
||||
} else {
|
||||
properties.set_rgb_color(1);
|
||||
properties.set_rgb_color(true);
|
||||
}
|
||||
|
||||
if (ivalue_list[double_buffer_i]) {
|
||||
@ -219,7 +220,11 @@ get_properties_advanced(FrameBufferProperties &properties,
|
||||
}
|
||||
|
||||
if (ivalue_list[stereo_i]) {
|
||||
properties.set_stereo(1);
|
||||
properties.set_stereo(true);
|
||||
}
|
||||
|
||||
if (ivalue_list[srgb_capable_i]) {
|
||||
properties.set_srgb_color(true);
|
||||
}
|
||||
|
||||
if (ivalue_list[alpha_bits_i] != 0) {
|
||||
@ -430,6 +435,10 @@ choose_pixel_format(const FrameBufferProperties &properties,
|
||||
}
|
||||
}
|
||||
|
||||
if (!properties.get_srgb_color()) {
|
||||
best_prop.set_srgb_color(false);
|
||||
}
|
||||
|
||||
_pfnum = best_pfnum;
|
||||
_pfnum_supports_pbuffer = need_pbuffer;
|
||||
_pfnum_properties = best_prop;
|
||||
|
Loading…
x
Reference in New Issue
Block a user