mirror of
https://github.com/raysan5/raylib.git
synced 2026-04-26 16:47:25 -04:00
[rlsw] Some platform fixes (#5720)
* fix drm with rlsw * fix window resizing with sdl * fix window resizing with win32
This commit is contained in:
@ -1528,6 +1528,10 @@ void PollInputEvents(void)
|
|||||||
if ((width + borderLeft + borderRight != usableBounds.w) && (height + borderTop + borderBottom != usableBounds.h)) FLAG_CLEAR(CORE.Window.flags, FLAG_WINDOW_MAXIMIZED);
|
if ((width + borderLeft + borderRight != usableBounds.w) && (height + borderTop + borderBottom != usableBounds.h)) FLAG_CLEAR(CORE.Window.flags, FLAG_WINDOW_MAXIMIZED);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(GRAPHICS_API_OPENGL_SOFTWARE)
|
||||||
|
swResize(width, height);
|
||||||
|
#endif
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case SDL_WINDOWEVENT_ENTER: CORE.Input.Mouse.cursorOnScreen = true; break;
|
case SDL_WINDOWEVENT_ENTER: CORE.Input.Mouse.cursorOnScreen = true; break;
|
||||||
|
|||||||
@ -2091,6 +2091,10 @@ static void HandleWindowResize(HWND hwnd, int *width, int *height)
|
|||||||
|
|
||||||
CORE.Window.screenScale = MatrixScale( (float)CORE.Window.render.width/CORE.Window.screen.width,
|
CORE.Window.screenScale = MatrixScale( (float)CORE.Window.render.width/CORE.Window.screen.width,
|
||||||
(float)CORE.Window.render.height/CORE.Window.screen.height, 1.0f);
|
(float)CORE.Window.render.height/CORE.Window.screen.height, 1.0f);
|
||||||
|
|
||||||
|
#if defined(GRAPHICS_API_OPENGL_SOFTWARE)
|
||||||
|
swResize(clientSize.cx, clientSize.cy);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update window style
|
// Update window style
|
||||||
|
|||||||
@ -837,14 +837,8 @@ void SwapScreenBuffer(void)
|
|||||||
uint32_t height = mode->vdisplay;
|
uint32_t height = mode->vdisplay;
|
||||||
|
|
||||||
// Dumb buffers use a fixed format based on bpp
|
// Dumb buffers use a fixed format based on bpp
|
||||||
#if SW_COLOR_BUFFER_BITS == 24
|
|
||||||
const uint32_t bpp = 32; // 32 bits per pixel (XRGB8888 format)
|
const uint32_t bpp = 32; // 32 bits per pixel (XRGB8888 format)
|
||||||
const uint32_t depth = 24; // Color depth, here only 24 bits, alpha is not used
|
const uint32_t depth = 24; // Color depth, here only 24 bits, alpha is not used
|
||||||
#else
|
|
||||||
// REVIEW: Not sure how it will be interpreted (RGB or RGBA?)
|
|
||||||
const uint32_t bpp = SW_COLOR_BUFFER_BITS;
|
|
||||||
const uint32_t depth = SW_COLOR_BUFFER_BITS;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Create a dumb buffer for software rendering
|
// Create a dumb buffer for software rendering
|
||||||
struct drm_mode_create_dumb creq = { 0 };
|
struct drm_mode_create_dumb creq = { 0 };
|
||||||
@ -899,7 +893,7 @@ void SwapScreenBuffer(void)
|
|||||||
|
|
||||||
// Copy the software rendered buffer to the dumb buffer with scaling if needed
|
// Copy the software rendered buffer to the dumb buffer with scaling if needed
|
||||||
// NOTE: RLSW will make a simple copy if the dimensions match
|
// NOTE: RLSW will make a simple copy if the dimensions match
|
||||||
swBlitFramebuffer(0, 0, width, height, 0, 0, width, height, SW_RGBA, SW_UNSIGNED_BYTE, dumbBuffer);
|
swBlitPixels(0, 0, width, height, 0, 0, width, height, SW_RGBA, SW_UNSIGNED_BYTE, dumbBuffer);
|
||||||
|
|
||||||
// Unmap the buffer
|
// Unmap the buffer
|
||||||
munmap(dumbBuffer, creq.size);
|
munmap(dumbBuffer, creq.size);
|
||||||
|
|||||||
Reference in New Issue
Block a user