Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Hide Windows Cursor

  1. #11
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    Hide Windows Cursor

    Quote Originally Posted by WILL
    I can help but read this a scratch my head. Phoenix 2D uses SDL for rendering, right?
    No, OpenGL for Rendering and GLFW for window handling.
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  2. #12

    Hide Windows Cursor

    I have never used phoenix, I thought phoenix works under delphi and windows, so no reason to assume screen.cursor wouldn't work. That is teh system I use for my directx projects.
    The views expressed on this programme are bloody good ones. - Fred Dagg

  3. #13
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    Hide Windows Cursor

    Ok, I see. Well it wouldn't be using SDL for rendering anyways as the SDL/OpenGL combination would still have GL as the renderer, but SDL for windows management.

    Am I not mistaken in thinking that at some point Phoenix did use SDL for windows management? I could have sworn... :scratch:
    Jason McMillen
    Pascal Game Development
    Co-Founder





  4. #14

    Hide Windows Cursor

    Sorry for not answering this earlier, been at a buissnes trip for a week, you can hide the cursor with:

    Code:
      uses glfw;
    
      glfwDisable( GLFW_MOUSE_CURSOR );
    Amnoxx

    Oh, and this code appears to be an approximate replacement for return(random() & 0x01);

    Phoenix Wiki
    http://www.phoenixlib.net/

    Phoenix Forum
    http://www.pascalgamedevelopment.com/viewforum.php?f=71

  5. #15
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    Hide Windows Cursor

    Hi Andreaz

    That turns off the cursor for all windows, not just the Phoneix window. If in windowed mode I go outsie of the window border I expect to see the windows cursor. Is there a way to just turn ff the curson for the phoneix window and not all windows.

    Cheers
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  6. #16

    Hide Windows Cursor

    GLFW sadly doesnt support that out of the box,

    https://sourceforge.net/forum/messag...msg_id=4287659

    thats one of the drawbacks with platform independent librarys they only implement stuff that works on all platforms...

    You have to do what TScreen does basically:

    Code:
    procedure TScreen.SetCursor(Value: TCursor);
    var
      P: TPoint;
      Handle: HWND;
      Code: Longint;
    begin
      if Value <> Cursor then
      begin
        FCursor &#58;= Value;
        if Value = crDefault then
        begin
          &#123; Reset the cursor to the default by sending a WM_SETCURSOR to the
            window under the cursor &#125;
          GetCursorPos&#40;P&#41;;
          Handle &#58;= WindowFromPoint&#40;P&#41;;
          if &#40;Handle <> 0&#41; and
            &#40;GetWindowThreadProcessId&#40;Handle, nil&#41; = GetCurrentThreadId&#41; then
          begin
            Code &#58;= SendMessage&#40;Handle, WM_NCHITTEST, 0, LongInt&#40;PointToSmallPoint&#40;P&#41;&#41;&#41;;
            SendMessage&#40;Handle, WM_SETCURSOR, Handle, MakeLong&#40;Code, WM_MOUSEMOVE&#41;&#41;;
            Exit;
          end;
        end;
        Windows.SetCursor&#40;Cursors&#91;Value&#93;&#41;;
      end;
      Inc&#40;FCursorCount&#41;;
    end;
    Amnoxx

    Oh, and this code appears to be an approximate replacement for return(random() & 0x01);

    Phoenix Wiki
    http://www.phoenixlib.net/

    Phoenix Forum
    http://www.pascalgamedevelopment.com/viewforum.php?f=71

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •