From c6a29ade179e71ab66b98bf8d3dfe2b07a42b4e4 Mon Sep 17 00:00:00 2001 From: Krylov Yaroslav Date: Thu, 30 May 2019 12:58:32 +0300 Subject: [PATCH] vivante fullscreen support added --- src/vivante_init.c | 15 +++++++++++++-- src/vivante_window.c | 21 ++++++++++++++++++++- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/src/vivante_init.c b/src/vivante_init.c index 3de1e1fec..55a57e607 100644 --- a/src/vivante_init.c +++ b/src/vivante_init.c @@ -27,6 +27,15 @@ #include "internal.h" +void _glfwInitFbMonitor(void) +{ + int width, height; + fbGetDisplayGeometry(_glfw.vivante.display, &width, &height); + + _glfwInputMonitor(_glfwAllocMonitor("Display", width, height), + GLFW_CONNECTED, + _GLFW_INSERT_FIRST); +} ////////////////////////////////////////////////////////////////////////// ////// GLFW platform API ////// @@ -91,11 +100,13 @@ int _glfwPlatformInit(void) return GLFW_FALSE; } - _glfwInitTimerPOSIX(); - if (!_glfwInitJoysticksLinux()) return GLFW_FALSE; + _glfwInitTimerPOSIX(); + + _glfwInitFbMonitor(); + return GLFW_TRUE; } diff --git a/src/vivante_window.c b/src/vivante_window.c index 5ad13974c..9e6bbe703 100644 --- a/src/vivante_window.c +++ b/src/vivante_window.c @@ -42,7 +42,14 @@ static int queryWindowGeometry(_GLFWwindow* window ) static int createNativeWindow(_GLFWwindow* window, const _GLFWwndconfig* wndconfig) { - window->vivante.native_window = fbCreateWindow(_GLFW_EGL_NATIVE_DISPLAY, 0, 0, 0, 0);//, wndconfig->width, wndconfig->height); + int width = wndconfig->width; + int height = wndconfig->height; + if (window->monitor) + { + width = window->monitor->widthMM; + height = window->monitor->heightMM; + } + window->vivante.native_window = fbCreateWindow(_GLFW_EGL_NATIVE_DISPLAY, 0, 0, width, height); if (!window->vivante.native_window) return GLFW_FALSE; @@ -115,6 +122,10 @@ void _glfwPlatformSetWindowMonitor(_GLFWwindow* window, void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos) { + if (xpos) + *xpos = window->vivante.xpos; + if (ypos) + *ypos = window->vivante.ypos; } void _glfwPlatformSetWindowPos(_GLFWwindow* window, int xpos, int ypos) @@ -155,6 +166,14 @@ void _glfwPlatformGetWindowFrameSize(_GLFWwindow* window, int* left, int* top, int* right, int* bottom) { + if (left) + *left = 0; + if (top) + *top = 0; + if (right) + *right = 0; + if (bottom) + *bottom = 0; } void _glfwPlatformGetWindowContentScale(_GLFWwindow* window,