mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 08:44:19 -04:00
multisample_bits -> multisamples
This commit is contained in:
parent
46c268f69d
commit
d7a1415b8c
@ -190,9 +190,9 @@ ConfigVariableInt stencil_bits
|
||||
("stencil-bits", 1,
|
||||
PRC_DESC("The minimum number of stencil bits requested if the stencil keyword "
|
||||
"is present in framebuffer-mode."));
|
||||
ConfigVariableInt multisample_bits
|
||||
("multisample-bits", 1,
|
||||
PRC_DESC("The minimum number of multisample bits requested if the multisample keyword "
|
||||
ConfigVariableInt multisamples
|
||||
("multisamples", 1,
|
||||
PRC_DESC("The minimum number of samples requested if the multisample keyword "
|
||||
"is present in framebuffer-mode."));
|
||||
|
||||
ConfigVariableDouble background_color
|
||||
|
@ -74,7 +74,7 @@ extern ConfigVariableInt depth_bits;
|
||||
extern ConfigVariableInt color_bits;
|
||||
extern ConfigVariableInt alpha_bits;
|
||||
extern ConfigVariableInt stencil_bits;
|
||||
extern ConfigVariableInt multisample_bits;
|
||||
extern ConfigVariableInt multisamples;
|
||||
|
||||
extern ConfigVariableDouble background_color;
|
||||
|
||||
|
@ -308,49 +308,49 @@ clear_stencil_bits() {
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: FrameBufferProperties::set_multisample_bits
|
||||
// Function: FrameBufferProperties::set_multisamples
|
||||
// Access: Published
|
||||
// Description: Specifies the minimum number of bits that are
|
||||
// Description: Specifies the minimum number of samples that are
|
||||
// required for the multisample buffer.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void FrameBufferProperties::
|
||||
set_multisample_bits(int multisample_bits) {
|
||||
_multisample_bits = multisample_bits;
|
||||
_specified |= S_multisample_bits;
|
||||
set_multisamples(int multisamples) {
|
||||
_multisamples = multisamples;
|
||||
_specified |= S_multisamples;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: FrameBufferProperties::get_multisample_bits
|
||||
// Function: FrameBufferProperties::get_multisamples
|
||||
// Access: Published
|
||||
// Description: Returns the number of bits specified for the multisample
|
||||
// buffer.
|
||||
// Description: Returns the number of samples specified for the
|
||||
// multisample buffer.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE int FrameBufferProperties::
|
||||
get_multisample_bits() const {
|
||||
return _multisample_bits;
|
||||
get_multisamples() const {
|
||||
return _multisamples;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: FrameBufferProperties::has_multisample_bits
|
||||
// Function: FrameBufferProperties::has_multisamples
|
||||
// Access: Published
|
||||
// Description: Returns true if the number of bits for the multisample
|
||||
// buffer has been specified, false otherwise.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool FrameBufferProperties::
|
||||
has_multisample_bits() const {
|
||||
return ((_specified & S_multisample_bits) != 0);
|
||||
has_multisamples() const {
|
||||
return ((_specified & S_multisamples) != 0);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: FrameBufferProperties::clear_multisample_bits
|
||||
// Function: FrameBufferProperties::clear_multisamples
|
||||
// Access: Published
|
||||
// Description: Removes the multisample_bits specification from the
|
||||
// Description: Removes the multisamples specification from the
|
||||
// properties.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void FrameBufferProperties::
|
||||
clear_multisample_bits() {
|
||||
_specified &= ~S_multisample_bits;
|
||||
_multisample_bits = 1;
|
||||
clear_multisamples() {
|
||||
_specified &= ~S_multisamples;
|
||||
_multisamples = 1;
|
||||
}
|
||||
|
||||
INLINE ostream &
|
||||
|
@ -44,7 +44,7 @@ operator = (const FrameBufferProperties ©) {
|
||||
_color_bits = copy._color_bits;
|
||||
_alpha_bits = copy._alpha_bits;
|
||||
_stencil_bits = copy._stencil_bits;
|
||||
_multisample_bits = copy._multisample_bits;
|
||||
_multisamples = copy._multisamples;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
@ -118,7 +118,7 @@ get_default() {
|
||||
props.set_color_bits(color_bits);
|
||||
props.set_alpha_bits(alpha_bits);
|
||||
props.set_stencil_bits(stencil_bits);
|
||||
props.set_multisample_bits(multisample_bits);
|
||||
props.set_multisamples(multisamples);
|
||||
|
||||
return props;
|
||||
}
|
||||
@ -137,7 +137,7 @@ operator == (const FrameBufferProperties &other) const {
|
||||
_color_bits == other._color_bits &&
|
||||
_alpha_bits == other._alpha_bits &&
|
||||
_stencil_bits == other._stencil_bits &&
|
||||
_multisample_bits == other._multisample_bits);
|
||||
_multisamples == other._multisamples);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
@ -156,7 +156,7 @@ clear() {
|
||||
_color_bits = 1;
|
||||
_alpha_bits = 1;
|
||||
_stencil_bits = 1;
|
||||
_multisample_bits = 1;
|
||||
_multisamples = 1;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
@ -183,8 +183,8 @@ add_properties(const FrameBufferProperties &other) {
|
||||
if (other.has_stencil_bits()) {
|
||||
set_stencil_bits(other.get_stencil_bits());
|
||||
}
|
||||
if (other.has_multisample_bits()) {
|
||||
set_multisample_bits(other.get_multisample_bits());
|
||||
if (other.has_multisamples()) {
|
||||
set_multisamples(other.get_multisamples());
|
||||
}
|
||||
}
|
||||
|
||||
@ -252,7 +252,7 @@ output(ostream &out) const {
|
||||
if (has_stencil_bits()) {
|
||||
out << "stencil_bits=" << get_stencil_bits() << " ";
|
||||
}
|
||||
if (has_multisample_bits()) {
|
||||
out << "multisample_bits=" << get_multisample_bits() << " ";
|
||||
if (has_multisamples()) {
|
||||
out << "multisamples=" << get_multisamples() << " ";
|
||||
}
|
||||
}
|
||||
|
@ -87,10 +87,10 @@ PUBLISHED:
|
||||
INLINE bool has_stencil_bits() const;
|
||||
INLINE void clear_stencil_bits();
|
||||
|
||||
INLINE void set_multisample_bits(int multisample_bits);
|
||||
INLINE int get_multisample_bits() const;
|
||||
INLINE bool has_multisample_bits() const;
|
||||
INLINE void clear_multisample_bits();
|
||||
INLINE void set_multisamples(int multisamples);
|
||||
INLINE int get_multisamples() const;
|
||||
INLINE bool has_multisamples() const;
|
||||
INLINE void clear_multisamples();
|
||||
|
||||
void add_properties(const FrameBufferProperties &other);
|
||||
|
||||
@ -106,7 +106,7 @@ private:
|
||||
S_color_bits = 0x0004,
|
||||
S_alpha_bits = 0x0008,
|
||||
S_stencil_bits = 0x0010,
|
||||
S_multisample_bits = 0x0020,
|
||||
S_multisamples = 0x0020,
|
||||
};
|
||||
|
||||
int _specified;
|
||||
@ -116,7 +116,7 @@ private:
|
||||
int _color_bits;
|
||||
int _alpha_bits;
|
||||
int _stencil_bits;
|
||||
int _multisample_bits;
|
||||
int _multisamples;
|
||||
};
|
||||
|
||||
INLINE ostream &operator << (ostream &out, const FrameBufferProperties &properties);
|
||||
|
@ -294,11 +294,11 @@ choose_fbconfig(FrameBufferProperties &properties) const {
|
||||
int want_color_bits = properties.get_color_bits();
|
||||
int want_alpha_bits = properties.get_alpha_bits();
|
||||
int want_stencil_bits = properties.get_stencil_bits();
|
||||
int want_multisample_bits = properties.get_multisample_bits();
|
||||
int want_multisamples = properties.get_multisamples();
|
||||
|
||||
GLXFBConfig fbconfig =
|
||||
try_for_fbconfig(frame_buffer_mode, want_depth_bits, want_color_bits,
|
||||
want_alpha_bits, want_stencil_bits, want_multisample_bits);
|
||||
want_alpha_bits, want_stencil_bits, want_multisamples);
|
||||
|
||||
if (fbconfig == None) {
|
||||
glxdisplay_cat.info()
|
||||
@ -365,7 +365,7 @@ choose_fbconfig(FrameBufferProperties &properties) const {
|
||||
if (tried_masks.insert(new_frame_buffer_mode).second) {
|
||||
fbconfig = try_for_fbconfig(new_frame_buffer_mode, want_depth_bits,
|
||||
want_color_bits, want_alpha_bits,
|
||||
want_stencil_bits, want_multisample_bits);
|
||||
want_stencil_bits, want_multisamples);
|
||||
|
||||
}
|
||||
}
|
||||
@ -456,7 +456,7 @@ choose_fbconfig(FrameBufferProperties &properties) const {
|
||||
properties.set_alpha_bits(alpha_size);
|
||||
properties.set_depth_bits(depth_size);
|
||||
properties.set_stencil_bits(stencil_size);
|
||||
properties.set_multisample_bits(samples);
|
||||
properties.set_multisamples(samples);
|
||||
|
||||
if (glxdisplay_cat.is_debug()) {
|
||||
glxdisplay_cat.debug()
|
||||
@ -489,7 +489,7 @@ GLXFBConfig glxGraphicsPipe::
|
||||
try_for_fbconfig(int framebuffer_mode,
|
||||
int want_depth_bits, int want_color_bits,
|
||||
int want_alpha_bits, int want_stencil_bits,
|
||||
int want_multisample_bits) const {
|
||||
int want_multisamples) const {
|
||||
static const int max_attrib_list = 32;
|
||||
int attrib_list[max_attrib_list];
|
||||
int n=0;
|
||||
@ -563,9 +563,11 @@ try_for_fbconfig(int framebuffer_mode,
|
||||
}
|
||||
|
||||
if (framebuffer_mode & FrameBufferProperties::FM_multisample) {
|
||||
glxdisplay_cat.debug(false) << " MULTISAMPLE(" << want_multisample_bits << ")";
|
||||
glxdisplay_cat.debug(false) << " MULTISAMPLE(" << want_multisamples << ")";
|
||||
attrib_list[n++] = GLX_SAMPLE_BUFFERS;
|
||||
attrib_list[n++] = 1;
|
||||
attrib_list[n++] = GLX_SAMPLES;
|
||||
attrib_list[n++] = want_multisample_bits;
|
||||
attrib_list[n++] = want_multisamples;
|
||||
}
|
||||
|
||||
// Terminate the list
|
||||
@ -625,11 +627,11 @@ choose_visual(FrameBufferProperties &properties) const {
|
||||
int want_color_bits = properties.get_color_bits();
|
||||
int want_alpha_bits = properties.get_alpha_bits();
|
||||
int want_stencil_bits = properties.get_stencil_bits();
|
||||
int want_multisample_bits = properties.get_multisample_bits();
|
||||
int want_multisamples = properties.get_multisamples();
|
||||
|
||||
XVisualInfo *visual =
|
||||
try_for_visual(frame_buffer_mode, want_depth_bits, want_color_bits,
|
||||
want_alpha_bits, want_stencil_bits, want_multisample_bits);
|
||||
want_alpha_bits, want_stencil_bits, want_multisamples);
|
||||
|
||||
if (visual == NULL) {
|
||||
glxdisplay_cat.info()
|
||||
@ -696,7 +698,7 @@ choose_visual(FrameBufferProperties &properties) const {
|
||||
if (tried_masks.insert(new_frame_buffer_mode).second) {
|
||||
visual = try_for_visual(new_frame_buffer_mode, want_depth_bits,
|
||||
want_color_bits, want_alpha_bits,
|
||||
want_stencil_bits, want_multisample_bits);
|
||||
want_stencil_bits, want_multisamples);
|
||||
|
||||
}
|
||||
}
|
||||
@ -785,7 +787,7 @@ choose_visual(FrameBufferProperties &properties) const {
|
||||
properties.set_alpha_bits(alpha_size);
|
||||
properties.set_depth_bits(depth_size);
|
||||
properties.set_stencil_bits(stencil_size);
|
||||
properties.set_multisample_bits(samples);
|
||||
properties.set_multisamples(samples);
|
||||
|
||||
if (glxdisplay_cat.is_debug()) {
|
||||
glxdisplay_cat.debug()
|
||||
@ -821,7 +823,7 @@ XVisualInfo *glxGraphicsPipe::
|
||||
try_for_visual(int framebuffer_mode,
|
||||
int want_depth_bits, int want_color_bits,
|
||||
int want_alpha_bits, int want_stencil_bits,
|
||||
int want_multisample_bits) const {
|
||||
int want_multisamples) const {
|
||||
static const int max_attrib_list = 32;
|
||||
int attrib_list[max_attrib_list];
|
||||
int n=0;
|
||||
@ -876,9 +878,9 @@ try_for_visual(int framebuffer_mode,
|
||||
}
|
||||
}
|
||||
if (framebuffer_mode & FrameBufferProperties::FM_multisample) {
|
||||
glxdisplay_cat.debug(false) << " MULTISAMPLE(" << want_multisample_bits << ")";
|
||||
glxdisplay_cat.debug(false) << " MULTISAMPLE(" << want_multisamples << ")";
|
||||
attrib_list[n++] = GLX_SAMPLES;
|
||||
attrib_list[n++] = want_multisample_bits;
|
||||
attrib_list[n++] = want_multisamples;
|
||||
}
|
||||
|
||||
// Terminate the list
|
||||
|
@ -110,7 +110,7 @@ private:
|
||||
int want_color_bits = 1,
|
||||
int want_alpha_bits = 1,
|
||||
int want_stencil_bits = 1,
|
||||
int want_multisample_bits = 1) const;
|
||||
int want_multisamples = 1) const;
|
||||
#endif
|
||||
|
||||
XVisualInfo *choose_visual(FrameBufferProperties &properties) const;
|
||||
@ -119,7 +119,7 @@ private:
|
||||
int want_color_bits = 1,
|
||||
int want_alpha_bits = 1,
|
||||
int want_stencil_bits = 1,
|
||||
int want_multisample_bits = 1) const;
|
||||
int want_multisamples = 1) const;
|
||||
|
||||
void make_hidden_cursor();
|
||||
void release_hidden_cursor();
|
||||
|
@ -289,7 +289,7 @@ make_pbuffer(HDC twindow_dc) {
|
||||
red_bits_i, green_bits_i, blue_bits_i, alpha_bits_i,
|
||||
accum_red_bits_i, accum_green_bits_i, accum_blue_bits_i,
|
||||
accum_alpha_bits_i, depth_bits_i,
|
||||
stencil_bits_i, multisample_bits_i;
|
||||
stencil_bits_i, multisamples_i;
|
||||
|
||||
iattrib_list[acceleration_i = ni++] = WGL_ACCELERATION_ARB;
|
||||
iattrib_list[pixel_type_i = ni++] = WGL_PIXEL_TYPE_ARB;
|
||||
@ -307,7 +307,7 @@ make_pbuffer(HDC twindow_dc) {
|
||||
iattrib_list[stencil_bits_i = ni++] = WGL_STENCIL_BITS_ARB;
|
||||
|
||||
if (wglgsg->_supports_wgl_multisample) {
|
||||
iattrib_list[multisample_bits_i = ni++] = WGL_SAMPLES_ARB;
|
||||
iattrib_list[multisamples_i = ni++] = WGL_SAMPLES_ARB;
|
||||
}
|
||||
|
||||
// Terminate the list.
|
||||
@ -356,7 +356,7 @@ make_pbuffer(HDC twindow_dc) {
|
||||
|
||||
if (wglgsg->_supports_wgl_multisample) {
|
||||
iattrib_list[ni++] = WGL_SAMPLES_ARB;
|
||||
iattrib_list[ni++] = ivalue_list[multisample_bits_i];
|
||||
iattrib_list[ni++] = ivalue_list[multisamples_i];
|
||||
}
|
||||
|
||||
// Match up properties.
|
||||
|
@ -293,7 +293,7 @@ choose_pfnum_advanced(const FrameBufferProperties &properties,
|
||||
int want_color_bits = properties.get_color_bits();
|
||||
int want_alpha_bits = properties.get_alpha_bits();
|
||||
int want_stencil_bits = properties.get_stencil_bits();
|
||||
int want_multisample_bits = properties.get_multisample_bits();
|
||||
int want_multisamples = properties.get_multisamples();
|
||||
|
||||
static const int max_attrib_list = 32;
|
||||
int iattrib_list[max_attrib_list];
|
||||
@ -357,7 +357,7 @@ choose_pfnum_advanced(const FrameBufferProperties &properties,
|
||||
iattrib_list[ni++] = WGL_SAMPLE_BUFFERS_ARB;
|
||||
iattrib_list[ni++] = 1;
|
||||
iattrib_list[ni++] = WGL_SAMPLES_ARB;
|
||||
iattrib_list[ni++] = want_multisample_bits;
|
||||
iattrib_list[ni++] = want_multisamples;
|
||||
}
|
||||
|
||||
// Terminate the lists.
|
||||
@ -650,7 +650,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, multisample_bits_i;
|
||||
stencil_bits_i, multisamples_i;
|
||||
|
||||
iattrib_list[acceleration_i = ni++] = WGL_ACCELERATION_ARB;
|
||||
iattrib_list[pixel_type_i = ni++] = WGL_PIXEL_TYPE_ARB;
|
||||
@ -663,7 +663,7 @@ get_properties_advanced(FrameBufferProperties &properties,
|
||||
iattrib_list[stencil_bits_i = ni++] = WGL_STENCIL_BITS_ARB;
|
||||
|
||||
if (wglgsg->_supports_wgl_multisample) {
|
||||
iattrib_list[multisample_bits_i = ni++] = WGL_SAMPLES_ARB;
|
||||
iattrib_list[multisamples_i = ni++] = WGL_SAMPLES_ARB;
|
||||
}
|
||||
|
||||
// Terminate the list.
|
||||
@ -706,9 +706,9 @@ get_properties_advanced(FrameBufferProperties &properties,
|
||||
properties.set_stencil_bits(ivalue_list[stencil_bits_i]);
|
||||
}
|
||||
if (wglgsg->_supports_wgl_multisample) {
|
||||
if (ivalue_list[multisample_bits_i] != 0) {
|
||||
if (ivalue_list[multisamples_i] != 0) {
|
||||
frame_buffer_mode |= FrameBufferProperties::FM_multisample;
|
||||
properties.set_multisample_bits(ivalue_list[multisample_bits_i]);
|
||||
properties.set_multisamples(ivalue_list[multisamples_i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user