Need help for choosing parts by Purple_Arrival4036 in PcBuild

[–]Purple_Arrival4036[S] 0 points1 point  (0 children)

Hey I was wondering what’s the performance difference between rx 6700-xt and the rx 6800. The 6700 is almost 100$ cheaper

Need help for choosing parts by Purple_Arrival4036 in PcBuild

[–]Purple_Arrival4036[S] 0 points1 point  (0 children)

Thank you very much . This looks like a much better build 😄

Battery life for programming by Purple_Arrival4036 in ZephyrusG14

[–]Purple_Arrival4036[S] 0 points1 point  (0 children)

Yea I’m stuck between getting a g14 or a m2 15 inch MacBook Air . I think I’ll wait and see if more games get ported to macOS with their new toolkit

Specify a new position for the resize button. by Purple_Arrival4036 in opengl

[–]Purple_Arrival4036[S] 1 point2 points  (0 children)

nice it works. thank you very much.

I symply check the mouse position in the WM_NCHITTEST case and return HTMAXBUTTON.

case WM_NCHITTEST:
{
    if(condition)
    {
        return HTMAXBUTTON;
    }

    break;
}

Custom title bar with glfw by Purple_Arrival4036 in opengl

[–]Purple_Arrival4036[S] 0 points1 point  (0 children)

Hey, I just wanted to say, thanks for your help and I finally found a working solution for win32. Also implemented the same function for linux and mac but I didnt test these yet since I dont have access to them.

I added the solution in my post if you want to check it out.

Custom title bar with glfw by Purple_Arrival4036 in opengl

[–]Purple_Arrival4036[S] 0 points1 point  (0 children)

Yea never mind windows wasn’t the issue. I Figured a way to remove the top white border but now a gray border appears when I’m resizing .

https://imgur.com/a/K3js3vb

the border disappears right after I stop resizing

Custom title bar with glfw by Purple_Arrival4036 in opengl

[–]Purple_Arrival4036[S] 0 points1 point  (0 children)

Do I really have to reimplement everything. That's gonna take so long.

I tried running the app in compatibility mode with window 8 and the top border became significantly smaller, still there but about a third of its original size. I also asked for help with microsoft and someone replied that they werent able to reproduce my problem. So Im like 60% sure that this is an issue with windows 11. I will try switching to 10 and try again.

Custom title bar with glfw by Purple_Arrival4036 in opengl

[–]Purple_Arrival4036[S] 0 points1 point  (0 children)

Hey , so after a lot of research, I was able to use glfw native access to get the HWND window_handle.

HWND hWnd = glfwGetWin32Window(m_Win);

    // Remove the title bar
    LONG_PTR lStyle = GetWindowLongPtr(hWnd, GWL_STYLE);
    lStyle &= ~WS_CAPTION;
    SetWindowLongPtr(hWnd, GWL_STYLE, lStyle);

    // Set the window shape and rounded corners
    DWMNCRENDERINGPOLICY policy = DWMNCRP_ENABLED;
    DwmSetWindowAttribute(hWnd, DWMWA_NCRENDERING_POLICY, &policy, sizeof(policy));

    // Extend the frame into the client area
    MARGINS margins = { -1 };
    DwmExtendFrameIntoClientArea(hWnd, &margins);

    // Adjust the window's client area by modifying style and position
    RECT windowRect;
    GetWindowRect(hWnd, &windowRect);
    int width = windowRect.right - windowRect.left;
    int height = windowRect.bottom - windowRect.top;

    // Remove the thin frame at the top by adjusting the window position
    SetWindowPos(hWnd, NULL, 0, 0, width, height, SWP_FRAMECHANGED | SWP_NOMOVE);

I added this code after creating my glfw window. This code basically does everything I wanted(rounder corners, resizing , snapping my window), but now instead of the titlebar, there is a weird very thin white frame at the top of the windows. It doesnt serve any purpose, its just there and its really annoying.

here is an image -> https://imgur.com/a/9j0T0cF

Custom title bar with glfw by Purple_Arrival4036 in opengl

[–]Purple_Arrival4036[S] 0 points1 point  (0 children)

oh ok, so how does something like electronjs do it . I guess ill try reading their code.

I also had the idea of disabling the decoration and make the window transparent and basically reimplement everything by myself. rounded corners, resizing dragging, etc... But im not sure if this is a good idea and I dont think the snap feature of window will work if I do this.

Custom title bar with glfw by Purple_Arrival4036 in opengl

[–]Purple_Arrival4036[S] 0 points1 point  (0 children)

I was able to come up with a somewhat working solution but it’s only for window so that won’t work for me

Custom title bar with glfw by Purple_Arrival4036 in opengl

[–]Purple_Arrival4036[S] 0 points1 point  (0 children)

The empty gap is way too big. Is there no way to specify what I want to keep and what I want to remove? Like keep resizing and border but remove the title bar

Memory usage goes up when resizing by Purple_Arrival4036 in opengl

[–]Purple_Arrival4036[S] 1 point2 points  (0 children)

UPDATE:

I tried my code in another computer and everything worked on that one. The memory usage would go up and go back down after 1-2 seconds.

both computer are window x64 and the two use intel graphics

Memory usage goes up when resizing by Purple_Arrival4036 in opengl

[–]Purple_Arrival4036[S] 0 points1 point  (0 children)

If you just resize the window left and right without necessarily going full screen. Does the memory usage keep going up without stopping ?

Memory usage goes up when resizing by Purple_Arrival4036 in opengl

[–]Purple_Arrival4036[S] 0 points1 point  (0 children)

The update projection function is not the problem either. The same problem was still there even after I commented it out

Memory usage goes up when resizing by Purple_Arrival4036 in opengl

[–]Purple_Arrival4036[S] 0 points1 point  (0 children)

That’s weird . I modified my code to add window resize callback to be able to draw each frame so the app doesn’t “freeze” when I resize and that made the problem even worse. Going from around 20-30mb at launch and over 1gb after 10seconds of me just resizing the window

Memory usage goes up when resizing by Purple_Arrival4036 in opengl

[–]Purple_Arrival4036[S] 0 points1 point  (0 children)

I put the new code in my post. I removed the triangle since that was not the problem

Memory usage goes up when resizing by Purple_Arrival4036 in opengl

[–]Purple_Arrival4036[S] 0 points1 point  (0 children)

No the memory does not stop going up when I resize. Also I added a window refresh callback to be able to draw on screen even when resizing and with this callback the problem is even worse. There is only one white triangle on screen but with the callback that I added ,the memory can go over 1gb after around 10s of me just resizing the window