blob: 9dd7575881e944f6d3f68a58af0ea5d1663d4942 [file] [log] [blame]
Hernan Liatisc6eb41b2019-02-22 11:12:59 -08001// you may not use this file except in compliance with the License.
2// You may obtain a copy of the License at
3//
4// http://www.apache.org/licenses/LICENSE-2.0
5//
6// Unless required by applicable law or agreed to in writing, software
7// distributed under the License is distributed on an "AS IS" BASIS,
8// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9// See the License for the specific language governing permissions and
10// limitations under the License.
11
12#include "XlibSurfaceKHR.hpp"
13
14namespace vk {
15
16XlibSurfaceKHR::XlibSurfaceKHR(const VkXlibSurfaceCreateInfoKHR *pCreateInfo, void *mem) :
17 pDisplay(pCreateInfo->dpy),
18 window(pCreateInfo->window) {
19
20}
21
22void XlibSurfaceKHR::destroySurface(const VkAllocationCallbacks *pAllocator) {
23
24}
25
26size_t XlibSurfaceKHR::ComputeRequiredAllocationSize(const VkXlibSurfaceCreateInfoKHR *pCreateInfo) {
27 return 0;
28}
29
30void XlibSurfaceKHR::getSurfaceCapabilities(VkSurfaceCapabilitiesKHR *pSurfaceCapabilities) const {
31 SurfaceKHR::getSurfaceCapabilities(pSurfaceCapabilities);
32
33 XWindowAttributes attr;
34 libX11->XGetWindowAttributes(pDisplay, window, &attr);
35 VkExtent2D extent = {static_cast<uint32_t>(attr.width), static_cast<uint32_t>(attr.height)};
36
37 pSurfaceCapabilities->currentExtent = extent;
38 pSurfaceCapabilities->minImageExtent = extent;
39 pSurfaceCapabilities->maxImageExtent = extent;
40}
41
42}