From 42daadfeb4e7d687f91a32240778c3113d85b780 Mon Sep 17 00:00:00 2001 From: aignacio_sf <> Date: Wed, 17 Sep 2008 20:57:16 +0000 Subject: [PATCH] Give the option to pass in FrameBufferProperties for make_texture_buffer and cubemap texture buffer. --- panda/src/display/graphicsOutput.cxx | 13 +++++++++---- panda/src/display/graphicsOutput.h | 4 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/panda/src/display/graphicsOutput.cxx b/panda/src/display/graphicsOutput.cxx index 381cc039ed..b613d8beab 100644 --- a/panda/src/display/graphicsOutput.cxx +++ b/panda/src/display/graphicsOutput.cxx @@ -732,11 +732,16 @@ get_texture_card() { //////////////////////////////////////////////////////////////////// GraphicsOutput *GraphicsOutput:: make_texture_buffer(const string &name, int x_size, int y_size, - Texture *tex, bool to_ram) { + Texture *tex, bool to_ram, FrameBufferProperties *fbp) { + FrameBufferProperties props; props.set_rgb_color(1); props.set_depth_bits(1); + if (fbp == NULL) { + fbp = &props; + } + int flags = GraphicsPipe::BF_refuse_window; if (textures_power_2 != ATS_none) { flags |= GraphicsPipe::BF_size_power_2; @@ -749,7 +754,7 @@ make_texture_buffer(const string &name, int x_size, int y_size, GraphicsOutput *buffer = get_gsg()->get_engine()-> make_output(get_gsg()->get_pipe(), name, get_child_sort(), - props, WindowProperties::size(x_size, y_size), + *fbp, WindowProperties::size(x_size, y_size), flags, get_gsg(), get_host()); if (buffer != (GraphicsOutput *)NULL) { @@ -784,7 +789,7 @@ make_texture_buffer(const string &name, int x_size, int y_size, //////////////////////////////////////////////////////////////////// GraphicsOutput *GraphicsOutput:: make_cube_map(const string &name, int size, NodePath &camera_rig, - DrawMask camera_mask, bool to_ram) { + DrawMask camera_mask, bool to_ram, FrameBufferProperties *fbp) { if (!to_ram) { // Check the limits imposed by the GSG. (However, if we're // rendering the texture to RAM only, these limits may be @@ -815,7 +820,7 @@ make_cube_map(const string &name, int size, NodePath &camera_rig, tex->set_wrap_v(Texture::WM_clamp); GraphicsOutput *buffer; - buffer = make_texture_buffer(name, size, size, tex, to_ram); + buffer = make_texture_buffer(name, size, size, tex, to_ram, fbp); // We don't need to clear the overall buffer; instead, we'll clear // each display region. diff --git a/panda/src/display/graphicsOutput.h b/panda/src/display/graphicsOutput.h index 71732dfd47..a9b7f02f5d 100644 --- a/panda/src/display/graphicsOutput.h +++ b/panda/src/display/graphicsOutput.h @@ -154,11 +154,11 @@ PUBLISHED: GraphicsOutput *make_texture_buffer( const string &name, int x_size, int y_size, - Texture *tex = NULL, bool to_ram = false); + Texture *tex = NULL, bool to_ram = false, FrameBufferProperties *fbp = NULL); GraphicsOutput *make_cube_map(const string &name, int size, NodePath &camera_rig, DrawMask camera_mask = PandaNode::get_all_camera_mask(), - bool to_ram = false); + bool to_ram = false, FrameBufferProperties *fbp = NULL); INLINE static Filename make_screenshot_filename( const string &prefix = "screenshot");