2362N/A * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. 430N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 430N/A * This code is free software; you can redistribute it and/or modify it 430N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 430N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 430N/A * This code is distributed in the hope that it will be useful, but WITHOUT 430N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 430N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 430N/A * version 2 for more details (a copy is included in the LICENSE file that 430N/A * accompanied this code). 430N/A * You should have received a copy of the GNU General Public License version 430N/A * 2 along with this work; if not, write to the Free Software Foundation, 430N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 430N/A * This class implements D3D-specific functionality, such as fullscreen 430N/A * exclusive mode and display changes. It is kept separate from 430N/A * Win32GraphicsDevice to help avoid overburdening the parent class. 430N/A // loading the library doesn't help because we need the 430N/A // toolkit thread running, so we have to call getDefaultToolkit() 430N/A // we don't use pixel formats for the d3d pipeline 430N/A * Used to construct a Direct3D-enabled GraphicsDevice. 430N/A * @return a D3DGraphicsDevice if it could be created 430N/A * successfully, null otherwise. 430N/A // could not initialize the device successfully 430N/A * Returns true if d3d pipeline has been successfully initialized. 430N/A * @return true if d3d pipeline is initialized, false otherwise 430N/A * Return the owning Frame for a given Window. Used in setFSWindow below 430N/A * to set the properties of the owning Frame when a Window goes 430N/A * into fullscreen mode. 430N/A // could get here if passed Window is an owner-less Dialog 430N/A * WindowAdapter class for the full-screen frame, responsible for 430N/A * restoring the devices. This is important to do because unless the device 430N/A * is restored it will not go back into the FS mode once alt+tabbed out. 430N/A * This is a problem for windows for which we do not do any d3d-related 430N/A * operations (like when we disabled on-screen rendering). 430N/A * REMIND: we create an instance per each full-screen device while a single 430N/A * instance would suffice (but requires more management). 430N/A // if the window is not a toplevel (has an owner) we have to use the 430N/A // real toplevel to enter the full-screen mode with (4933099). 430N/A // we use operations on peer instead of component because calling 430N/A // them on component will take the tree lock 430N/A * Bug 4933099: There is some funny-business to deal with when this 430N/A * method is called with a Window instead of a Frame. See 4836744 430N/A * for more information on this. One side-effect of our workaround 430N/A * for the problem is that the owning Frame of a Window may end 430N/A * up getting resized during the fullscreen process. When we 430N/A * return from fullscreen mode, we should resize the Frame to 430N/A * its original size (just like the Window is being resized 430N/A * to its original size in GraphicsDevice). 430N/A // if the window went into fs mode before it was realized it 430N/A // could have (0,0) dimensions 430N/A // we entered fs mode via gdi 430N/A // REMIND: we do this before we switch the display mode, so 430N/A // the dimensions may be exceeding the dimensions of the screen, 430N/A // update the bounds of the owner frame 430N/A // REMIND: do we really need a window here? 430N/A // we should probably just use the current one 430N/A // REMIND: this method is not used now, we use caps instead 430N/A // REMIND: should we cache the result per device somehow, 430N/A // and then reset and retry it on display change? 430N/A // REMIND: make sure this works when the device is lost and we don't 430N/A // disable d3d too eagerly 430N/A // REMIND: this is a bit excessive, isD3DEnabledOnDevice will return 430N/A // false anyway because the device is invalid