mirror of
https://github.com/raysan5/raylib.git
synced 2026-02-20 20:49:17 -05:00
Compare commits
3 Commits
a6fa8b9ff4
...
c0829bc69e
| Author | SHA1 | Date | |
|---|---|---|---|
| c0829bc69e | |||
| 5a36ce5e7c | |||
| b29d6ee462 |
@ -78,7 +78,6 @@ Some people ported raylib to other languages in the form of bindings or wrappers
|
||||
| [raylib-rs](https://github.com/raylib-rs/raylib-rs) | **5.5** | [Rust](https://www.rust-lang.org) | Zlib |
|
||||
| [raylib-ruby](https://github.com/wilsonsilva/raylib-ruby) | 4.5 | [Ruby](https://www.ruby-lang.org) | Zlib |
|
||||
| [Relib](https://github.com/RedCubeDev-ByteSpace/Relib) | 3.5 | [ReCT](https://github.com/RedCubeDev-ByteSpace/ReCT) | **???** |
|
||||
| [ringraylib5](https://github.com/ring-lang/ring/tree/master/extensions/ringraylib5) | **5.0** | [Ring](https://ring-lang.github.io/) | **???** |
|
||||
| [racket-raylib](https://github.com/eutro/racket-raylib) | **5.5** | [Racket](https://racket-lang.org) | MIT/Apache-2.0 |
|
||||
| [raylib-swift](https://github.com/STREGAsGate/Raylib) | 4.0 | [Swift](https://swift.org) | MIT |
|
||||
| [raylib-scopes](https://github.com/salotz/raylib-scopes) | auto | [Scopes](http://scopes.rocks) | MIT |
|
||||
@ -87,6 +86,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers
|
||||
| [raylib-v](https://github.com/vlang/raylib) | 5.5 | [V](https://vlang.io) | MIT/Unlicense |
|
||||
| [raylib.v](https://github.com/irishgreencitrus/raylib.v) | 4.2 | [V](https://vlang.io) | Zlib |
|
||||
| [raylib-vapi](https://github.com/lxmcf/raylib-vapi) | **5.0** | [Vala](https://vala.dev) | Zlib |
|
||||
| [raylib-wave](https://github.com/wavefnd/raylib-wave) | **auto** |[Wave](http://wave-lang.dev) | Zlib |
|
||||
| [raylib-wren](https://github.com/TSnake41/raylib-wren) | 4.5 | [Wren](http://wren.io) | ISC |
|
||||
| [raylib-zig](https://github.com/raylib-zig/raylib-zig) | **5.6-dev** | [Zig](https://ziglang.org) | MIT |
|
||||
| [raylib.zig](https://github.com/ryupold/raylib.zig) | **5.1-dev** | [Zig](https://ziglang.org) | MIT |
|
||||
@ -95,6 +95,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers
|
||||
| [raylib-sunder](https://github.com/ashn-dot-dev/raylib-sunder) | **auto** | [Sunder](https://github.com/ashn-dot-dev/sunder) | 0BSD |
|
||||
| [raylib-bqn](https://github.com/Brian-ED/raylib-bqn) | **5.0** | [BQN](https://mlochbaum.github.io/BQN) | MIT |
|
||||
| [rayjs](https://github.com/mode777/rayjs) | 4.6-dev | [QuickJS](https://bellard.org/quickjs) | MIT |
|
||||
| [rayjule](https://github.com/SabeDoesThings/rayjule) | **5.5** | [Jule](https://jule.dev/) | MIT |
|
||||
| [raylib-raku](https://github.com/vushu/raylib-raku) | **auto** | [Raku](https://www.raku.org) | Artistic License 2.0 |
|
||||
| [Raylib.lean](https://github.com/KislyjKisel/Raylib.lean) | **5.5-dev** | [Lean4](https://lean-lang.org) | BSD-3-Clause |
|
||||
| [raylib-cobol](https://codeberg.org/glowiak/raylib-cobol) | **auto** | [COBOL](https://gnucobol.sourceforge.io) | Public domain |
|
||||
@ -103,6 +104,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers
|
||||
| [fnl-raylib](https://github.com/0riginaln0/fnl-raylib) | **5.5** | [Fennel](https://fennel-lang.org/) | MIT |
|
||||
| [Rayua](https://github.com/uiua-lang/rayua) | **5.5** | [Uiua](https://www.uiua.org/) | **???** |
|
||||
|
||||
|
||||
### Utility Wrapers
|
||||
|
||||
These are utility wrappers for specific languages, they are not required to use raylib in the language but may adapt the raylib API to be more inline with the language's paradigm.
|
||||
@ -183,4 +185,4 @@ Missing some language or wrapper? Feel free to create a new one! :)
|
||||
|
||||
Usually, raylib bindings follow the convention: `raylib-{language}`
|
||||
|
||||
Let me know if you're writing a new binding for raylib, I will list it here!
|
||||
Let me know if you're writing a new binding for raylib, I will list it here!
|
||||
@ -156,8 +156,6 @@ static PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB = NULL;
|
||||
// Flags that have no operations to perform during an update
|
||||
#define FLAG_MASK_NO_UPDATE (FLAG_WINDOW_HIGHDPI | FLAG_MSAA_4X_HINT)
|
||||
|
||||
#define WM_APP_UPDATE_WINDOW_SIZE (WM_APP + 1)
|
||||
|
||||
#define WGL_DRAW_TO_WINDOW_ARB 0x2001
|
||||
#define WGL_ACCELERATION_ARB 0x2003
|
||||
#define WGL_SUPPORT_OPENGL_ARB 0x2010
|
||||
@ -426,9 +424,7 @@ static bool UpdateWindowSize(int mode, HWND hwnd, int width, int height, unsigne
|
||||
else swpFlags |= SWP_NOMOVE;
|
||||
|
||||
// WARNING: This code must be called after swInit() has been called, after InitPlatform() in [rcore]
|
||||
//RECT rc = {0, 0, desired.cx, desired.cy};
|
||||
//AdjustWindowRectEx(&rc, WS_OVERLAPPEDWINDOW, FALSE, 0);
|
||||
//SetWindowPos(hwnd, NULL, windowPos.x, windowPos.y, rc.right - rc.left, rc.bottom - rc.top, SWP_NOMOVE | SWP_NOZORDER);
|
||||
SetWindowPos(hwnd, NULL, windowPos.x, windowPos.y, windowSize.cx, windowSize.cy, SWP_NOMOVE | SWP_NOZORDER);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -976,25 +972,40 @@ void SetWindowMonitor(int monitor)
|
||||
// Set window minimum dimensions (FLAG_WINDOW_RESIZABLE)
|
||||
void SetWindowMinSize(int width, int height)
|
||||
{
|
||||
TRACELOG(LOG_WARNING, "SetWindowMinSize not implemented");
|
||||
if ((width > CORE.Window.screenMax.width) || (height > CORE.Window.screenMax.height))
|
||||
{
|
||||
TRACELOG(LOG_WARNING, "WIN32: WINDOW: Cannot set minimum screen size higher than the maximum");
|
||||
return;
|
||||
}
|
||||
|
||||
CORE.Window.screenMin.width = width;
|
||||
CORE.Window.screenMin.height = height;
|
||||
|
||||
SetWindowSize(platform.appScreenWidth, platform.appScreenHeight);
|
||||
}
|
||||
|
||||
// Set window maximum dimensions (FLAG_WINDOW_RESIZABLE)
|
||||
void SetWindowMaxSize(int width, int height)
|
||||
{
|
||||
TRACELOG(LOG_WARNING, "SetWindowMaxSize not implemented");
|
||||
if ((width < CORE.Window.screenMin.width) || (height < CORE.Window.screenMin.height))
|
||||
{
|
||||
TRACELOG(LOG_WARNING, "WIN32: WINDOW: Cannot set maximum screen size lower than the minimum");
|
||||
return;
|
||||
}
|
||||
|
||||
CORE.Window.screenMax.width = width;
|
||||
CORE.Window.screenMax.height = height;
|
||||
|
||||
SetWindowSize(platform.appScreenWidth, platform.appScreenHeight);
|
||||
}
|
||||
|
||||
// Set window dimensions
|
||||
void SetWindowSize(int width, int height)
|
||||
{
|
||||
TRACELOG(LOG_WARNING, "SetWindowSize not implemented");
|
||||
int screenWidth = fmaxf(CORE.Window.screenMin.width, fminf(CORE.Window.screenMax.width, width));
|
||||
int screenHeight = fmaxf(CORE.Window.screenMin.height, fminf(CORE.Window.screenMax.height, height));
|
||||
|
||||
UpdateWindowSize(1, platform.hwnd, screenWidth, screenHeight, platform.desiredFlags);
|
||||
}
|
||||
|
||||
// Set window opacity, value opacity is between 0.0 and 1.0
|
||||
@ -1494,7 +1505,8 @@ int InitPlatform(void)
|
||||
|
||||
// NOTE: From this point CORE.Window.flags should always reflect the actual state of the window
|
||||
CORE.Window.flags = FLAG_WINDOW_HIDDEN | (platform.desiredFlags & FLAG_MASK_NO_UPDATE);
|
||||
|
||||
CORE.Window.screenMax.width = 9999;
|
||||
CORE.Window.screenMax.height = 9999;
|
||||
/*
|
||||
// TODO: Review SetProcessDpiAwarenessContext()
|
||||
// NOTE: SetProcessDpiAwarenessContext() requires Windows 10, version 1703 and shcore.lib linkage
|
||||
@ -1747,14 +1759,27 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpara
|
||||
} break;
|
||||
case WM_SIZING:
|
||||
{
|
||||
if (CORE.Window.flags & FLAG_WINDOW_RESIZABLE)
|
||||
{
|
||||
// TODO: Enforce min/max size
|
||||
}
|
||||
else TRACELOG(LOG_WARNING, "WIN32: WINDOW: Trying to resize a non-resizable window");
|
||||
if (!(CORE.Window.flags & FLAG_WINDOW_RESIZABLE))
|
||||
TRACELOG(LOG_WARNING, "WIN32: WINDOW: Trying to resize a non-resizable window");
|
||||
|
||||
result = TRUE;
|
||||
} break;
|
||||
case WM_GETMINMAXINFO:
|
||||
{
|
||||
DWORD style = MakeWindowStyle(platform.desiredFlags);
|
||||
SIZE maxClientSize = { CORE.Window.screenMax.width, CORE.Window.screenMax.height };
|
||||
SIZE maxWindowSize = CalcWindowSize(96, maxClientSize, style);
|
||||
SIZE minClientSize = { CORE.Window.screenMin.width, CORE.Window.screenMin.height };
|
||||
SIZE minWindowSize = CalcWindowSize(96, minClientSize, style);
|
||||
|
||||
LPMINMAXINFO lpmmi = (LPMINMAXINFO) lparam;
|
||||
lpmmi->ptMaxSize.x = maxWindowSize.cx;
|
||||
lpmmi->ptMaxSize.y = maxWindowSize.cy;
|
||||
lpmmi->ptMaxTrackSize.x = maxWindowSize.cx;
|
||||
lpmmi->ptMaxTrackSize.y = maxWindowSize.cy;
|
||||
lpmmi->ptMinTrackSize.x = minWindowSize.cx;
|
||||
lpmmi->ptMinTrackSize.y = minWindowSize.cy;
|
||||
} break;
|
||||
case WM_STYLECHANGING:
|
||||
{
|
||||
if (wparam == GWL_STYLE)
|
||||
@ -1960,10 +1985,6 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpara
|
||||
} break;
|
||||
case WM_MOUSEWHEEL: CORE.Input.Mouse.currentWheelMove.y = ((float)GET_WHEEL_DELTA_WPARAM(wparam))/WHEEL_DELTA; break;
|
||||
case WM_MOUSEHWHEEL: CORE.Input.Mouse.currentWheelMove.x = ((float)GET_WHEEL_DELTA_WPARAM(wparam))/WHEEL_DELTA; break;
|
||||
case WM_APP_UPDATE_WINDOW_SIZE:
|
||||
{
|
||||
//UpdateWindowSize(UPDATE_WINDOW_NORMAL, hwnd, platform.appScreenWidth, platform.appScreenHeight, CORE.Window.flags);
|
||||
} break;
|
||||
|
||||
default: result = DefWindowProcW(hwnd, msg, wparam, lparam); // Message passed directly for execution (default behaviour)
|
||||
}
|
||||
@ -2045,12 +2066,10 @@ static void HandleWindowResize(HWND hwnd, int *width, int *height)
|
||||
GetClientRect(hwnd, &rect);
|
||||
SIZE clientSize = { rect.right, rect.bottom };
|
||||
|
||||
// TODO: Update framebuffer on resize
|
||||
CORE.Window.currentFbo.width = (int)clientSize.cx;
|
||||
CORE.Window.currentFbo.height = (int)clientSize.cy;
|
||||
//SetupViewport(0, 0, clientSize.cx, clientSize.cy);
|
||||
|
||||
SetupViewport(clientSize.cx, clientSize.cy);
|
||||
|
||||
CORE.Window.resizedLastFrame = true;
|
||||
float dpiScale = ((float)GetDpiForWindow(hwnd))/96.0f;
|
||||
bool highdpi = !!(CORE.Window.flags & FLAG_WINDOW_HIGHDPI);
|
||||
|
||||
Reference in New Issue
Block a user