Browse Source

toontown windowed mode supported in Dx8 and Dx9

Asad M. Zaman 22 years ago
parent
commit
0f5c46313c

+ 3 - 0
panda/src/display/config_display.cxx

@@ -67,6 +67,9 @@ const bool auto_flip = config_display.GetBool("auto-flip", true);
 // This indicates if you want multiple window support for same GSG
 const bool multiple_windows = config_display.GetBool("multiple-windows", false);
 
+// This indicates if you want window_and_fullscreen support for same GSG
+const bool window_and_fullscreen = config_display.GetBool("window-and-fullscreen", false);
+
 // Set this true to yield the timeslice at the end of the frame to be
 // more polite to other applications that are trying to run.
 const bool yield_timeslice = config_display.GetBool("yield-timeslice", false);

+ 2 - 0
panda/src/display/config_display.h

@@ -47,6 +47,8 @@ extern const bool prefer_single_buffer;
 
 extern EXPCL_PANDA const bool multiple_windows;
 
+extern EXPCL_PANDA const bool window_and_fullscreen;
+
 extern EXPCL_PANDA void init_libdisplay();
 
 #endif /* CONFIG_DISPLAY_H */

+ 2 - 2
panda/src/dxgsg8/wdxGraphicsPipe8.h

@@ -54,7 +54,7 @@ public:
 
   bool find_best_depth_format(DXScreenData &Display, D3DDISPLAYMODE &TestDisplayMode,
                        D3DFORMAT *pBestFmt, bool bWantStencil,
-                       bool bForce16bpp, bool bVerboseMode = true) const;
+                       bool bForce16bpp, bool bVerboseMode = false) const;
 
   void search_for_valid_displaymode(DXScreenData &scrn,
                              UINT RequestedX_Size, UINT RequestedY_Size,
@@ -63,7 +63,7 @@ public:
                              bool *pCouldntFindAnyValidZBuf,
                              D3DFORMAT *pSuggestedPixFmt,
                              bool bForce16bppZBuffer,
-                             bool bVerboseMode = true);
+                             bool bVerboseMode = false);
 
    bool special_check_fullscreen_resolution(DXScreenData &scrn, UINT x_size,UINT y_size);
 

+ 2 - 2
panda/src/dxgsg8/wdxGraphicsWindow8.cxx

@@ -1759,7 +1759,7 @@ open_window(void) {
   if(!choose_device()) {
     return false;
   }
-  if (dxgsg->get_pipe()->get_device() && !multiple_windows) {
+  if (dxgsg->get_pipe()->get_device() && !multiple_windows && !window_and_fullscreen) {
     wdxdisplay8_cat.error() 
       << "Could not create window; multiple window support not enabled.\n";
     return false;
@@ -1777,7 +1777,7 @@ open_window(void) {
   // call may be an extension to create multiple windows on same device
   // In that case just create an additional swapchain for this window
 
-  if (dxgsg->get_pipe()->get_device() == NULL) {
+  if (dxgsg->get_pipe()->get_device() == NULL || window_and_fullscreen) {
     wdxdisplay8_cat.debug() << "device is null \n";
 
     if (!create_screen_buffers_and_device(_wcontext, dx_force_16bpp_zbuffer))

+ 2 - 2
panda/src/dxgsg9/wdxGraphicsWindow9.cxx

@@ -1757,7 +1757,7 @@ open_window(void) {
   if(!choose_device()) {
       return false;
   }
-  if (dxgsg->get_pipe()->get_device() && !multiple_windows) {
+  if (dxgsg->get_pipe()->get_device() && !multiple_windows && !window_and_fullscreen) {
     wdxdisplay9_cat.error() 
       << "Could not create window; multiple window support not enabled.\n";
     return false;
@@ -1775,7 +1775,7 @@ open_window(void) {
   // call may be an extension to create multiple windows on same device
   // In that case just create an additional swapchain for this window
 
-  if (dxgsg->get_pipe()->get_device() == NULL) {
+  if (dxgsg->get_pipe()->get_device() == NULL || window_and_fullscreen) {
     wdxdisplay9_cat.debug() << "device is null \n";
 
     if (!create_screen_buffers_and_device(_wcontext, dx_force_16bpp_zbuffer))