mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
Match DX8 render to texture / framebuffer changes.
This commit is contained in:
parent
6474496071
commit
af04cf8f74
@ -202,7 +202,7 @@ prepare_texture(Texture *tex) {
|
|||||||
<< *dtc->get_texture() << " is stored in an unsupported compressed format.\n";
|
<< *dtc->get_texture() << " is stored in an unsupported compressed format.\n";
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dtc->create_texture(*_screen)) {
|
if (!dtc->create_texture(*_screen)) {
|
||||||
delete dtc;
|
delete dtc;
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -2531,9 +2531,8 @@ reset() {
|
|||||||
D3DDEVICE_CREATION_PARAMETERS creation_parameters;
|
D3DDEVICE_CREATION_PARAMETERS creation_parameters;
|
||||||
|
|
||||||
_supports_render_texture = false;
|
_supports_render_texture = false;
|
||||||
|
_screen->_render_to_texture_d3d_format = D3DFMT_UNKNOWN;
|
||||||
// default render to texture format
|
_screen->_framebuffer_d3d_format = D3DFMT_UNKNOWN;
|
||||||
_screen->_render_to_texture_d3d_format = D3DFMT_A8R8G8B8;
|
|
||||||
|
|
||||||
#define TOTAL_RENDER_TO_TEXTURE_FORMATS 3
|
#define TOTAL_RENDER_TO_TEXTURE_FORMATS 3
|
||||||
|
|
||||||
@ -2541,13 +2540,15 @@ reset() {
|
|||||||
{
|
{
|
||||||
D3DFMT_A8R8G8B8, // check for this format first
|
D3DFMT_A8R8G8B8, // check for this format first
|
||||||
D3DFMT_X8R8G8B8,
|
D3DFMT_X8R8G8B8,
|
||||||
(D3DFORMAT) 0, // place holder for _screen->_display_mode.Format
|
D3DFMT_UNKNOWN, // place holder for _screen->_display_mode.Format
|
||||||
};
|
};
|
||||||
|
|
||||||
render_to_texture_formats [TOTAL_RENDER_TO_TEXTURE_FORMATS - 1] = _screen->_display_mode.Format;
|
render_to_texture_formats [TOTAL_RENDER_TO_TEXTURE_FORMATS - 1] = _screen->_display_mode.Format;
|
||||||
|
|
||||||
hr = _d3d_device->GetCreationParameters (&creation_parameters);
|
hr = _d3d_device->GetCreationParameters (&creation_parameters);
|
||||||
if (SUCCEEDED (hr)) {
|
if (SUCCEEDED (hr)) {
|
||||||
|
_screen->_framebuffer_d3d_format = _screen->_display_mode.Format;
|
||||||
|
|
||||||
int index;
|
int index;
|
||||||
for (index = 0; index < TOTAL_RENDER_TO_TEXTURE_FORMATS; index++) {
|
for (index = 0; index < TOTAL_RENDER_TO_TEXTURE_FORMATS; index++) {
|
||||||
hr = _screen->_d3d9->CheckDeviceFormat (
|
hr = _screen->_d3d9->CheckDeviceFormat (
|
||||||
|
@ -202,6 +202,9 @@ struct DXScreenData {
|
|||||||
D3DPRESENT_PARAMETERS _presentation_params; // not redundant with _display_mode since width/height must be 0 for windowed mode
|
D3DPRESENT_PARAMETERS _presentation_params; // not redundant with _display_mode since width/height must be 0 for windowed mode
|
||||||
D3DADAPTER_IDENTIFIER9 _dx_device_id;
|
D3DADAPTER_IDENTIFIER9 _dx_device_id;
|
||||||
D3DFORMAT _render_to_texture_d3d_format;
|
D3DFORMAT _render_to_texture_d3d_format;
|
||||||
|
D3DFORMAT _framebuffer_d3d_format;
|
||||||
|
|
||||||
|
DXGraphicsStateGuardian9 *_dxgsg9;
|
||||||
|
|
||||||
int _managed_textures;
|
int _managed_textures;
|
||||||
int _managed_vertex_buffers;
|
int _managed_vertex_buffers;
|
||||||
@ -209,8 +212,6 @@ struct DXScreenData {
|
|||||||
|
|
||||||
bool _supports_dynamic_textures;
|
bool _supports_dynamic_textures;
|
||||||
bool _supports_automatic_mipmap_generation;
|
bool _supports_automatic_mipmap_generation;
|
||||||
|
|
||||||
DXGraphicsStateGuardian9 *_dxgsg9;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user