Author Topic: Early WIP on v2.55  (Read 8897 times)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1190
    • zapsolution
Re: Early WIP on v2.55
« Reply #525 on: January 17, 2019, 12:48:34 pm »
Here they are.

All text must be always written in pure white hover a full black background (see empty background.rtf)

They must be edited with WordPad, and the font to be used is "Segoe UI symbol".

Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1017
Re: Early WIP on v2.55
« Reply #526 on: January 17, 2019, 08:27:13 pm »
While I'm fixing the RTFs, please consider the following.

While the model loads with the splitter moved sideways, the spinner pops up and rolls sideways as well. Do you think it will be reasonable to change its positioning so that it pops up at the center of its top-level parent (the app main window) rather than in the middle of its immediate parent (3D viewport) that may be shifted sideways partially or completely out of view?
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1017
Re: Early WIP on v2.55
« Reply #527 on: January 17, 2019, 10:58:27 pm »
We could use GetViewRect to compute the correct location.

Isn't the spinner part of pandora's control palette? If yes and the spinner popup position is hardcoded there, then perhaps it would be reasonable to make fixes directly in the library code. I guess its popping up in the middle of top level parent (i.e. the app main window) is universal for all possible use cases I can think of.

Quote
I shall work on the two problems tomorrow.

God save us from problems, and we shall deal with issues ourselves. ;D
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1190
    • zapsolution
Re: Early WIP on v2.55
« Reply #528 on: January 18, 2019, 02:48:44 pm »
OK, change all call to ZI_SpinnerInit with gP.hMain rather than gP.hGL

and for the splitter and helper conflict i made these small changes

