mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
Give the option to pass in FrameBufferProperties for make_texture_buffer and cubemap texture buffer.
This commit is contained in:
parent
35bcb0c6cd
commit
42daadfeb4
@ -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.
|
||||
|
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user