added GetWindowHandle[GL/Native]

This commit is contained in:
Julianiolo 2021-06-20 13:27:15 +02:00
parent d1ac38171c
commit a9d85b0c3b
5 changed files with 19 additions and 7 deletions

View File

@ -15,7 +15,8 @@ SetWindowPosition|void|(int x, int y);|
SetWindowMonitor|void|(int monitor);| SetWindowMonitor|void|(int monitor);|
SetWindowMinSize|void|(int width, int height);| SetWindowMinSize|void|(int width, int height);|
SetWindowSize|void|(int width, int height);| SetWindowSize|void|(int width, int height);|
GetWindowHandle|void *|(void);| GetWindowHandleGL|void *|(void);|
GetWindowHandleNative|void *|(void);|
GetScreenWidth|int|(void);| GetScreenWidth|int|(void);|
GetScreenHeight|int|(void);| GetScreenHeight|int|(void);|
GetMonitorCount|int|(void);| GetMonitorCount|int|(void);|

View File

@ -97,7 +97,10 @@
<Param name="int height" /> <Param name="int height" />
</Overload> </Overload>
</KeyWord> </KeyWord>
<KeyWord name="GetWindowHandle" func="yes"> <KeyWord name="GetWindowHandleGL" func="yes">
<Overload retVal="void" descr="Get opengl window handle"></Overload>
</KeyWord>
<KeyWord name="GetWindowHandleNative" func="yes">
<Overload retVal="void" descr="Get native window handle"></Overload> <Overload retVal="void" descr="Get native window handle"></Overload>
</KeyWord> </KeyWord>
<KeyWord name="GetScreenWidth" func="yes"> <KeyWord name="GetScreenWidth" func="yes">

View File

@ -26,7 +26,8 @@ RLAPI void SetWindowPosition(int x, int y); // Set window
RLAPI void SetWindowMonitor(int monitor); // Set monitor for the current window (fullscreen mode) RLAPI void SetWindowMonitor(int monitor); // Set monitor for the current window (fullscreen mode)
RLAPI void SetWindowMinSize(int width, int height); // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) RLAPI void SetWindowMinSize(int width, int height); // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)
RLAPI void SetWindowSize(int width, int height); // Set window dimensions RLAPI void SetWindowSize(int width, int height); // Set window dimensions
RLAPI void *GetWindowHandle(void); // Get native window handle RLAPI void *GetWindowHandleGL(void); // Get opengl window handle
RLAPI void *GetWindowHandleNative(void); // Get native window handle
RLAPI int GetScreenWidth(void); // Get current screen width RLAPI int GetScreenWidth(void); // Get current screen width
RLAPI int GetScreenHeight(void); // Get current screen height RLAPI int GetScreenHeight(void); // Get current screen height
RLAPI int GetMonitorCount(void); // Get number of connected monitors RLAPI int GetMonitorCount(void); // Get number of connected monitors

View File

@ -348,10 +348,10 @@ typedef struct { unsigned int width; unsigned int height; } Size;
typedef struct CoreData { typedef struct CoreData {
struct { struct {
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
GLFWwindow *handle; // Native window handle (graphic device) GLFWwindow *handle; // opengl window handle (graphic device)
#endif #endif
#if defined(PLATFORM_RPI) #if defined(PLATFORM_RPI)
EGL_DISPMANX_WINDOW_T handle; // Native window handle (graphic device) EGL_DISPMANX_WINDOW_T handle; // opengl window handle (graphic device)
#endif #endif
#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) || defined(PLATFORM_DRM) || defined(PLATFORM_UWP) #if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) || defined(PLATFORM_DRM) || defined(PLATFORM_UWP)
#if defined(PLATFORM_DRM) #if defined(PLATFORM_DRM)
@ -1467,8 +1467,14 @@ int GetScreenHeight(void)
return CORE.Window.currentFbo.height; return CORE.Window.currentFbo.height;
} }
// Get opengl window handle
void *GetWindowHandleGL(void)
{
return CORE.Window.handle;
}
// Get native window handle // Get native window handle
void *GetWindowHandle(void) void *GetWindowHandleNative(void)
{ {
#if defined(PLATFORM_DESKTOP) && defined(_WIN32) #if defined(PLATFORM_DESKTOP) && defined(_WIN32)
// NOTE: Returned handle is: void *HWND (windows.h) // NOTE: Returned handle is: void *HWND (windows.h)

View File

@ -936,7 +936,8 @@ RLAPI void SetWindowPosition(int x, int y); // Set window
RLAPI void SetWindowMonitor(int monitor); // Set monitor for the current window (fullscreen mode) RLAPI void SetWindowMonitor(int monitor); // Set monitor for the current window (fullscreen mode)
RLAPI void SetWindowMinSize(int width, int height); // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) RLAPI void SetWindowMinSize(int width, int height); // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)
RLAPI void SetWindowSize(int width, int height); // Set window dimensions RLAPI void SetWindowSize(int width, int height); // Set window dimensions
RLAPI void *GetWindowHandle(void); // Get native window handle RLAPI void *GetWindowHandleGL(void); // Get native window handle
RLAPI void *GetWindowHandleNative(void); // Get native window handle
RLAPI int GetScreenWidth(void); // Get current screen width RLAPI int GetScreenWidth(void); // Get current screen width
RLAPI int GetScreenHeight(void); // Get current screen height RLAPI int GetScreenHeight(void); // Get current screen height
RLAPI int GetMonitorCount(void); // Get number of connected monitors RLAPI int GetMonitorCount(void); // Get number of connected monitors