void ShowHelp() {
    if (IsWindowVisible(gP.hToast)) { HideToast(); }
    if (IsWindowVisible(gP.hOverlay)) { PostMessage(gP.hMain, WM_COMMAND, MAKLNG(MENU_LIGHTSETTING, 0), 0); } // Hide the overlay
    SetWindowPos(gP.hHelp, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
    ShowWindow(gP.hHelp, SW_SHOWNOACTIVATE);

    HWND hScroll = GetScrollHandle(GetDlgItem(gP.hHelp, IDT_HELPTOPIC));
    if (hScroll) {
        ScrollBarProc(hScroll, WM_SIZE, 0, 0);
        WindowRedraw(hScroll);
    }
    SetFocus(gP.hMain); // 01-15-2019
}

void HideHelp() {
    if (IsWindowVisible(gP.hHelp)) {
        ShowWindow(gP.hHelp, SW_HIDE);
        SetWindowPos(gP.hHelp, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
        gP.bRedraw = TRUE;
        SetFocus(gP.hMain);
        PutFocusOn(gP.hGL);
    }
}



and add this function at the end of Tools.h

Code: [Select]
BOOL EnableShowDragging(BOOL* activate) {
    BOOL bRet = (FALSE != *activate);
    SystemParametersInfo(SPI_GETDRAGFULLWINDOWS, 0, activate, 0);
    bRet = SystemParametersInfo(SPI_SETDRAGFULLWINDOWS, bRet, 0, 0);
    return bRet;
}

To be used like this in Main.cpp

                    // Force redrawing of the OpenGL control
                    gl_WndProc(gP.hGL, WM_SIZE, 0, MAKLNG(dpi(ClientWGL), dpi(ClientH)));

                    BOOL enable = TRUE;
                    BOOL previousMode = EnableShowDragging(&enable);


                    // Show the main window
                    ShowWindow(gP.hMain, nCmdShow);
                    ShowWindow(gP.hGL, SW_SHOW);
                    ShowWindow(gP.hSplitter, SW_SHOW);              // MLL 12-25-2018: safe to show now
                    SetForegroundWindow(gP.hMain);                  // Slightly Higher Priority
                    SetFocus(gP.hMain);                             // Sets Keyboard Focus To The Window
                    gP.bRedraw = TRUE; // Redraw the OpenGL scene

                    if (lstrlen(lpCmdLine)) { // Check the command line
                        ProccessCommandline(lpCmdLine);
                    }
                    // =================================================================

                    // Disable the taskbar icon flashing
                    FLASHWINFO fi = { 0 };
                    fi.cbSize = sizeof(fi);
                    fi.hwnd = gP.hMain;
                    FlashWindowEx(&fi);

                    // MLL 11-15-2018: enforce OpenGL redraw first
                    gP.bRedraw = TRUE;
                    gl_DrawScene();
                    if (lstrlen(lpCmdLine) == 0) {
                        popupToastWindow(L"Load Model", L"Use the File->Load model... dialog to load the model file, or"
                        L"\ndrag-and-drop the model file icon anywhere in the viewport.");
                    }

                    while (GetMessage(&msg, NULL, 0, 0)) {
                        if (!DetectHotKeys(&msg)) { // MLL 11-12-2018: eat global "hotkey" (ESC, TAB, F1, F2) messages
                            TranslateMessage(&msg);
                            DispatchMessage(&msg);
                        }
                    }

                    if (previousMode) EnableShowDragging(&enable); // set the flag back to the old value

                    // MLL 10-18-2018: free OpenGL resources
                    Cleanup();

                    // PAT: 02-23-2018 (removed, see fpsInit/printFPS)
                    // Delete GLFont.
                    //ZI_DeleteGLFont(gP.glfont);

                    nRet = (long)msg.wParam;
                }


Without window redrawing all fancy stuffs are defeated, i need this for my ASUS Intel based.


To center correctly the Spinner, please use the attached Main.cpp
and look at CenterToViewport(hSpin);
« Last Edit: January 18, 2019, 02:53:32 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1190
    • zapsolution
Re: Early WIP on v2.55
« Reply #529 on: January 19, 2019, 02:13:53 pm »
Another change for Help.h

void ShowHelp() {
    if (IsWindowVisible(gP.hToast)) { HideToast(); }
    if (IsWindowVisible(gP.hOverlay)) { PostMessage(gP.hMain, WM_COMMAND, MAKLNG(MENU_LIGHTSETTING, 0), 0); } // Hide the overlay
    SetWindowPos(gP.hHelp, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
    ShowWindow(gP.hHelp, SW_SHOWNOACTIVATE);
    SetWindowPos(gP.hHelp, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);

    HWND hScroll = GetScrollHandle(GetDlgItem(gP.hHelp, IDT_HELPTOPIC));
    if (hScroll) {
        ScrollBarProc(hScroll, WM_SIZE, 0, 0);
        WindowRedraw(hScroll);
    }
    SetFocus(gP.hMain); // 01-15-2019
}


Added:
I have attached the new help converted from rtf to png, thank you!
« Last Edit: January 19, 2019, 04:47:20 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1017
Re: Early WIP on v2.55
« Reply #530 on: January 19, 2019, 08:30:29 pm »
Thanks!

Now, your immediate code fixes seem to be working for me as expected.

Yet there's one more glitch that needs attention. Suppose I've loaded my monkey and want to texture it. I move the splitter sideways to open my hypothetical UV mapper. Then I open the OR help to read up on how I should proceed. If now I try to orbit or pan my monkey to better view it in gP.hGL through the help text, its rotation and position appears chaotic. OTOH everything works perfectly if I close the help overlay.

Apparently the mouse coords as read from the help overlay are relayed to gP.hGL for processing in their raw form rather than having been previously remapped from the help overlay to gP.hGL screen space.

Do you think it can be fixed without resetting gP.hGL to full view when the help text pops up?
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1190
    • zapsolution
Re: Early WIP on v2.55
« Reply #531 on: January 20, 2019, 11:25:38 am »
I came with this, your thought?

Code: [Select]
void EchoGLwndproc(IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam) {
    if (gP.splitXoffset) {
        POINT p = { 0 };
        switch (uMsg) {
        case WM_LBUTTONDOWN:
        case WM_RBUTTONDOWN:
        case WM_MBUTTONDOWN:
        case WM_MOUSEMOVE:
            p.x = LOINT(lParam) + gP.splitXoffset;
            p.y = HIINT(lParam);
            lParam = (LPARAM)MAKELONG(p.x, p.y);
            break;
        }
    }
    gl_WndProc(gP.hGL, uMsg, wParam, lParam);
}

LRESULT CALLBACK GDImageHelpCallBack(IN HWND hWnd, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam) {
    LRESULT nRet = FALSE; // Do not stop the event processing in GDImage.
    long nCount = 0, item = 0, x = 0, y = 0, nID = ZI_MouseOverObjectID();
    POINT p = { 0 };
    BOOL DoIt;
    HWND hList;
    RECT lpr = { 0 };

    switch (uMsg) {
    case WM_SETFOCUS:
        SetFocus(gP.hMain);
        break;

    case WM_LBUTTONDOWN:
        if (nID > IDT_HELPTOPIC) {
            hList = GetDlgItem(GetParent(hWnd), IDC_HELPLIST);
            item = nID - IDT_HELPTOPIC;
            PathCombine(gP.mt.FullName, HelpFolder(), List_GetText(hList, item));
            List_SelectPlus(hList, item);
            SetWindowText(hWnd, L"");
            ZD_GetObjectXY(nID, x, y);
            ZD_SetObjectXY(ID_HELP_SELECTED, x, y, FALSE);
            // Load the new topic
            LoadPNG(hWnd, gP.mt.FullName);
            WindowRedraw(GetScrollHandle(hWnd)); // Redraw the scrollbar
            ZI_UpdateWindow(hWnd, 0);
        } else {
            //gl_WndProc(gP.hGL, uMsg, wParam, lParam);
            EchoGLwndproc(uMsg, wParam, lParam);
            nRet = 1;
        }
        break;
    case WM_KEYDOWN:
        hList = GetDlgItem(GetParent(hWnd), IDC_HELPLIST);
        item = List_GetCursel(hList);
        nCount = List_GetCount(hList);
        DoIt = FALSE;
        switch (wParam) {
        case VK_UP:
        case VK_NUMPAD8:
            if (item > 1) {
                item--; List_SelectPlus(hList, item);
                DoIt = TRUE;
            }
            break;
        case VK_DOWN:
        case VK_NUMPAD2:
            if (item < nCount) {
                item++; List_SelectPlus(hList, item);
                DoIt = TRUE;
            }
            break;
        }
        if (DoIt) {
            nID = IDT_HELPTOPIC + item;
            PathCombine(gP.mt.FullName, HelpFolder(), List_GetText(hList, item));
            SetWindowText(hWnd, L"");
            ZD_GetObjectXY(nID, x, y);
            ZD_SetObjectXY(ID_HELP_SELECTED, x, y, FALSE);
            // Load the new topic
            LoadPNG(hWnd, gP.mt.FullName);
            WindowRedraw(GetScrollHandle(hWnd)); // Redraw the scrollbar
            ZI_UpdateWindow(hWnd, 0);
        }
        break;
    case WM_NCPAINT:
        skUpdateWindow(GetScrollHandle(hWnd), 0);
        nRet = 1; // We are using a custom ScrollBar, thus get rid of Windows default
        break;
    case WM_VSCROLL:
    case WM_HSCROLL:
        skUpdateWindow(GetScrollHandle(hWnd), 0);
        break;
    case WM_MOUSEWHEEL:
        p.x = LOINT(lParam);
        p.y = HIINT(lParam);
        ScreenToClient(hWnd, &p);
        GetClientRect(hWnd, &lpr);
        if ((p.x < 280) || (p.x > Width(lpr) - 100)) { // Limit help scrolling zone to the sides, and keep center for gP.hGL
            skUpdateWindow(GetScrollHandle(hWnd), 0);
        } else {
            //gl_WndProc(gP.hGL, uMsg, wParam, lParam);
            EchoGLwndproc(uMsg, wParam, lParam);
            nRet = 1;
        }
        break;
    default:
        //gl_WndProc(gP.hGL, uMsg, wParam, lParam);
        EchoGLwndproc(uMsg, wParam, lParam);
    }
    return nRet;
}
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1017
Re: Early WIP on v2.55
« Reply #532 on: January 20, 2019, 12:41:09 pm »
Seems to be working perfectly fine for me, thanks a lot! :)
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1190
    • zapsolution
Re: Early WIP on v2.55
« Reply #533 on: January 20, 2019, 02:05:27 pm »
Do you think we could release the current status as a beta 3.00 version?
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1017
Re: Early WIP on v2.55
« Reply #534 on: January 20, 2019, 05:38:35 pm »
No, I think it should be either v2.75 or a WIP alpha of v3.00. Beta should have an initial FBO/post-processing capability and a new camera with associated foolproof frustum culling. We should have a couple of fundamentally new features to claim grounds for promotion to the next major version. What we've had so far since VBO were mostly bells and whistles.

I have a sample CPP implementation of both but need courage to integrate it in the ObjReader code.

I've been busy recently attending to my health problems and will likely go to the hospital for about 3 weeks for some surgery starting this February 15.
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1190
    • zapsolution
Re: Early WIP on v2.55
« Reply #535 on: January 20, 2019, 06:42:50 pm »
Quote
I've been busy recently attending to my health problems and will likely go to the hospital for about 3 weeks for some surgery starting this February 15.
Ouch!, i wish you all my best for your future surgery, i think i am very lucky myself, even if i twisted my other foot two monthes ago, i have never been to hospital. However i feel the weight of years, and my ankle problem is probably a direct consequence of my sedentary life (too much time spent in front of a computer). In winter time i am doing 30 push-ups + 30 flexions per day, but during summer time i am doing much more because of garden care and swimming pool cleaning, there is always something to do in a house, but that is the price i have to pay to enjoy the place i live in. I shall turn 70 when you will be in the hospital (24 february).
« Last Edit: January 20, 2019, 06:45:02 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1017
Re: Early WIP on v2.55
« Reply #536 on: January 20, 2019, 08:25:19 pm »
Thank you, my friend!

I'm almost exactly 7 years younger than you (63 y.o. this March 3) and I'm likely to celebrate this BD in the hospital bed. ;)

