mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-27 23:34:57 -04:00
glgsg: Fix clear of offscreen buffer if back buffers requested
This commit is contained in:
parent
b6ec48b27c
commit
122453811d
@ -16,6 +16,18 @@
|
||||
using std::max;
|
||||
using std::min;
|
||||
|
||||
/**
|
||||
* Returns a copy of the FrameBufferProperties, but without back buffers.
|
||||
* This is used since the GraphicsOutput constructor makes some decisions
|
||||
* based on whether this is set, so we need to unset it early.
|
||||
*/
|
||||
static FrameBufferProperties
|
||||
without_back_buffers(const FrameBufferProperties &fb_prop) {
|
||||
FrameBufferProperties copy(fb_prop);
|
||||
copy.set_back_buffers(0);
|
||||
return copy;
|
||||
}
|
||||
|
||||
TypeHandle CLP(GraphicsBuffer)::_type_handle;
|
||||
|
||||
/**
|
||||
@ -29,7 +41,7 @@ CLP(GraphicsBuffer)(GraphicsEngine *engine, GraphicsPipe *pipe,
|
||||
int flags,
|
||||
GraphicsStateGuardian *gsg,
|
||||
GraphicsOutput *host) :
|
||||
GraphicsBuffer(engine, pipe, name, fb_prop, win_prop, flags, gsg, host),
|
||||
GraphicsBuffer(engine, pipe, name, without_back_buffers(fb_prop), win_prop, flags, gsg, host),
|
||||
_bind_texture_pcollector(_draw_window_pcollector, "Bind textures"),
|
||||
_generate_mipmap_pcollector(_draw_window_pcollector, "Generate mipmaps"),
|
||||
_resolve_multisample_pcollector(_draw_window_pcollector, "Resolve multisamples"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user