added DrawCallback
This commit is contained in:
parent
ae230dae46
commit
274228f1e6
12
src/core.c
12
src/core.c
|
|
@ -387,6 +387,7 @@ typedef struct CoreData {
|
||||||
char **dropFilesPath; // Store dropped files paths as strings
|
char **dropFilesPath; // Store dropped files paths as strings
|
||||||
int dropFilesCount; // Count dropped files strings
|
int dropFilesCount; // Count dropped files strings
|
||||||
|
|
||||||
|
windowReSizeDrawCallB resizeDrawCallB;
|
||||||
} Window;
|
} Window;
|
||||||
#if defined(PLATFORM_ANDROID)
|
#if defined(PLATFORM_ANDROID)
|
||||||
struct {
|
struct {
|
||||||
|
|
@ -591,7 +592,7 @@ extern void UnloadFontDefault(void); // [Module: text] Unloads default fo
|
||||||
static void InitTimer(void); // Initialize timer (hi-resolution if available)
|
static void InitTimer(void); // Initialize timer (hi-resolution if available)
|
||||||
static bool InitGraphicsDevice(int width, int height); // Initialize graphics device
|
static bool InitGraphicsDevice(int width, int height); // Initialize graphics device
|
||||||
static void SetupFramebuffer(int width, int height); // Setup main framebuffer
|
static void SetupFramebuffer(int width, int height); // Setup main framebuffer
|
||||||
static void SetupViewport(int width, int height); // Set viewport for a provided width and height
|
void SetupViewport(int width, int height); // Set viewport for a provided width and height
|
||||||
|
|
||||||
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
|
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
|
||||||
static void ErrorCallback(int error, const char *description); // GLFW3 Error Callback, runs on GLFW3 error
|
static void ErrorCallback(int error, const char *description); // GLFW3 Error Callback, runs on GLFW3 error
|
||||||
|
|
@ -697,6 +698,8 @@ void InitWindow(int width, int height, const char *title)
|
||||||
CORE.Input.Mouse.cursor = MOUSE_CURSOR_ARROW;
|
CORE.Input.Mouse.cursor = MOUSE_CURSOR_ARROW;
|
||||||
CORE.Input.Gamepad.lastButtonPressed = -1;
|
CORE.Input.Gamepad.lastButtonPressed = -1;
|
||||||
|
|
||||||
|
CORE.Window.resizeDrawCallB = NULL;
|
||||||
|
|
||||||
#if defined(PLATFORM_ANDROID)
|
#if defined(PLATFORM_ANDROID)
|
||||||
CORE.Window.screen.width = width;
|
CORE.Window.screen.width = width;
|
||||||
CORE.Window.screen.height = height;
|
CORE.Window.screen.height = height;
|
||||||
|
|
@ -4835,6 +4838,13 @@ static void WindowSizeCallback(GLFWwindow *window, int width, int height)
|
||||||
CORE.Window.screen.height = height;
|
CORE.Window.screen.height = height;
|
||||||
// NOTE: Postprocessing texture is not scaled to new size
|
// NOTE: Postprocessing texture is not scaled to new size
|
||||||
|
|
||||||
|
if (CORE.Window.resizeDrawCallB != NULL) {
|
||||||
|
CORE.Window.resizeDrawCallB();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetWindowResizeDrawCallback(windowReSizeDrawCallB func) {
|
||||||
|
CORE.Window.resizeDrawCallB = func;
|
||||||
}
|
}
|
||||||
|
|
||||||
// GLFW3 WindowIconify Callback, runs when window is minimized/restored
|
// GLFW3 WindowIconify Callback, runs when window is minimized/restored
|
||||||
|
|
|
||||||
|
|
@ -493,6 +493,8 @@ typedef enum {
|
||||||
FLAG_INTERLACED_HINT = 0x00010000 // Set to try enabling interlaced video format (for V3D)
|
FLAG_INTERLACED_HINT = 0x00010000 // Set to try enabling interlaced video format (for V3D)
|
||||||
} ConfigFlags;
|
} ConfigFlags;
|
||||||
|
|
||||||
|
typedef void(*windowReSizeDrawCallB)(void);
|
||||||
|
|
||||||
// Trace log level
|
// Trace log level
|
||||||
// NOTE: Organized by priority level
|
// NOTE: Organized by priority level
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
|
@ -934,6 +936,8 @@ RLAPI Vector2 GetWindowScaleDPI(void); // Get window
|
||||||
RLAPI const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the primary monitor
|
RLAPI const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the primary monitor
|
||||||
RLAPI void SetClipboardText(const char *text); // Set clipboard text content
|
RLAPI void SetClipboardText(const char *text); // Set clipboard text content
|
||||||
RLAPI const char *GetClipboardText(void); // Get clipboard text content
|
RLAPI const char *GetClipboardText(void); // Get clipboard text content
|
||||||
|
RLAPI void SetupViewport(int width, int height);
|
||||||
|
RLAPI void SetWindowResizeDrawCallback(windowReSizeDrawCallB func)
|
||||||
|
|
||||||
// Custom frame control functions
|
// Custom frame control functions
|
||||||
// NOTE: Those functions are intended for advance users that want full control over the frame processing
|
// NOTE: Those functions are intended for advance users that want full control over the frame processing
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user