Yet the surgery (shunting the arteries that have been clogged with cholesterol clots) isn't that scary if post-surgical inflammation is avoided, and certainly has a very positive effect. I had it on my right leg 3 years ago, and I'm still feeling myself comfortable with it allowing me to walk up to a kilometer without intermittent ca. 5 minute rests. OTOH my left leg started to fail me around two months ago, and narrowed my walking distance to some 100 paces only. High time to have things straightened out for the next 3 years or hopefully more. ;)

You have a beautiful place to live in, Patrice. I haven't seen your house but your summer garden pictures are really very very impressive. :)
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1017
Re: Early WIP on v2.55
« Reply #537 on: January 20, 2019, 08:49:56 pm »
Patrice,

Will you please make the following changes in wWinMain() of Main.cpp:

........
                AppendMenu(hLightsMenu, MF_ENABLED, MENU_LIGHTSETTING,L"Control panel\t[F2]");// L"Simplified light settings");
........
                AppendMenu(hHelpMenu, MF_ENABLED, MENU_HELP_INDEX, L"Index...\t[F1]"); // PAT: 12-31-2018
........


and all the other places in that function marked with // !!! ACHTUNG !!! String contains literal TAB!. The tab justifies what's written to the right of it, to the right side of menu popup, and adjusts the gap automatically. This way the menus are going to look better ordered and more classic to Windows.
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1190
    • zapsolution
Re: Early WIP on v2.55
« Reply #538 on: January 20, 2019, 10:15:41 pm »
Ok, done thank you.
Patrice
(Always working with the latest Windows version available...)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1190
    • zapsolution
Re: Early WIP on v2.55
« Reply #539 on: January 22, 2019, 01:03:40 pm »
It is almost impossible to use full material transparent sections when a bump texture is also used, even when using A2C.
Do you think that is something that could be fixed?

And what about ShaderToy?
« Last Edit: January 22, 2019, 02:27:37 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)